blobtrack_sample FGMask video assertion (Bug #924)
Description
Received an Assertion on the imageSize of 'image' parameter to cvWriteFrame(). It works fine if I changed its instantiation from
cvCreateImage(S,pFG->depth,3)
to
cvCloneImage(pImg)
I was using a MP4 file of size 450(W)x360(H).
Associated revisions
fixed #924
Merge pull request #924 from pengx17:2.4_arithm_fix
Merge remote-tracking branch 'origin/2.4'
Pull requests:
#943 from jet47:cuda-5.5-support
#944 from jet47:cmake-2.8.11-cuda-fix
#912 from SpecLad:contributing
#934 from SpecLad:parallel-for
#931 from jet47:gpu-test-fixes
#932 from bitwangyaoyao:2.4_fixBFM
#918 from bitwangyaoyao:2.4_samples
#924 from pengx17:2.4_arithm_fix
#925 from pengx17:2.4_canny_tmp_fix
#927 from bitwangyaoyao:2.4_perf
#930 from pengx17:2.4_haar_ext
#928 from apavlenko:bugfix_3027
#920 from asmorkalov:android_move
#910 from pengx17:2.4_oclgfft
#913 from janm399:2.4
#916 from bitwangyaoyao:2.4_fixPyrLK
#919 from abidrahmank:2.4
#923 from pengx17:2.4_macfix
Conflicts:
modules/calib3d/src/stereobm.cpp
modules/features2d/src/detectors.cpp
modules/gpu/src/error.cpp
modules/gpu/src/precomp.hpp
modules/imgproc/src/distransform.cpp
modules/imgproc/src/morph.cpp
modules/ocl/include/opencv2/ocl/ocl.hpp
modules/ocl/perf/perf_color.cpp
modules/ocl/perf/perf_imgproc.cpp
modules/ocl/perf/perf_match_template.cpp
modules/ocl/perf/precomp.cpp
modules/ocl/perf/precomp.hpp
modules/ocl/src/arithm.cpp
modules/ocl/src/canny.cpp
modules/ocl/src/filtering.cpp
modules/ocl/src/haar.cpp
modules/ocl/src/hog.cpp
modules/ocl/src/imgproc.cpp
modules/ocl/src/opencl/haarobjectdetect.cl
modules/ocl/src/pyrlk.cpp
modules/video/src/bgfg_gaussmix2.cpp
modules/video/src/lkpyramid.cpp
platforms/linux/scripts/cmake_arm_gnueabi_hardfp.sh
platforms/linux/scripts/cmake_arm_gnueabi_softfp.sh
platforms/scripts/ABI_compat_generator.py
samples/ocl/facedetect.cpp
History
Updated by Alexander Shishkov about 13 years ago
- Status deleted (
Open) - Assignee set to Alexander Shishkov
Updated by Alexander Shishkov about 13 years ago
More simple sample for generating this problem:
1#include "opencv2/video/video.hpp"
2#include "opencv2/highgui/highgui.hpp"
3#include <opencv2/imgproc/imgproc.hpp>
4#include <stdio.h>
5#include <iostream>
6using namespace cv;
7using namespace std;
8int main(int argc, char* argv[])
9{ /* Main function: */
10 CvCapture* pCap = NULL;
11 char* avi_name = argv[1];
12 printf("Video name = %s\n", avi_name);
13 /* Create source video: */
14 if(avi_name)
15 pCap = cvCaptureFromFile(avi_name);
16
17 if(pCap==NULL)
18 {
19 printf("\nCan't open %s file\n",avi_name);
20 return -1;
21 }
22
23 cvNamedWindow("gray");
24
25 CvVideoWriter* pFGAvi = NULL;
26
27 while(pCap)
28 { /* Main loop: */
29 IplImage* pImg = NULL;
30 pImg = cvQueryFrame(pCap);
31 if(pImg == NULL) break;
32
33 if (pFGAvi == NULL)
34 pFGAvi=cvCreateVideoWriter(
35 argv[2],
36 CV_FOURCC('x','v','i','d'),
37 25,
38 cvSize(pImg->width, pImg->height),1);
39
40 IplImage* gray = cvCreateImage(cvSize(pImg->width, pImg->height),pImg->depth,1);
41 cvCvtColor(pImg, gray, CV_BGR2GRAY);
42
43 IplImage* gray3 = cvCreateImage(cvSize(pImg->width, pImg->height),pImg->depth,3);
44 cvCvtColor(gray, gray3, CV_GRAY2BGR);
45
46 cvWriteFrame(pFGAvi, gray3);
47
48 cvShowImage("gray", gray);
49 cvWaitKey(1);
50
51 if (gray)
52 cvReleaseImage(&gray);
53 if (gray3)
54 cvReleaseImage(&gray3);
55 }
56
57 if (pFGAvi)
58 cvReleaseVideoWriter(&pFGAvi);
59
60 if(pCap)
61 cvReleaseCapture(&pCap);
62
63 pCap = cvCaptureFromFile(argv[2]);
64
65 if(pCap==NULL)
66 {
67 printf("\nCan't open %s file\n",avi_name);
68 return -1;
69 }
70
71 while(pCap)
72 { /* Main loop: */
73 IplImage* pImg = NULL;
74 pImg = cvQueryFrame(pCap);
75 if(pImg == NULL) break;
76 cvShowImage("gray", pImg);
77 cvWaitKey(1);
78 }
79
80 if(pCap)
81 cvReleaseCapture(&pCap);
82 return 0;
83} /* main() */
Updated by Alexander Shishkov about 13 years ago
Thank you for the report! Fixed in 7352 revision.
- Target version set to 2.4.0
Updated by Alexander Shishkov about 13 years ago
- Status set to Done