2017-01-04 17:48:08 -0600 | commented answer | How con a find a specif point through a contour? I have tryed this, and yes the results got better, but it's still not really something I can use, as you can see in this video: https://www.youtube.com/watch?v=m-0lu.... I just changed the contour[0] to contour[index]. I really don't know what to do to make it better. |
2017-01-03 19:36:53 -0600 | commented answer | How con a find a specif point through a contour? I have tried to look for the contour[1] manually, but when I did that I got this error "segmentation fault", so I assumed there were only points in contour[0] for some reason. I'll try to code the inner loop as the outer one. I'll let you know, when I try (I only have access to the robot in college, and I'll be there only tomorrow morning). Thanks for your help, if you notice anything else, please notice me. |
2017-01-03 19:34:25 -0600 | received badge | ● Supporter (source) |
2017-01-03 17:26:39 -0600 | asked a question | How con a find a specif point through a contour? Hey, guys. I've been working on a project lately, I'm trying to create a line follower robot using the raspberry pi and it's camera module. I'm really new to opencv and I've been struggling to actually solve a problem I'm having. I'm able to track the black line that is placed over a white floor, using this tutorial. I was using it to track the center point of the line and it was working quite nicely, but I've recently found a problem with this aproach. It only works in straight lines, not in angled ones. So I have to chage it. In order to solve my issue, I tought I could track the two boundaries of the line (left side and right side), in the midle of the screen. The frame height is 480px, so I tought it'd points in the contour vector with y=240 and I tried to check this vector to find the x coordinates of said points. It works sometimes, but I can't find it consistently, as can be seen in this video. This is the code I'm using to track the line: If any of you guys could help me to find what I'm doing wrong, I'd be very happy. Thanks in advance. |