2016-03-15 05:16:45 -0600 | received badge | ● Enlightened (source) |
2016-03-15 05:16:45 -0600 | received badge | ● Good Answer (source) |
2013-12-11 07:15:24 -0600 | answered a question | Finding index of an image Ati, I'm writing the solution as an answer so you can accept it for other users to see it. You have to add the origin of the ROI as an offset: row = (j/Dist.rows) + (j%Dist.rows) + roiOrigin.y; col = j%Dist.cols + roiOrigin.x; |
2013-12-11 05:52:32 -0600 | commented question | Finding index of an image Ok, now I got it. If using a ROI before finding the contours is necessary, you can add to row and col the origin of the ROI as an offset: row = (j/Dist.rows) + (j%Dist.rows) + roiOrigin.y; col = j%Dist.cols + roiOrigin.x; |
2013-12-11 03:54:24 -0600 | commented question | Finding index of an image not sure about what you're trying to achieve. What do you mean when you say you want to find the index of the crop image? In the code you wrote it seems that you are going through each pixel of the image and if it isn't black you push the coordinates in the Index vector. In this way you'll obtain a vector with the coordinates of all the nonblack pixels in cropped. Is that what you want? If it is I think that you are pushing back the wrong coordinates. You should calculate row and col like this: row = (j/Dist.rows) + (j%Dist.rows); col = j%Dist.cols; |
2013-12-08 01:56:43 -0600 | received badge | ● Nice Answer (source) |
2013-12-05 04:17:47 -0600 | received badge | ● Teacher (source) |
2013-12-05 02:48:33 -0600 | answered a question | how to set automatic threshold of image using opencv Try looking into adaptive thresholding This code shows you the difference between thresholding and adaptive thresholding: |
2013-12-04 16:37:40 -0600 | received badge | ● Supporter (source) |
2013-12-04 16:29:15 -0600 | asked a question | perspectiveTransform a set of points Hello! I have two images, the first is distorted under perspective and the second is the rectification of a square in the previous image, obtained transforming it with the warpPerspective() function and a given 3x3 trasformation matrix M. After working with the rectified image I've obtained a set of points that I'd like to transform back to the original image. These points are stored as Point2f or Point3f if I convert them to homogeneous coordinates. To my knowledge Opencv doesn't provide a function to directly transform a point or a set of points with a transformation matrix. Do you have any suggestions on how I could do it? I saw similar questions and I found solutions like but it doesn't seem to work. I was thinking of using M.inv() to map back the points in the first image, is that correct? Thank you in advance. Raul |