Compass reading
KGMD  [1 posts]
8 years
Howdy= Im a beginner and could use a little help. I would like to read the compass heading from a compass. The camera and compass maintain a fixed position wrt each other, so when there is a change in direction only the compass needle moves (like a clock) and "N" stays at the top of the image. If I can determine the angle the needle is pointing between 0 and 360 then its just arithmetic to get the actual heading. Can you suggest an appropriate filter series? I attached a couple of sample images.

John from Australia  [13 posts] 8 years
This forum doesn't seem to have much action.
Your problem is very simple to solve, although
I haven't been able to interface RoboRealm to
my own software yet or figure out all the
things the RoboRealm does, I can give you some
steps that would work.

First you reduce the number of colors. I do
this by masking each pixel with a value, in
this case I used &H808080 which resulted in
image1. Then get the color of the red needle.
In my case it was &H800000. Then filter out
all the other colors resulting in image2.
You can then use blob size > 50 to erase the
little blobs leaving the needle blob. Then
somehow use geometric statistics to return
the angle of axis of least inertia (the angle
along the longest path through the centroid
(center of gravity). Done!


Anonymous 8 years
John has it right! Here's a robofile that accomplishes that.

S from Romania  [5 posts] 8 years
I'm also a beginner so I couldn't help very much, but shouldn't it say 24 degrees? maybe I'm not looking at the right place but maybe a substraction could do the trick 90-66

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index