2014-05-20 10:54:27 -0600 | 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: And at Run-Time, after I get a frame: But I'd like to something more elegant like: But the above doesn't work (I suspect because of the non-continuous nature.) Suggestions? Thanks and sorry if a similar/duplicate question shows up. Gunter |
2014-05-14 07:55:44 -0600 | received badge | ● Self-Learner (source) |
2014-05-14 07:54:47 -0600 | answered a question | Cropping Calibration Correction maps With fresh eyes it was easy to find the easy approach, call, instead: Then you get all the X in MapX and all the Y in the MapY. Then just subtract the offset from each. |
2014-05-12 07:43:56 -0600 | asked a question | Cropping Calibration Correction maps Hello, we have a system with a number of cameras. At run-time, one of those cameras has a very small ROI in the y-direction: 6-20 lines. This is (much) too small to use a grid to calibrate the camera; but I can do that using a full field of view and just crop. But: if I use initUndistortRectifyMap to get mapx & mapy, how do I crop them? Mapx looks pretty obvious (I think!), I crop to the ROI and then subtract the offset ie: 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? Thanks for everyone's help. Gunter |
2014-04-29 10:21:31 -0600 | 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 |