Tuesday, April 07, 2009

Image corners and camera angle

Sorted out the segment processor going around corners ("corner cutting of the line detector"). Took me most of the time figuring out how process_segments worked (which is my own code)! Added some (more) comments on each block just in case I need to change it again. Once this was done, I basically added a very simple positive or negative gradient rule check into the segment processor that maintains the previous direction when matching segments.

Also squished a bug where I couldn't alter the camera angle - and in fact this was part of the reason why I was seeing distorted plan view images - although it eventually needed adjusting from 20.5 degrees to 24 degrees look down to make the plan view image look right.

Also ended up adding a command to list the internal trig variables and world Z table used by the reverse perspective. This showed these variables weren't changing when the camera angle changed. The serial command line really has been essential in the development of the mouse.

Two things that are bugging me is the slight (physical) rotation of the camera (around Z ... where Z is the direction the robot faces) and not knowing how fast these routines are running. However, neither problem is critical to getting the mouse running so I've leaving them. (The rotation could be fixed in software or hardware ... obviously physically adjusting the mount would be the least processing power ... but perhaps let's not touch the hardware at this late stage!)

Things next are: position location from the image lines, maze wall detection and some black card to make sure the shaft encoders work in bright light.

The maze wall detection is interesting - Basically I'm thinking about using circular or rectangular 'detection' areas to find the walls indicated by the lines. I've been contemplating which is the fastest option. I'm not an expert in a fast integer approach, but my previous work in 3d (game) collision detection with spheres and viewport clipping seems to be applicable here.


Post a Comment

<< Home

Newer›  ‹Older