bajoelkid12
1st November 2011, 18:13
Hi,
I'm having a problem when i tried to execute my program.. I have met the same problem before and i can solve it. My problem before is some kind of missing .dll.. But now, i don't know what kind of problem is this.. I know this is an access violation, but i just don't know where.. Could you please help me ?
Here is my code and the debugger result..
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include "opencv2/opencv.hpp"
#include "stdio.h"
#include <opencv/cvaux.h>
#include <opencv/cxcore.h>
int main(int argc, char **argv)
{
CvCapture capture1;
IplImage *frame;
double t,ms = 0;
int key = 0;
capture1 = cvCaptureFromFile("chi-tabaywatch.avi");
cvNamedWindow("JCXSUPERTAMARK5",1);
while (key != 'q')
{
t = (double)cvGetTickCount();
frame = cvQueryFrame(capture1);
cvShowImage("JCXSUPERTAMARK5",frame);
key = cvWaitKey(1);
t = (double)cvGetTickCount() -t;
ms += t / ((double)cvGetTickFrequency() * 1000.0);
if (ceil(ms) >= 1000)
{
cvSaveImage("img.jpg",frame);
ms = 0;
}
}
cvReleaseCapture(capture1);
cvDestroyWindow("JCXSUPERTAMARK5");
return 0;
}
Dump of assembler code from 0x9cfffe to 0x9d0076:
0x009cfffe: add %al,(%eax)
0x009d0000: add %al,0x0(%eax)
0x009d0003: add %al,(%ecx)
0x009d0005: add %al,(%eax)
0x009d0007: add %ah,%dl
0x009d0009: add %eax,(%eax)
0x009d000b: add %cl,(%edi)
0x009d000d: add %eax,(%eax)
0x009d000f: add %ah,0x5a(%esi)
0x009d0012: pop %es //here is where the arrow pointing at//
0x009d0013: add %dl,0x22(%ebp)
0x009d0016: add $0x0,%al
0x009d0018: push %esi
0x009d0019: add $0x3000000,%eax
0x009d001e: add %al,(%eax)
0x009d0020: and %al,(%eax)
0x009d0022: add %al,(%eax)
0x009d0024: add %eax,(%eax)
0x009d0026: add %al,(%eax)
0x009d0028: (bad)
0x009d0029: (bad)
0x009d002a: (bad)
0x009d002b: incl (%eax)
0x009d002d: add %al,(%eax)
0x009d002f: add %bh,%bh
0x009d0031: (bad)
0x009d0032: (bad)
0x009d0033: lcall *0x2400007e(%ecx)
0x009d0039: add %al,(%eax)
0x009d003b: add %ah,(%eax,%eax,1)
0x009d003e: add %al,(%eax)
0x009d0040: xor (%eax),%eax
0x009d0042: add %al,(%eax)
0x009d0044: pusha
0x009d0045: add %al,(%eax)
0x009d0047: add %ah,0x0(%eax)
0x009d004a: add %al,(%eax)
0x009d004c: add %al,(%eax)
0x009d004e: add %al,(%eax)
0x009d0050: sbb %al,(%eax)
0x009d0052: add %al,(%eax)
0x009d0054: add %al,(%eax)
0x009d0056: add %al,(%eax)
0x009d0058: add %al,(%eax)
0x009d005a: add %al,(%eax)
0x009d005c: add %al,(%eax)
0x009d005e: add %al,(%eax)
0x009d0060: add %al,(%eax)
0x009d0062: add %al,(%eax)
0x009d0064: pop %es
0x009d0065: js 0x9d0067
0x009d0067: add %bh,(%eax,%eax,1)
0x009d006a: add %al,(%eax)
0x009d006c: push %esi
0x009d006d: add $0x3000000,%eax
0x009d0072: add %al,(%eax)
0x009d0074: add %eax,(%eax)
End of assembler dump.
I'm having a problem when i tried to execute my program.. I have met the same problem before and i can solve it. My problem before is some kind of missing .dll.. But now, i don't know what kind of problem is this.. I know this is an access violation, but i just don't know where.. Could you please help me ?
Here is my code and the debugger result..
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include "opencv2/opencv.hpp"
#include "stdio.h"
#include <opencv/cvaux.h>
#include <opencv/cxcore.h>
int main(int argc, char **argv)
{
CvCapture capture1;
IplImage *frame;
double t,ms = 0;
int key = 0;
capture1 = cvCaptureFromFile("chi-tabaywatch.avi");
cvNamedWindow("JCXSUPERTAMARK5",1);
while (key != 'q')
{
t = (double)cvGetTickCount();
frame = cvQueryFrame(capture1);
cvShowImage("JCXSUPERTAMARK5",frame);
key = cvWaitKey(1);
t = (double)cvGetTickCount() -t;
ms += t / ((double)cvGetTickFrequency() * 1000.0);
if (ceil(ms) >= 1000)
{
cvSaveImage("img.jpg",frame);
ms = 0;
}
}
cvReleaseCapture(capture1);
cvDestroyWindow("JCXSUPERTAMARK5");
return 0;
}
Dump of assembler code from 0x9cfffe to 0x9d0076:
0x009cfffe: add %al,(%eax)
0x009d0000: add %al,0x0(%eax)
0x009d0003: add %al,(%ecx)
0x009d0005: add %al,(%eax)
0x009d0007: add %ah,%dl
0x009d0009: add %eax,(%eax)
0x009d000b: add %cl,(%edi)
0x009d000d: add %eax,(%eax)
0x009d000f: add %ah,0x5a(%esi)
0x009d0012: pop %es //here is where the arrow pointing at//
0x009d0013: add %dl,0x22(%ebp)
0x009d0016: add $0x0,%al
0x009d0018: push %esi
0x009d0019: add $0x3000000,%eax
0x009d001e: add %al,(%eax)
0x009d0020: and %al,(%eax)
0x009d0022: add %al,(%eax)
0x009d0024: add %eax,(%eax)
0x009d0026: add %al,(%eax)
0x009d0028: (bad)
0x009d0029: (bad)
0x009d002a: (bad)
0x009d002b: incl (%eax)
0x009d002d: add %al,(%eax)
0x009d002f: add %bh,%bh
0x009d0031: (bad)
0x009d0032: (bad)
0x009d0033: lcall *0x2400007e(%ecx)
0x009d0039: add %al,(%eax)
0x009d003b: add %ah,(%eax,%eax,1)
0x009d003e: add %al,(%eax)
0x009d0040: xor (%eax),%eax
0x009d0042: add %al,(%eax)
0x009d0044: pusha
0x009d0045: add %al,(%eax)
0x009d0047: add %ah,0x0(%eax)
0x009d004a: add %al,(%eax)
0x009d004c: add %al,(%eax)
0x009d004e: add %al,(%eax)
0x009d0050: sbb %al,(%eax)
0x009d0052: add %al,(%eax)
0x009d0054: add %al,(%eax)
0x009d0056: add %al,(%eax)
0x009d0058: add %al,(%eax)
0x009d005a: add %al,(%eax)
0x009d005c: add %al,(%eax)
0x009d005e: add %al,(%eax)
0x009d0060: add %al,(%eax)
0x009d0062: add %al,(%eax)
0x009d0064: pop %es
0x009d0065: js 0x9d0067
0x009d0067: add %bh,(%eax,%eax,1)
0x009d006a: add %al,(%eax)
0x009d006c: push %esi
0x009d006d: add $0x3000000,%eax
0x009d0072: add %al,(%eax)
0x009d0074: add %eax,(%eax)
End of assembler dump.