Use Matlab to perform the following:
(1) Convert the image from RGB to gray scale image.
(2) Compute and display the histogram of the resultant gray scale image.
(3) Use a proper way to segment the gray scale image (you can use either region-based or boundary-based methods) to isolate the horses from the background. You can perform any automated subsequent processing steps to clean up the segmented image using the knowledge you learnt during the course.
(4) For each horse, calculate:
a. Its size (area) in pixels.
b. Its perimeter in pixels
c. Its compactness.
d. Its centroid (center-of-gravity).
e. Its principal axis (orientation). Provide the equation of the principal axis line and superimpose it on both the segmented image and the gray scale image.