how to detect the largest blob and find its center [closed]

asked 2015-06-05 10:31:31 -0500

psykomantis gravatar image

updated 2015-06-05 11:10:09 -0500

Hi all,

I apologize for the very basic question, but I'm stuck with this because I've found tons of people with different solutions. So I'm trying to figure out what's the best solution.

Given this black image, with some pixels white like this: image

how can get the coordinate of the green pixel that I personally marked?

So the steps would be:

  1. How can I find the largest (in order to exclude noise) white blob in a black image?
  2. How can I compute its center?
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-06 11:50:03.025174


I don't need the code, just the concept

psykomantis gravatar imagepsykomantis ( 2015-06-05 10:45:49 -0500 )edit

You can find some code here and some remarks here or use threshold functions and after connectedComponentsWithStat (opencv 3.0)

LBerger gravatar imageLBerger ( 2015-06-05 11:37:49 -0500 )edit