1
$\begingroup$

I wonder if this would be a competitive robot compared with one made with a traditional approach using a microcontroller and infrared sensors. I suppose that raspberry can perform an edge detection to tell the dynamic of the line far away, much more that the infrared sensor, but how fast can the raspberry do this process? should be a relative simple process in terms of computational requirements , an edge detection in a high contrast arena. Probably the bigger issue would be get the relative position of the robot respect to the line, may be a combination of the camera with some infrared sensors would work better, and what about the size? the robot will be significantly bigger when is used a camera and a raspberry for the control.

| improve this question | | | | |
$\endgroup$
  • 1
    $\begingroup$ Define "competitive". By what metric do you measure "competitiveness"? $\endgroup$ – Paul Feb 2 '16 at 19:36
5
$\begingroup$

This may be overkill, but some of the past work I was involved in was trying to detect a vertical line (a pipe) in the camera's field of vision, and navigate relative to it.

Detecting a pipe with computer vision

The process was as follows:

  1. Pick a threshold value, and split the image into black and white
  2. Perform Canny edge detection on the image
  3. Use a Hough transform to find the strongest lines in the image, and consider those to be the boundaries of the vertical strip you're looking for
  4. Adjust for the perceived width (indicating distance -- you won't need this) and angle of the vertial strip in the image

We used OpenCV to do this.

We didn't get very good results at full camera resolution; The very pixellated lines in the image above were from downsampling the source video frame (by a factor of 3 in both directions, I think... so 1/9 the number of pixels to worry about). This allowed us to process frames fast enough for it to be useful. Also, the point of the initial threshold step was to speed up the Canny process -- fewer lines to find.

| improve this answer | | | | |
$\endgroup$
  • $\begingroup$ Thanks, it looks pretty interesting, I like it, did you use a raspberry pi? I would like to get and idea of the distance, to speed up, or speed down when the robot is far or close to the hard points of the arena $\endgroup$ – user2720241 Aug 10 '14 at 2:20
  • 1
    $\begingroup$ We were using this board, which even though several years old is apparently still faster than the Rpi: adl-usa.com/products/detail/19/adls15pc $\endgroup$ – Ian Aug 11 '14 at 13:51
  • $\begingroup$ I see, it really looks more powerful, I was thinking about make a edge detection and then a correlation of the image with some model curves like a really close curve or a straight segment of the track to know how the arena is in the next point, It would be this a reasonable approach? How much time could take to the raspberry do such a thing? I mean the correlation of an 320×240 image, I read that the raspberry can make the edge detection in a speed of about 7.7 to 17.5 fps: ryanmessina.wordpress.com/2013/06/10/… $\endgroup$ – user2720241 Aug 12 '14 at 3:45
  • 1
    $\begingroup$ Unfortunately there isn't a good way to guess the performance without trying. There are surprising differences in performance from subtle changes in the code, and what order various operations happen in. $\endgroup$ – Ian Aug 12 '14 at 17:36
  • $\begingroup$ Ian is correct. You can't really tell if a RasPi will be good for the job until you do it yourself, or talk with someone who has tried it already. My gut instinct is that it won't be powerful enough. Are you trying to use a RasPi for a reason - already have one? Because there are embedded boards out there that are built for image processing. $\endgroup$ – MechanicalMan Feb 1 '16 at 16:37
2
$\begingroup$

I did a project based on RPi2 + Pi-Camera + ROS jade + OpenCV to make a line following rover. Two methods are used, one is to find contour of the track, the other is to use Hough-transform for edge detection. Under well-controlled environment (even light sources, less noises, etc.) the performance is good, and I use RANSAC to find preferred edges under noisy environment. Pi-Camera is set to capture 320x240 RGB in 30fps. I overclock my RPi2 to 1.0Ghz, finding contour can process frames in 18-23 fps, and hough-transform is about 17fps (in a bit noisy environment.) For these two methods, Canny filter and Hough transform is the major bottleneck. I built this as a test platform, a cheap rover chassis is used with 2 geared DC motors. My codes in github: https://github.com/alexhuang888/roscar

| improve this answer | | | | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.