how to draw polar histogram of the object of image?

조회 수: 7 (최근 30일)
Rujal
Rujal 2016년 2월 6일
댓글: Image Analyst 2016년 2월 10일
hello friends,
I am working on handwritten math expression recognition. I want to use polar histogram shape descriptor for shape feature extraction. I have attach the image of expression. As shown in image, from the mid point between two centroids I have to draw polar bins of this objects. I would be thankful if someone helps me to draw polar histogram.

채택된 답변

Image Analyst
Image Analyst 2016년 2월 6일
편집: Image Analyst 2016년 2월 6일
Find the midpoint. Then scan the image with a nested for loop over all rows and columns. At each (row,column) compute the angle using simple trigonometry (atan2d). See if the image is white at that location, and if it is, increment the histogram array by one.
hist2D = zeros(1, 360);
for row = 1 : rows
for col = 1 : columns
angle = round(atan(......
if binaryImage(row, col) == 1
hist2D(angle) = hist2D(angle) + 1;
end
end
end
It's a pretty trivial brute force method but it should work pretty fast (less than a second or so). Let me know if you can't figure out the code after trying to.
  댓글 수: 7
Rujal
Rujal 2016년 2월 10일
Hello Image Analyst, Do you have an idea how to draw polar plots on binary image that I have attached?
Image Analyst
Image Analyst 2016년 2월 10일
Not really sure. I know it can be done, but I've never done it so I don't have any demos all ready for you. I'd have to look it up just like you'd have to. Good luck. Thanks for Accepting the Answer.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by