开发者

How to find a fix number of (almost) fixed proportion rectangles with opencv?

I am writing a simple fly tracking software and I would love some input from opencv experts.

The image I have looks pretty much like:

How to find a fix number of (almost) fixed proportion rectangles with opencv?

I used to do tracking using kmeans and PIL/numpy but I re-wrote everything to use blob detection in opencv. Tracking works OK but I would also like to automatize division of ROI. What I need to do is find each of the 32 grooves that appear in the picture, where flies live. See the black rectangle on the image as example of what I mean.

I think cornerHarris may be what I need but how do I specify only the grooves and not each single rectang开发者_Go百科le found in the image? All those grooves have proportions of roughly 10:1.

Thanks!


I don't think cvCornerHarris is even close to what you need.

A much better start would be to experiment with the demo available at: OpenCV-2.3.0/samples/cpp/squares.cpp. This technique uses Canny(), dilate() and findCountour().

Right out of the box, this demo outputs:

How to find a fix number of (almost) fixed proportion rectangles with opencv?

I believe that with a few tweaks here and there you can have your party started.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜