2014-12-01 11:44:14 -0600 | asked a question | How to retrieve a std::vector of points from cv::Mat? I have a 'cv::Mat' with labeled blobs. So I am able to retrieve a mask for each component. Now what I am interested in are the indices of all points of a mask. The reason is that I want to use 'cv::fitLine' with these points, or any other minimizer to match data with my model. The only idea I have is iterating over the image and manually collect the indices, but maybe there is a smarter way? Maybe converting a (dense) matrix to a sparse one or some such? |
2014-11-28 14:14:43 -0600 | commented question | OpenCV ref count: function returning cv::Mat? Stupid me ... see comment below the accepted answer. The code above is ok, it's my assumption about the depth which was wrong. I used 'cv::matchTemplate' before, and this gives me a 32 bit floating point image, not 64 bit ... |
2014-11-28 14:13:01 -0600 | commented answer | OpenCV ref count: function returning cv::Mat? You are totally right! Crashed before, and yes, I reated my image as 'CV_64F', but this is not what 'cv::matchTemplate' creates ... the documentation clearly states that 32 bit are the result. |
2014-11-28 14:11:15 -0600 | received badge | ● Scholar (source) |
2014-11-23 02:39:38 -0600 | asked a question | OpenCV ref count: function returning cv::Mat? I am tracing a strange bug in my very simple code, and I suspect that I am using My code is this: I am pretty sure that the depth of I would expect it to be 1 ... Can someone provide me a hint? |