How to detect specific shaped objects with any different orientations in Image processing ?
Afficher commentaires plus anciens
Hello, I want to know that how to detect the objects with different orientations using Area ratio, in which the problem is the bounding box is not oriented with the same orientation as the object, due to that the area ratio is not accurate and object with different orientation is not detected. How to rotate the bounding box also with the same angle as the object orientation....?
2 commentaires
KSSV
le 26 Déc 2018
Attach image and tell your expectations.
SACHIN PATEL
le 26 Déc 2018
Réponses (2)
KSSV
le 26 Déc 2018
YOu can rotate the bounding box by using your desired angle as below:
% bounding box coordinates
B = [ 0 0 ; 1 0 ; 1 1 ;0 1 ; 0 0]' ;
th = pi/4 ;
R = [cos(th) -sin(th) ; sin(th) cos(th)] ;
% Rotate by th
B1 = R*(B-mean(B,2))+mean(B,2) ;
figure
hold on
patch(B(1,:),B(2,:),'r')
patch(B1(1,:),B1(2,:),'k')
1 commentaire
SACHIN PATEL
le 26 Déc 2018
Modifié(e) : SACHIN PATEL
le 26 Déc 2018
Image Analyst
le 26 Déc 2018
0 votes
Take a look at Hu's moments which are rotationally invariant: Click here
3 commentaires
SACHIN PATEL
le 26 Déc 2018
Image Analyst
le 26 Déc 2018
See my shape recognition demo, attached. It puts up simple polygons of various numbers of vertices, angles, and sizes, and then finds them.
SACHIN PATEL
le 26 Déc 2018
Catégories
En savoir plus sur Computer Vision with Simulink dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!