Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34754

Debug Assertion Failed in Release mode when used with OpenCV ( VideoCapture::open )

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 4.8.4
    • Other
    • None
    • Windows 7 64-bit, QtCreator and MSVS 2010

    Description

      I've been trying to use cv::VideoCapture::open("< path to video file >") in QtCreator (opencv added). Even though the program runs without errors in "bebug mode" (debug build), it gives below runtime error in "release mode" (release build).

      Debug Assertion Failed File: f:/dd/vctools/crt_bld/self_x86/src/isctype.c Line: 56 Expression: (unsigned)(c+1) <= 256

      It is a simple program which uses only cv::VideoCapture::open() [for testing purposes]

      Below is the .pro file

      QT += core gui

      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      TARGET = untitled
      TEMPLATE = app
      SOURCES += main.cpp\
      mainwindow.cpp
      HEADERS += mainwindow.h
      FORMS += mainwindow.ui

      INCLUDEPATH += C:/C/opencv/build/include
      INCLUDEPATH += C:/C/opencv/build/include/opencv

      LIBS += C:/C/opencv/build/x86/vc10/lib/opencv_highgui240d.lib
      LIBS += C:/C/opencv/build/x86/vc10/lib/opencv_highgui240.lib

      LIBS += C:/C/opencv/build/x86/vc10/bin/opencv_highgui240d.dll
      LIBS += C:/C/opencv/build/x86/vc10/bin/opencv_highgui240.dll

      Below is the Header file

      #include <QMainWindow>
      #include <opencv2/highgui/highgui.hpp>
      #include <opencv2/core/core.hpp>

      namespace Ui {
      class MainWindow;
      }

      class MainWindow : public QMainWindow
      {
      Q_OBJECT

      public:
      explicit MainWindow(QWidget *parent = 0);
      ~MainWindow();

      private:
      Ui::MainWindow *ui;
      cv::VideoCapture vcap;
      };

      Below is the .cpp file

      #include "mainwindow.h"
      #include "ui_mainwindow.h"

      MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
      {
      ui->setupUi(this);
      vcap.open("C:/Users/ANURUDDHA/pedestrians/ThreePastShop2cor.mpg");
      }

      MainWindow::~MainWindow()
      {
      delete ui;
      }

      When I pass an int as the argument to cv::VideoCapture::open() [eg: vcap.open(0)] it runs without errors in both debug and release build and opens webcam successfully. Problem comes only when I pass a String to arguments.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            macadder Jason McDonald
            anuruddha Anuruddha Hettiarachchi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes