MATLAB: Find the center point of color

centerimage

Let pixels of the image : 1×10
When I find the point of center, if basis color is white,
maybe the answer is (3,1) or (4,1), right?
then, how can I find the answer to use matlab?
similar to centroid, center of mass…
do you follow me? :'(

Best Answer

Try with the built-in function regionprops.
One of the properties returned by this function is the center of mass of each region within the image.It can return many others properties of the regions, see the help for all the possibilities:
help regionprops
Related Question