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.
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • It's a good start, but as Jack notes, there is a lot of work remaining, e.g. handling out-of-bounds conditions like low-flying trees. I think the next step will be to combine the edge-based information with full-frame optical flow, as the motion vectors effectively give us a depth-of-field mapping.
  • Wow this is some amazing work. Nicely done - can't wait until i see the results up in the air...

  • Must chop more trees.
  • Right - least squares or other line fitting algorithms such as RANSAC should deal effectively with "outlier" data points. I'll generate a new version of code this week that draws the actual line. Based on your modified image, it looks like yellow would be a better choice of colors than red.
  • 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?
  • 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.
  • 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.
  • Harry - try http://www.surveyor.com/images/horizon.mov or https://www.youtube.com/watch?v=MKp-b2nymKk

    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.
  • Is there an outside link to the video? For some reason I cant view any videos on this site - big white blank where videos go.
  • You'd have to use the camera for some other purpose in addition to attitude sensing.
This reply was deleted.