How to detect orientation of an object
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello!
I've been stuck on this particular task for a while, so I thought I would ask the Computer Vision gurus on here. So far I've tried regionprops (specifically - orientation property of regionprops), which has been fairly poor for in terms of results. I was wondering if anyone has any tips or method for which I could calculate the orientation of a letter in the attached image. I've also attached an example image of what I would like to achieve.
Thank you.
Edit: Attached an input example image
Edit2: Attached imgmat.mat file containing the original image and a binary image.
Edit3: Attached shapeLetters.mat binary and an RGB image containing both letters and shapes for possible advice on clean segmentation of shapes and letters.
6 Kommentare
Akzeptierte Antwort
Image Analyst
am 30 Aug. 2018
First find the letters. Pretty easy. Just threshold and call imclearborder() to get rid of the background, then do a little cleanup with bwareafilt() or bwareaopen().
Then detect which letter is which with Hu's moments http://www.youtube.com/watch?v=Nc06tlZAv_Q or Deep Learning. Or else just get the orientation from regionprops() and look at the angle delta from a correctly oriented letter.
0 Kommentare
Weitere Antworten (1)
Matt J
am 30 Aug. 2018
Bearbeitet: Matt J
am 30 Aug. 2018
If possible, would you also be able to advice me how to best extract the letters in the image so I can find their centroids.
This seems to do a decent job,
tmp=medfilt2(~binaryImg,[1,7]);
tmp=medfilt2(tmp,[7,1]);
BWsymbols=logical(imfill(tmp,'holes')-tmp);
props=regionprops(BWsymbols,'Centroid','Orientation');
imagesc(BWsymbols);axis image; shg

11 Kommentare
Image Analyst
am 31 Aug. 2018
You're welcome, but again, why do you NEED the orientation? Saying you need it "to know by how much the blob is rotated by for computer vision." is like saying you need it because you need it, basically a non-answer. Just curious.
Siehe auch
Kategorien
Mehr zu Computer Vision with Simulink finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!