MATLAB: How to find center of an image?? Other than using regionprops.

1

I'm doing image processing for my final year project and I need to find the center of an image. I need to find the co-ordinates at that point and also want to store them as [x,y].

Best Answer

Wouldn't it simply be:
[rows columns numberOfColorChannels] = size(yourImage);
y_center = rows / 2;
x_center = columns / 2;
If you mean center of mass, then say so. If you have a binary image with foreground and background and want the centroid of all regions or of specific regions, then say so.