Marking rectangles on images automatically

Hi,
I am trying to write a code that would allow me to detect rectangles with a certain area automatically in an image.
For example, the code should allow me to detect the reactangle like the one shown in the image attached rather than manually drawing it using roipoly() or a function of the same kind. The area is such that there is no break or black area in the image.
Kindly let me know if there is more details if required
Thank you

7 Kommentare

Image Analyst
Image Analyst am 25 Jun. 2019
Nope - we don't require any more details on this announcement. Sounds like you have an interesting project. Good luck though. If you need any help, ask a question. By the way, someone brought it up to John D'Errico since it's kind of the inverse of his minimum bounding box File Exchange submissions and he said it sounded kind of tough or involved. Good luck though. Do you have a professor guiding you? Or is this supposed to be all your own ideas, code, and invention?
Yash Mayuresh Kavi
Yash Mayuresh Kavi am 25 Jun. 2019
I currently do not have anyone guiding me for this research based application. I tried using regionprops() and extracted the areas from its output, and then set a parameter for a minimum area and then, marked the bounding boxes for the same but it is not coming out to be very accurate. Is there any other way I could do it??
Image Analyst
Image Analyst am 26 Jun. 2019
That won't get you the maximum box - the box that fits inside with the max area. I don't know of any clever way to do it quickly. One way would be to use a dumb, brute force way but it would be very slow.
Yash Mayuresh Kavi
Yash Mayuresh Kavi am 26 Jun. 2019
I tried using that but it definitely turned out to be extremely slow and in the end I stopped running my code as it took very long for an output..
Image Analyst
Image Analyst am 26 Jun. 2019
Why do you need it? Ot think you need it?
You could use bwdist() but that will just get you the largest circle than can fit.
KALYAN ACHARJYA
KALYAN ACHARJYA am 1 Jul. 2019
Bearbeitet: KALYAN ACHARJYA am 1 Jul. 2019
@Yash
The Question is:
Draw the ractangle with maximum possible area in gray shaded region only?
Am I right?
Can you share more 2-3 sample images, actually I am interested to look on minimum width of black strip?
Yash Mayuresh Kavi
Yash Mayuresh Kavi am 2 Jul. 2019
Bearbeitet: Yash Mayuresh Kavi am 2 Jul. 2019
Hi Kalyan,
The aim is to plot multiple rectangles of certain areas and dimensions automatically. So the rectangles have to be plotted on the colored areas of the image. Here are some more examples for the same.untitled1.jpg

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte

Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by