MATLAB Answers

How I use bounding box for multiple objects?

조회 수: 10(최근 30일)
mehmet can
mehmet can 5 Feb 2020
편집: mehmet can 5 Feb 2020
I write a code for bounding box, but this code work just one object. How I use bounding box a lot objects.(I want to write algorithm, I do not use any command or library.)
The code is,
clc,
clear,
im1=imread('binary_image');
im1_binary=imbinarize(rgb2gray(im1));
bottom=-1;
right=-1;
top=439;
left=470;
for row=1:439
for column=1:470
if (im1_binary(row,column)==1)
if(row>botton) botton=row;
end
if(column>right) right=column;
end
if(row<top) botton=row;
end
if(column<left) left=column;
end
end
end
end

  댓글 수: 0

로그인 to comment.

답변(1개)

Muhammad Usama Sharaf SAAFI
Try to use "Image Labler app". It will solve your issue. you can choose your multiple ROI from an image and my exporting it will return you multiple boundry boxes for multiple objects.

  댓글 수: 1

mehmet can
mehmet can 5 Feb 2020
Thanks for your answer,
but I do not want to use any apps or any libraries. I want to use one algorithm. This algorithm do to seperate white objects in background(background of course black). Thanks for your helps.

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by