Ask Your Question

AnuruddhaHettiarachchi's profile - activity

2017-12-04 07:55:25 -0600 received badge  Popular Question (source)
2013-06-28 13:28:21 -0600 commented answer [VideoCapture::open][Qt Creator]Debug Assertion Failed (unsigned)(c+1) <= 256

Can't edit posts.. Internal error.. Sorry for the formatting again..

2013-06-28 13:11:14 -0600 commented answer [VideoCapture::open][Qt Creator]Debug Assertion Failed (unsigned)(c+1) <= 256

oops.. sorry about the formatting.. :(

mainwindow.cpp

include "mainwindow.h"

include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)

{

ui-&gt;setupUi(this); 

vcap.open("C:/Users/ANURUDDHA/pedestrians/ThreePastShop2cor.mpg");

}

MainWindow::~MainWindow() {

delete ui;

}

2013-06-28 13:08:15 -0600 commented answer [VideoCapture::open][Qt Creator]Debug Assertion Failed (unsigned)(c+1) <= 256

Yes, I did use relevant libs in relevant builds (opencv_highgui240d.lib in debug build and opencv_highgui240.lib in release build). As it did not help, I happened to try out both types of libs in both build (which is kinda weird).

I use VideoCapture to open videos/image sequences. Above one is one of such a image sequence.

Here is the code.. So simple, just VideoCapture.

.pro file is as above (only opencv_highgui240.lib this time)

mainwindow.h

include <QMainWindow>

include <opencv2/highgui/highgui.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; };

2013-06-27 11:35:57 -0600 received badge  Supporter (source)
2013-06-27 11:33:14 -0600 commented answer [VideoCapture::open][Qt Creator]Debug Assertion Failed (unsigned)(c+1) <= 256

Thanks for the response Notas. Appreciated.

If I link only release version (opencv_highgui240.lib) program works neither in release nor debug mode. It pops up this error which might be due to poor linking. The program has unexpectedly finished. C:\Users\ANURUDDHA.... *.exe exited with code -1073741515

If I link only debug version (opencv_highgui240d.lib) the same Assertion Failed error shows up (only in release mode again) Any ideas?

This image file is one of a sequence of images used for testing pedestrian detection algorithms.

Thanks again.

2013-06-27 06:39:58 -0600 asked a question [VideoCapture::open][Qt Creator]Debug Assertion Failed (unsigned)(c+1) <= 256

I try to use cv::VideoCapture::open("path to file"). Even though the program runs without errors in bebug mode, it gives below runtime error in release mode.

Debug Assertion Failed File: f:/dd/vctools/crt_bld/self_x86/src/isctype.c Line: 56

Expression: (unsigned)(c+1) <= 256

-----------------------------------------------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

---------------------------------------------Erroneous line ---------------------------------------

vcap.open("C:/Users/ANURUDDHA/pedestrians/ped-crossing1.jpg"); // where cv::VideoCapture vcap;

error occurs ONLY IN RELEASE. It runs without errors in debug mode.


I have added C:\C\opencv\build\x86\vc10\bin; to system path which contains opencv_ffmpeg240.dll and other .dll

Really appriciate your kind assistance, will save a lot of time.. Thanks in advance.