Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

When you apply threshold on image (at least the one implemented in OpenCV) you get image with one channel. If you are talking about yellow, than you have multi-channel image. How this happened?

Step 1: Use findContours function to find all objects in image (single channel binary image).

Step 2: Use contourArea function on each contour found in step 1 to find the largest one.

Step 3: Use moments function to find centroid of your contour.