How do I obtain the distance from the bounding boxes in YOLO v2/v3 in MATLAB?

7 visualizzazioni (ultimi 30 giorni)
Youssef hany il 6 Ago 2021
Commentato: farah bouzidi il 1 Lug 2022
Hello,
I currently trained my dataset on both YOLO v2 and v3; however, I am not sure on how to obtain the distance using the corners of the bounding boxes?
Is there a specific function or loop that I need to use?
I appreciate all the feedback.
1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
farah bouzidi il 1 Lug 2022
did you find an answer to your issue?

Accedi per commentare.

Risposte (2)

Vineet Joshi il 28 Ott 2021
Hi
The standard bounding box format in YOLOv2/v3 is a four dimentional vector described as follows.
[x y width height]
Using this you can find the coordinate of the four corners of the bounding box.
Once you have all four coordinates you can use the pdist function to find the distances.
The following resources will help.
Hope this helps
Thanks
0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

yanqi liu il 28 Ott 2021
sir, may be use the dice to compute Sørensen-Dice similarity coefficient for image segmentation
clc; clear all; close all;
RGB = imread('yellowlily.jpg');
region1 = [350 700 425 120]; % [x y w h] format
BW1 = false(size(RGB,1),size(RGB,2));
BW1(region1(2):region1(2)+region1(4),region1(1):region1(1)+region1(3)) = true;
region2 = [800 1124 120 230];
BW2 = false(size(RGB,1),size(RGB,2));
BW2(region2(2):region2(2)+region2(4),region2(1):region2(1)+region2(3)) = true;
region3 = [20 1320 480 200; 1010 290 180 240];
BW3 = false(size(RGB,1),size(RGB,2));
BW3(region3(1,2):region3(1,2)+region3(1,4),region3(1,1):region3(1,1)+region3(1,3)) = true;
BW3(region3(2,2):region3(2,2)+region3(2,4),region3(2,1):region3(2,1)+region3(2,3)) = true;
imshow(RGB)
hold on
visboundaries(BW1,'Color','r');
visboundaries(BW2,'Color','g');
visboundaries(BW3,'Color','b');
title('Seed Regions')
L = imseggeodesic(RGB,BW1,BW2,BW3,'AdaptiveChannelWeighting',true);
L_groundTruth = double(imread('yellowlily-segmented.png'));
similarity = dice(L, L_groundTruth)
similarity = 3×1
0.9396 0.7247 0.9139
0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Categorie

Scopri di più su Object Detection in Help Center e File Exchange

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by