How to select boundary box?
Ältere Kommentare anzeigen
How to select boundary box of 221.jpg and crop it like 222.jpg ?
221.jpg

222.jpg

Akzeptierte Antwort
Weitere Antworten (2)
Image Analyst
am 1 Jun. 2014
1 Stimme
This can also be solved using the algorithm I laid out in your previous question http://www.mathworks.com/matlabcentral/answers/132000#answer_139060
4 Kommentare
Indunie Florence
am 2 Jun. 2014
Image Analyst
am 2 Jun. 2014
Do you know what the line
greenChannel = rgbImage(:, :, 2);
does? It takes the second plane of the 3D image variable. So the image must be 3D. If it's 2D, like yours which has only 1 color channel in a single 2D image, you can't take the second plane and must just use the image itself. So you have to check for that.
if numberOfColorBands > 1
% It's color, take just one color channel
greenChannel = rgbImage(:, :, 2);
else
% It's monochrome, take the original image.
greenChannel = rgbImage; % It's not really RGB
end
Indunie Florence
am 3 Jun. 2014
Bearbeitet: Indunie Florence
am 18 Apr. 2016
Image Analyst
am 3 Jun. 2014
You need to invert your binary image since it's darker than the background. You can either flip the > sign when doing thresholding (which is the easiest) or you can do it in a separate steps (more time consuming) binaryImage = ~binaryImage.
dhiaa almalki
am 17 Apr. 2016
if true
% code
end
if true
% code
end
1 Kommentar
Image Analyst
am 17 Apr. 2016
What is this for? Why don't you start your own new question?
Kategorien
Mehr zu Orange finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
