drawing bounding box from corne rpoints

3 Ansichten (letzte 30 Tage)
kash
kash am 23 Feb. 2012
Kommentiert: Aasim Khurshid am 1 Mär. 2021
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

Antworten (1)

Alex Taylor
Alex Taylor am 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 Kommentare
kash
kash am 24 Feb. 2012
Alex as per ur code,plz look at the link,am not getting exact result
http://imgur.com/TH5V4
Aasim Khurshid
Aasim Khurshid am 1 Mär. 2021
In your image you should use [min_y, min_x, (max_y-min_y),(max_x-min_x)] to draw the rectangle.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by