Object orientation calculation in image

10 次查看(过去 30 天)
itai
itai 2017-3-19
评论: itai 2017-3-20
Hi,
I have an image which include a rectangular (I have attached the image)
and I would like to calculate the orientation angle of this rectangular relative to the x and y axes. I tried to use in 'Orientation' in "regionprops" command, but the result wasn't the correct angle relative to the x and y axes.
1. How can I recognize automatically only the rectangular ?
2. How can I calculate the angle between the rectangular and the axes?
Thanks, Itai

回答(1 个)

Image Analyst
Image Analyst 2017-3-19
First of all, can you get a better image, like with no clutter outside the rectangle and a contrasting background, not one that gets about as dark as the rectangle itself?
I'd start out by trying an edge detector like imgradient() or a texture filter like stdfilt(). Then use hough() or houghlines().
Since the camera axes were setup somewhat arbitrarily, why is it so important to get the angle of the rectangular block with respect to the edges of the image?
  1 个评论
itai
itai 2017-3-20
Hi, first, thanks for your response. My goal is to match between the cross section image of a crystal (the rectangular I attached) and the cross section image of a fiber optic, therefor I should find out the angle of each of them relative to the axes. These components are very small and I can't get any better pictures now. What you recommend using to detect the object and the angle to the axes, when I prefer to use as few morphological operations as possible in order to not change the real angle.
Please advice, Itai

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by