MATLAB: How to fill bounding boxes in image

bounding boxfillMATLABroi

How to fill region inside bounding box with white and outside with black i? case of one bbx or many bounding boxes for one image.

Best Answer

suppose img is image variable and if you have three dimensional image: bbBOx format is [ X Y Len Wid ]
img( X:X+Len-1, Y:Y+Wid-1, : ) = 0;