image show have some errors
I accept the unsigned char type data from the camera using the opencv class of mat, Then use the imshow function to display in the window, but do not know why the image displayed is a bit of a problem, The following section of the image is normal, but the upper part is abnormal purple. What's the reason for that?Can you explain it? Thank you。
Can you post code creating Mat ?
Mat imt(960,1280,CV_8UC3,ImgData);
Mat imt_dst;
resize(imt,imt_dst,Size(640,480),0,0,CV_INTERLINEAR);
namedWindow("imt",1);
namedWindow("imt_dst",1);
imshow("imt",imt);
imshow("imt_dst",imt_dst);
cvWaitKey(0);
destroyWindow("imt");
destroyWindow("imt_dst",imt_dst);
You need right step parameter .
C++: Mat::Mat(Size size, int type, void* data, size_t step=AUTO_STEP)
well,how to set up it?
if you'are getting data and width/height from camera you'll be able to get step as well , pass it like this:
Mat(Size(width , height), type ,data, step)
I set it Mat imt(Size(1280,960),CV_8UC3,ImgData,1280*3); it still wrong,is my set is wrong?
did you try : AUTO_STEP ? if it's not working search camera API how to get step parameter .
it show use of undeclared identifer ‘AUTO_STEP’,which include file it define at?
Mat::AUTO_STEP
image is still wrong