Ask Your Question
0

How to find center pixel of a group of pixels.

asked 2014-10-10 04:57:29 -0600

nonick2k8 gravatar image

I have a group of pixels and I'd like to find the middle pixel found in the pixels group. Not centroid that generates a new pixel, but a pixel out of all which resembles the "middle" one amongst them.

Thanks.

edit retag flag offensive close merge delete

Comments

"centroid that generates a new pixel," - means ?

berak gravatar imageberak ( 2014-10-10 05:04:17 -0600 )edit

Matlab's regionprops (centroid), which returns a new pixel, and not a pixel of the given group which best fits as the 'center' of the group. I need something in OpenCV that returns the best fit pixel as the center of the pixel group.

nonick2k8 gravatar imagenonick2k8 ( 2014-10-10 05:15:14 -0600 )edit
1

means not the average of all points ( the sum / number of pixels)

chebhou gravatar imagechebhou ( 2014-10-10 05:16:15 -0600 )edit
2

do you mean the closest to the centroid ? -> find the pixel with the minimum ( pixel - centroid )

chebhou gravatar imagechebhou ( 2014-10-10 05:19:21 -0600 )edit

Good idea. Thanks.

nonick2k8 gravatar imagenonick2k8 ( 2014-10-10 05:56:40 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-10-10 06:55:18 -0600

updated 2014-10-10 15:50:59 -0600

There is no closed formula to compute this point: http://en.wikipedia.org/wiki/Geometric_median

If you don't need to compute this point millions of times, I'd just go for a Brute Force and compute the mean distance to all other points for every point.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-10-10 04:57:29 -0600

Seen: 1,920 times

Last updated: Oct 10 '14