Using cvGet2D OpenCV function -
i'm trying information image using function cvget2d in opencv.
i created array of 10 iplimage
pointers:
iplimage *imagearray[10];
and i'm saving 10 images webcam:
imagearray[numpicture] = cvqueryframe(capture);
when call function:
info = cvget2d(imagearray[0], 250, 100);
where info
:
cvscalar info;
i got error:
opencv error: bad argument (unrecognized or unsupported array type) in cvptr2d, file /build/buildd/opencv-2.1.0/src/cxcore/cxarray.cpp, line 1824
terminate called after throwing instance of 'cv::exception'
what(): /build/buildd/opencv-2.1.0/src/cxcore/cxarray.cpp:1824: error: (-5) unrecognized or unsupported array type in function cvptr2d
if use function cvloadimage
initialize iplimage
pointer , pass cvget2d
function, code works properly:
iplimage* imagen = cvloadimage("test0.jpg"); info = cvget2d(imagen, 250, 100);
however, want use information stored in array.
do know how can solve it?
yeah message correct.
if want store pixel value need this.
int value = 0; value = ((uchar *)(img->imagedata + i*img->widthstep))[j*img->nchannels +0]; cout << "pixel value blue channel , (i,j) coordinates: " << value << endl;
summarizing, plot or store data must create integer value (pixel value varies between 0 , 255). if want test pixel value (like in if closure or similar) can access directly pixel value without using integer value.
i think thats little bit weird when start when work 2 o 3 times work without difficulties.
Comments
Post a Comment