フィルターのクリア

how to create bouding box

1 回表示 (過去 30 日間)
Adisorn Phanukthong
Adisorn Phanukthong 2017 年 2 月 24 日
回答済み: Image Analyst 2017 年 3 月 4 日
I have centroid of picture I want create bounding box upper and lower from center point of picture

回答 (1 件)

Image Analyst
Image Analyst 2017 年 3 月 4 日
Use rectangle() and your x and y centroid which you say you already have:
[rows, columns, numberOfColorChannels] = size(mask);
imshow(mask);
axis on;
hold on
% Specify half height of the rectangle.
halfHeight = 200; % Whatever you want.
% Plot rectangle in upper half.
rectangle('Position',[1, yCentroid - halfHeight, columns, 2*halfHeight], ...
'LineWidth', 3, 'EdgeColor', 'b');
% Plot star in middle
plot(xCentroid, yCentroid, 'b*', 'MarkerSize', 30)
hold off

Community Treasure Hunt

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

Start Hunting!

Translated by