Ask Your Question

M.A's profile - activity

2020-09-17 12:25:16 -0600 received badge  Popular Question (source)
2015-03-23 05:37:55 -0600 received badge  Supporter (source)
2015-03-23 05:37:49 -0600 received badge  Scholar (source)
2015-03-22 04:41:08 -0600 commented answer OpenCV Error: Assertion failed (std::abs(dsize.width*2 - ssize.width) <= 2

Sir in this you have used visual studio or something else?

2015-03-22 04:17:33 -0600 commented answer OpenCV Error: Assertion failed (std::abs(dsize.width*2 - ssize.width) <= 2

sir please then re write it for me in c++

2015-03-22 03:50:31 -0600 commented answer OpenCV Error: Assertion failed (std::abs(dsize.width*2 - ssize.width) <= 2

Sir I have to work in C not c++ please help me with this problem I am using Dev C++ IDE. Please tell me how can I get ride of this problem?

2015-03-22 03:33:06 -0600 asked a question OpenCV Error: Assertion failed (std::abs(dsize.width*2 - ssize.width) <= 2

Please help me with this. I am working on Opencv as beginner.I am using Dev C++ please help me with this error Message" OpenCV Error: Assertion failed (std::abs(dsize.width*2 - ssize.width) <= 2

&& st d::abs(dsize.height*2 - ssize.height) <= 2) in pyrDown_, file C:\User\VP

\ocv\ope ncv\src\cv\cvpyramids.cpp, line 206

This application has requested the Runtime to terminate it in an unusual

way. Please contact the application's support team for more information.


Process exited with return value 3 Press any key to continue . . ." ....

My written code is here :

#include <cv.h>
#include<highgui.h>


//..........Rosenfeld80.................


IplImage* doPyrDown(IplImage *in,int filter= IPL_GAUSSIAN_5x5){
    //make sure that input image is divisible by two using
    assert(((int)in->width) % 2==0 && ((int)in->height) % 2==0);
    IplImage *out=cvCreateImage(cvSize(in->depth/2,in->height/2),in->depth,in->nChannels);
    cvPyrDown(in,out);
    return (out);
}


//..........Canny edge detector [Canny86]............


IplImage * doCanny(IplImage* in, double lowThresh, double highThresh, double aperture){
     if(in->nChannels !=1)// Canny works only with gray scale images
         return 0;      
     IplImage *out=cvCreateImage(cvGetSize(in),IPL_DEPTH_8U,1);
     cvCanny( in, out, lowThresh, highThresh, aperture );
     return (out);          
}



int main(int argc,char **argv){
IplImage* out;
IplImage* in=cvLoadImage("E:/Arshad/OpenCv/OpenCv Work/Penguins.jpg");
cvNamedWindow("Input",CV_WINDOW_AUTOSIZE);
cvShowImage("Input",in);
out =doPyrDown( in, IPL_GAUSSIAN_5x5 );
cvNamedWindow("doPyramidDown",CV_WINDOW_AUTOSIZE);
cvShowImage("doPyramidDown",out);
out = doPyrDown( out, IPL_GAUSSIAN_5x5 );
out = doCanny( out, 10, 100, 3 );
cvNamedWindow("doCanny",CV_WINDOW_AUTOSIZE);
cvShowImage("doCanny",out);
cvWaitKey(0);
cvReleaseImage(&out);
cvDestroyWindow("Input");
cvDestroyWindow("doPyramidDown");
cvDestroyWindow("doCanny");

}