Plot Boxes then Plot them in the original photo ?
Show older comments
I want to plot only the following boxes (5,6,7,8,9,10,12,13) from 19 box which their coordinates stored in the attached file "Boxes".
The color of the boxes should be as the following:
5,6 ==> Same color
7,8 ==> same color
9,10 ==> same color
12,13 ==> same color
I tried the following code to plot the specific mentioned boxes (5,6,7,8,9,10,12,13) , but the size of the boxes are too big compared with their original size(you can see their original size when you plot all the boxes):
%% Plot bboxes
p=cellfun(@polyshape, boxes);
plot(p); xlabel x; ylabel y
set(gca, 'YDir','reverse')
After ploting the boxes I want to plot them on the original photo(the attached one).??
6 Comments
M
on 24 May 2022
DGM
on 24 May 2022
They don't look too big to me:

M
on 24 May 2022
M
on 24 May 2022
M
on 24 May 2022
load boxes.mat
A = imread('Image.jpg');
imshow(A); hold on
boxes = num2cell(boxes,[1 2]);
p = cellfun(@polyshape, boxes);
p = p([5 6 7 8 9 10 12 13]);
colororder(repelem(lines(7),2,1))
plot(p);
xlabel x;
ylabel y
set(gca, 'YDir','reverse')

Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!