Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

best way for detecting contour

Hello Everyone,

I have some trouble for detecting correctly contour of a square image and fill it with a specific color.

I've started to explain a little in a previous post (http://answers.opencv.org/question/21603/fill-contour-with-drawcontours/) but it's better I explain in more detail in this specific post.

First, I prefer to tell you now that for me openCV is really a powerful framework but it's also really hard for me to use it. So far I've used and tried to adapt source code of other person which explain that my current source code isn't clean (which result of a strange behavior for what I'm trying to do) so please explain me in detail :)

What I'm trying to do is to used cvVideoCamera on iOS (I also have to do it on Android but I'll be able to do it by adapting the iOS version on my own) and detecting square image (my image is embedded in a black rectangle). once I've detected the square I would like to fill this rectangle (so in any case I have to use the function drawContours and use CV_FILLED parameter) in a specific color with an alpha for letting the user be able to still see the image behind my drawing rectangle.

The purpose of the function is to show a rectangle on a detected square until I have a match with a reference image.

I've already done the function for testing if I have a match with my reference image (I guess this function is not clean too...) but I don't understand what I can do in order to achieve the function explained above.

I've heard about dilate and convexHull function but I don't know/understand what I need and how to proceed to achieve it.

Could you please explain/ show me how to do it?

I really thank you for your help