フィルターのクリア

Extrude multiple rectangles to a specific thickness

3 ビュー (過去 30 日間)
Mohammad Abu-Haifa
Mohammad Abu-Haifa 2021 年 1 月 27 日
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 Center および File ExchangeGet 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