Azzera filtri
Azzera filtri

How can i get a bounding box around the vehicles and not around all the objects in the image

3 visualizzazioni (ultimi 30 giorni)
st = regionprops(bw_I, 'BoundingBox' );
for k= 1: length(st)
thisBB = st(k).BoundingBox;
rectangle('Position', [thisBB(1),thisBB(2),thisBB(3),thisBB(4)],...
'EdgeColor','g','LineWidth',2 )
end

Risposte (1)

Tarunbir Gambhir
Tarunbir Gambhir il 3 Dic 2020
If you just want to get a bounding box around the vehicles in this particular image, you could set constraints on the size of the bounding box. The bounding boxes for the background objects in this image are either too big or too small, and hence I think you could set some threshold by trial and error. Keep in mind that these constraints might or might not work with other similar images for vehicle detection.
If you want to automate the processes of getting bounding boxes around vehicles in multiple images, an algorithm or logic is required for the identification and detection of vehicles and background objects. Usually this task is performed by a trained Deep Learning model. After the identification of the vehicles in the image, bounding boxes can be formed around them.
If this is what you are trying to achieve, I suggest you go through the MATLAB example on training a vehicle detector.

Categorie

Scopri di più su Image Processing and Computer Vision in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by