Draw Bounding Boxes on An Image
imrects(BB,rgb)
Bounding Boxes, 4 by M, in which each column representing 1 box in [x,y,w,h].
RGB values with value from 0 to 255 in [R,G,B] format
This function draw rectangles on the image using given bounding boxes paremeters.
A = imread(fullpath(getIPCVpath() + "/images/coins.png")); Agray = rgb2gray(A); Abin = im2bw(Agray,imgraythresh(Agray)); se = imcreatese('ellipse',15,15); A_close = imclose(~Abin,se); [A_labeled,n] = imlabel(A_close); [Area, BB] = imblobprop(A_labeled); imshow(A); imrects(BB,[255 0 0]); | ![]() | ![]() |