drawing bounding box from corne rpoints
3 views (last 30 days)
Show older comments
I have found the corners of an image ,now i want to draw the bounding box around it,please help
corner points=
188 28
195 29
261 30
261 42
261 143
261 153
121 154
114 155
109 154
25 154
5 153
4 51
6 29
83 150
9 148
11 35
112 140
113 110
134 111
133 140
118 139
95 132
92 144
110 149
144 138
142 132
90 149
99 146
12 40
217 150
149 137
I have uploaded image after corner detection
0 Comments
Answers (1)
Alex Taylor
on 23 Feb 2012
How about:
imshow('pout.tif');
points = 200*rand(50,2);
hold on
plot(points(:,1),points(:,2),'r*');
% Now use min/max to determine bounding rectangle
min_x = min(points(:,1));
max_x = max(points(:,1));
min_y = min(points(:,2));
max_y = max(points(:,2));
% Use rectangle to draw bounding rectangle
rectangle('Position',[min_x min_y (max_x-min_x) (max_y-min_y)]);
2 Comments
Aasim Khurshid
on 1 Mar 2021
In your image you should use [min_y, min_x, (max_y-min_y),(max_x-min_x)] to draw the rectangle.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!