2014-05-20 10:54:27 -0500 asked a question Discontinuous Mat (Using Mat.data = address instead of copyTo) Hello, I receive image sections frame-by-frame from moving images on a conveyor belt. Using ROIs I piece the frame-by-frame images together to make one image. This works fine. Except I have to use copyTo instead of just moving pointers. This makes sense as the original Mat would become discontinuous. Except Mat supports discontinuous, so I'm wondering if there is a better way. Here's what I do now: In constructor: m_InData = Mat(m_h, m_w, CV_8UC4); m_ScrollingBuffer = Mat(m_h*m_NumBufPerScrollingBuf, m_w, CV_8UC4); for (int i=0; i distCorrectMapsXYROI_split; split(distCorrectMapXYROI_orig, distCorrectMapsXYROI_split); distCorrectMapsXYROI_split[0] -= cameraXOffset; distCorrectMapsXYROI_split[1] -= cameraYOffset; merge(distCorrectMapsXYROI_split, distCorrectMapXYROI_offset);  Are my assumptions with mapx correct? Next, what do I do with mapy? Its not so obvious. Right now I'm just cropping and it seems OK?  distCorrectMapYROI = distCorrectMapY( Range(cameraYOffset, cameraYOffset + cameraYROI), Range(cameraXOffset, cameraXOffset + cameraXROI));  Thanks for everyone's help. Gunter 2014-04-29 10:21:31 -0500 asked a question Initialize Mat with color data Hello, I'm trying to initialize a Mat with BGR data. I'm getting a strange results. I do this all the time: Mat image(Size(cols, rows), CV_8UC1, (void*) inputData, Mat::AUTO_STEP); But when I do it with a color image the output mat is not correct (its offset in all of BGR data, vertical and horizontal dimensions). Even if I trim the code to: Mat image2 = Mat(Size(imageIn.cols, imageIn.rows), imageIn.type(), imageIn.data, Mat::AUTO_STEP); image2 is not imageIn. imageIn.type() is CV_8UC3. What am I doing wrong? Thanks for your help, Gunter