如何填写图像中的边界框?

时间:2016-05-15 10:17:39

标签: fill bounding-box roi

如何用白色和外面用黑色填充边界框内的区域?一个bbx的情况或一个图像的多个边界框。

enter image description here

1 个答案:

答案 0 :(得分:0)

解决方案是:

 %%1)roi=[2.262763419483102e+02 2.55 11.593499005964213e+01 8.558429423459245e+01];%% bbBOx format is [ X Y Len Wid ] %% img( X:X+Len-1, Y:Y+Wid-1, : ) = 1; img = zeros(800,800,3); img( roi(1):roi(1)+roi(3)-1, roi(2):roi(2)+roi(4)-1, : ) = 1; imshow(img);

 %%2) img = zeros(500,500,3); img2=insertShape(imgg, 'FilledRectangle', [2.262763419483102e+02 2.55 11.593499005964213e+01 8.558429423459245e+01],'Color', {'white'}, 'Opacity', 1);

imshow(IMG2);