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 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!