Filter löschen
Filter löschen

How can I select a big array from a set of array?

1 Ansicht (letzte 30 Tage)
Kh. Islam
Kh. Islam am 14 Okt. 2016
Kommentiert: Kh. Islam am 14 Okt. 2016
I have a set of array as like below it is (x,y,w,h) how can I select the right array for me, here is the right array is number 3 which is have big (w) and big (h) then others. Actually it is a object detection from a image and (x,y,w,h) is the coordinates of the objects but I want my right objects which value have large (w) and large (h) on other hand can say that w/h=very close to 1 or h/w=very close to 1. I wanted to select that array for further actions.
[907.500000000000,2786.50000000000,125,138]
[958.500000000000,2691.50000000000,31,53]
[1336.50000000000,1011.50000000000,1783,1774]
[1531.50000000000,1712.50000000000,50,94]
[1532.50000000000,1928.50000000000,56,108]
[1939.50000000000,1703.50000000000,55,116]

Akzeptierte Antwort

KSSV
KSSV am 14 Okt. 2016
Bearbeitet: KSSV am 14 Okt. 2016
clc; clear all ;
P = [[907.500000000000,2786.50000000000,125,138]
[958.500000000000,2691.50000000000,31,53]
[1336.50000000000,1011.50000000000,1783,1774]
[1531.50000000000,1712.50000000000,50,94]
[1532.50000000000,1928.50000000000,56,108]
[1939.50000000000,1703.50000000000,55,116] ] ;
m = P(:,3)./P(:,4) ;
[val,id] = max(m) ;
myarrray = P(id,:) ;
  1 Kommentar
Kh. Islam
Kh. Islam am 14 Okt. 2016
One more things if I have a array which is changing I mean maybe the last one I have 6 array, if I have Nth array, what should I do? I mean my array can be 2,3,4,5,6,7,8,9.........N

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by