c++ - opencv: single pixal assignment confusion -
i working opencv , c++ project , found weird thing: when try access single pixal value in iplimage , assign other value, run result can operate part of whole image. relevant code: iplimage* output_frame = cvcreateimage(size, ipl_depth_8u, 1); iplimage* current_frame = cvcreateimage(size, ipl_depth_8u, 1); while((current_frame = cvqueryframe(video_gray)) != 0 ) { (int row=0;row<height;row++) { uchar* ptr_current_frame = (uchar *)(current_frame->imagedata+current_frame->widthstep*row); uchar* ptr_output_frame = (uchar *)(output_frame->imagedata+output_frame->widthstep*row); (int cols=0;cols<width;cols++) { //other codes... ptr_output_frame[cols]=ptr_current_frame[cols]; } } } the result left part of image copied output_frame. , when run following code: iplimage* output_frame = cvcreateimage(size, ipl_depth_8u, 1); iplimage* current_frame = cvcreateimage(size, ipl_depth_8u, 1); while((curr...