drawing bounding box from corne rpoints
이전 댓글 표시
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
답변 (1개)
Alex Taylor
2012년 2월 23일
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
kash
2012년 2월 24일
Aasim Khurshid
2021년 3월 1일
In your image you should use [min_y, min_x, (max_y-min_y),(max_x-min_x)] to draw the rectangle.
카테고리
도움말 센터 및 File Exchange에서 Process Point Clouds에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!