Extrude multiple rectangles to a specific thickness

3 次查看(过去 30 天)
Hello All
I used a code to draw rectangle around each brick in the image, as shown in the figure. Now I want to leverage from these rectangles in 3D modeling. So, I want to develope the code to convert each rectangle to object/mesh and extrude them to a specific thickness. Does anyone know how can I do that?
This is the used code:
clc; clear; close;
I = imread ('1.png');
figure, imshow(I);
IBW = imbinarize(rgb2gray(I));
%I2 = imfill(IBW, 'holes');
% figure, imshow (I2);
[L, num ] = bwlabel(IBW);
bboxes = regionprops(L, 'BoundingBox');
figure, imshow(IBW);
hold on
for k=1 : length(bboxes)
curbb = bboxes(k). BoundingBox;
x = rectangle('Position',[curbb(1),curbb(2),curbb(3),curbb(4)], 'EdgeColor','g', 'LineWidth', 1);
end
hold off

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by