How to plot the centroid and bounding box of an image?

2 views (last 30 days)
HI i'm trying to do solve a problem where i've to find plot the centroid and bouding box of the image and then i've to plot it. So far i've been able to do this and now i don't understand how do i plot this.
a = imread('iPAD2_C23_EX05.JPG');
c = imbinarize(rgb2gray(a));
[L,n] = bwlabel(true(size(c)));
z = regionprops(b, 'Centroid','BoundingBox');
x = z(k).Centroid(1);
y = z(k).Centroid(2);
text(x,y,' \leftarrow G','FontSize',18,'color','r')
But, i'm getting only a blank plot. I also want to plot the bounding box but there's no example availabe online.

Answers (0)

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!