Shape detection in image using Matlab -


i have image many shapes , need write matlab code remove shapes except rectangle.. availabe using only strel,imclose , bwareaopen? if think yes happy hear opinion.

image:

enter image description here

if understood right comment, rectangle may have size. think can asked if other shapes have fixed size since asked use strel, imclose , bwareaopen. briefly explain,

strel function creates structuring element given size rectangle, disk or other shape on picture added.

imclose should used connect similar shapes give input(basically structuring element should find strel function).

bwareaopen used delete objects has less p -given input- pixels.

so, if rectangle can given in size image, other shapes should stay same in order able define them strel function, , connect using imclose function. in way, may connect them all, take inverse, remove using bwareaopen , take inverse once again end rectangle.

i not think other solution, hope helps!


Comments