필터 지우기
필터 지우기

How to detect specific shaped objects with any different orientations in Image processing ?

조회 수: 1 (최근 30일)
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
SACHIN PATEL
SACHIN PATEL 2018년 12월 26일
I am not talking about specific image, but the problem is the bounding box is not oriented as the object orientation, due to which the area of oriented shape bounding box is larger. And the area ratio of Bounding box to Original object area is not the required for detection of object in image, So I thought if there is any means to create the bounding box that can be oriented also according to object orientation, then possibility of oriented object can be detected. So please help me that how can I create the bounding box with orientation of same as object orientation ?

댓글을 달려면 로그인하십시오.

답변 (2개)

KSSV
KSSV 2018년 12월 26일
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
SACHIN PATEL
SACHIN PATEL 2018년 12월 26일
편집: SACHIN PATEL 2018년 12월 26일
Thank you sir, The rotation concept is working properly for above code. But when I use regionprops function of matlab for find bounding box, how I can find the bounding box inclined itself and surrounding the object in the image. Because, the bounding box should be of appropriate size surrounding the object. If the bounding box is detected first surrounding the object, and then rotated, then the size of bounding box will not be appropriate. But I got somewhat logic and idea from your answer to rotate Bounding Box. Thank you for your time and help. Also sir I want to know the logic behind subtracting mean from B Array. and after rotation adding mean to it.
Thank you.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2018년 12월 26일
Take a look at Hu's moments which are rotationally invariant: Click here
  댓글 수: 3
Image Analyst
Image Analyst 2018년 12월 26일
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
SACHIN PATEL 2018년 12월 26일
ok sir, thank you for your support. I will try to implement that.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by