MATLAB: Finding smalest rectangle encloses at least 16X32 black pixels

finding smalest rectangle encloses at least 16x32 black pixels

sir i have edge image of size 1024X768 ,i need to find the smallest rectangle centered on (i,j) which encloses at least 16X32 black pixels,with window size of 32X64.
that is by counting the number of black pixels in 16X32 points which regards (i j) in edge image as the center and window size is 32X64.
please help in coding sir

Best Answer

doc bwdist
look at some of the distance metric options.
Related Question