Here's an updated version of the software-based horizon finder for SRV-1 Blackfin. An actual slope and intercept is now being computed, and some filtering has been added as well ...
Here was the original post ...
Noting the interesting discussion about optical flow and horizon finders in this thread, I undertook to add a simple horizon finder to the SRV-1 Blackfin Camera firmware. The algorithm uses a basic edge detection function that is already build into the SRV-1, dividing the image into 16 columns and searching from top-to-bottom for first edge hits. From the video, it appears that the edge threshold could be set a bit lower, but the results are pretty good without any tuning or filtering.
The Google Code project is here - http://code.google.com/p/surveyor-srv1-firmware/ . Next step is to add a least-squares fit to draw a line through the edge segments and then compute pitch and roll angles.
Using a least-squares fit to draw a line through the edge segments, we can directly convert the angle of the line to a roll angle and the height of the line to a pitch angle.
Jack - the camera chip by itself costs about half as much as a single LISY300AL, though you need to add a few bucks for the lens. It is attached to a 500MHz Blackfin processor. We already use the camera + processor for remote camera feed and autonomous control, so attitude sensing adds zero incremental cost. That said, you will get tighter control with the gyros, but I doubt that thermopiles would perform any better than the camera.
Wow! The price of the LISY300AL's doubled in the last week. They used to be $6 at arrow & $8 at digikey. Now they're $10 & $15. Might be worth studying alternatives to IMU's at current inflation rates or saving up on Turkish Lyra.
Nice, really sees the edges. It seems the horizon should be the fit that includes edges that arent real different in Y from neighbors. I suppose least squares would cover that?
BTW, videos embedded on diydrones work great with flash installed properly.
Here's what I mean. I picked a frame, and fit it by eye. The horizon has some mountains and the edges seem to be in groups with the largest groups having 4 segments and the smallest have 3. That grouping would vary, but should the largest groups have the most weight? Would least squares account for that?
Comment
You need to be a member of DIY Drones to add comments!
You need to be a member of DIY Drones to add comments!
Join DIY Drones