- convert to gray with rgb2gray()
- threshold binaryImage = grayImage < 128
- call bwconvhull
- call bwlabel to get labeledImage
- call regionprops(labeledImage..... and ask for 'BoundingBox'.
- expand bounding box coordinates by whatever amount you want.
- call imcrop(originalImage, boundingBox)
How can I crop image 1.jpg from 2.jpg in matlab(if it doesn't have boundary)?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Indunie Florence
am 1 Jun. 2014
Kommentiert: Indunie Florence
am 1 Jun. 2014
How can I crop image 1.jpg from 2.jpg in matlab? Is there any function? 1.jpg is a binary image and it hasn't a boundary and noice. I use blue color for white color here to understandable.
1.jpg
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163630/image.jpeg)
2.jpg
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163631/image.jpeg)
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 1 Jun. 2014
Here are the steps (one way at least - there are several ways to do it).
That pretty much does it, except for some things like imshow() to display your progress. See if you can do it all by yourself from this point on. Let me know how it goes.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!