Project - Robot stay within two lines

OpenMV related project discussion.
pielou10
Posts: 5
Joined: Tue Mar 26, 2019 12:03 pm

Project - Robot stay within two lines

Postby pielou10 » Tue Mar 26, 2019 12:08 pm

Hello,

My current project is using the OpenMV M7 to stay between two lines, at the moment it works sort of well by using line segments and RIO (region of interest) to look and create lines only in a certain frame. The problem is the find_line_segments will find too many lines from random stuff around, do you have any recommendations on how to remove these lines and only find the two most dominant lines?

This is quite time sensitive so anything can help.
Thanks so much!
User avatar
kwagyeman
Posts: 3207
Joined: Sun May 24, 2015 2:10 pm

Re: Project - Robot stay within two lines

Postby kwagyeman » Tue Mar 26, 2019 12:52 pm

Sure, the find_line_segments() method returns a list of line segments. Use the Filter() method in python then to execute a callback function on the list of returned line segments and remove the ones that aren't vertical by looking at their rotation angle and also remove the segments that are very short in length, etc. The line segments have a bunch of different properties you can ignore them by.
Nyamekye,
pielou10
Posts: 5
Joined: Tue Mar 26, 2019 12:03 pm

Re: Project - Robot stay within two lines

Postby pielou10 » Tue Mar 26, 2019 9:24 pm

So beyond what you said which I am currently looking into, say i'm on a white surface with black tape for the lines, the line segments will find the left and right edges of each lines. Is there a proper way to create 1 line from this significantly contrasted line on either side? Thanks again!
User avatar
kwagyeman
Posts: 3207
Joined: Sun May 24, 2015 2:10 pm

Re: Project - Robot stay within two lines

Postby kwagyeman » Wed Mar 27, 2019 1:21 am

Hmm, in this situation I'd recommend you use the robust linear regression method. Please see the example script for it under feature detection. You should execute it twice on the left and right side of the image. Then you'll get two lines to use to drive with. Make sure to use the robust linear regression method.
Nyamekye,

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 22 guests