Monday, February 10, 2014

Signs reading with OpenCV (Code)

Hello,

Some people have been asking for the robot OpenCV source code. Here is the source code that the robot uses to read the signs and perform actions. Remember that this is a test code, it is not carefully written.
The zip file also contains the source images needed in the process. I'm using Linux and Eclipse IDE.

The method used to read the signs was already described in my previous posts.

https://drive.google.com/open?id=0B-p_RLyuewtoSlpuMTBXZmVfVlk

38 comments:

  1. Hi Samuel,
    very cool robot you got there congratulations. I want to reuse some of your code to read specific signs and I think I understand what you are doing in your code which is appended to this post. The only thing I am having problems with is the way you are getting the image data from the raspberry cam. I think you have rewritten the code from the 7 step tutorial that you have referenced to so you can use some video object in your code that you have postet here. Could you post the other part of the code so I can understand the way you are accessing frames from the Raspberry Pi Camera ? I am really having a hard time understanding that.

    Thank you very much for your inspiration.

    Tobi

    ReplyDelete
    Replies
    1. Hi

      This code is a PC version. You have to follow Pierre's tutorial to use raspberry cam with OpenCV. Then you can adapt this code and it will work.

      Delete
    2. Hey Thanks Samuel,
      after some really annoying compiler-sessions I managed to install opencv and raspicam_cv on my raspberry pi. Thanks again for your inspiration :-)

      Greetings,

      Tobi

      Delete
    3. is it possible to share installed image with OpenCV on Rasperry pi? I am running into some issues with really annoying compiler-sessions.

      Appreciate it.

      Delete
  2. Hi Samuel,

    I really enjoy your videos. I'm working on a similar robot, https://www.youtube.com/watch?v=gxGuhv8oxV8. What frame rate do you get on the pi with the various opencv tasks you are doing, i.e. line following, sign reading?

    Thanks,
    Dan

    ReplyDelete
  3. Hi Daniel,

    I'm not shure about the real numbers but with the current resolution (320x240) line following is light so it is about 15 fps. Sign reading depends how deep it goes in the algorithm, about 10 fps or a little less. My RPi is in the first overclocking stage, so it is working a 800 MHz.

    Your robot looks very nice :)

    ReplyDelete
    Replies
    1. Thanks Samuel.

      It is interesting seeing the different design decisions in the two and the software differences as a result, I'm enjoying your write up.

      For example, I'm using gearmotors instead of steppers. As a result my balancing loops are all PD instead of PI.

      I've got the pi running at the stock clock speed, but a good deal of the image processing is done via opengl shaders with the output fed into a kalman filter. It can't do anything as advanced as read signs but it can make a pretty accurate guess about the 3d coords of a color blob at 25 fps.

      Delete
  4. Hi,

    Which softwaretools are you using to develop your programms?
    I am new at raspian pi and linux and opencv.
    And i have problems to get started, because i have no idea, how i can develop my programm on the pi.

    Sorry maybe this question is stupid, but i need a little bit at start
    and sorry for my bad grammar, english isn´t my native speak.

    Grettings dominic

    ReplyDelete
    Replies
    1. Hi

      This code is a PC version, I'm using Eclipse IDE in Linux.
      For the Pi I'm using GVIM editor and to compile the code I'm using cmake.
      you can find everything you need to start here:
      thinkrpi.wordpress.com

      Delete
  5. Hi, i saw your code is all about the image processing, may i know how do you send the signal to microcontroller to do the particular task eg. move forward etc.....is it i miss out any line code that does this sending functionality, kindly guild me thanks

    ReplyDelete
  6. Hello, I followed the guide from Pierre in your video description and got it all working but the guide is based on opencv2.3. When compiling your test code, g++ cannot find "opencv2/nonfree/features2d.hpp" which i found to be included with opencv2.4. How did you upgrade to opencv2.4 on the rpi?

    ReplyDelete
  7. Hi,

    This code is a PC version, you can not compile directly in the RPi. I think that include is not used at all, just remove it.

    ReplyDelete
  8. Hello Samuel, could send their contact email?

    felipecarlos83@gmail.com

    ReplyDelete
  9. keep up the good work, my friend! thank you.

    ReplyDelete
  10. hi
    can u sent me the code only for line following... it will be a inspiration for me..,......i just started opencv and pi programming

    ReplyDelete
  11. Hello Samuel,

    I'm going to start on a similar project but using a Logitech C920 webcam and Beagle Bone Black. The objective of the robot is to detect an object and drive itself to the object, similar to your ball following feature. Is there any tips, ideas, tutorials or anything at all that you could reference me to in order to achieve this goal? I am very new to robotics and this is my first project. Thanks!!!

    ReplyDelete
  12. hello!! can u send me the code im starting in opencv please and good work my friend

    ReplyDelete
  13. Dear Samuel,
    Can you give me your contact mail. Below mail is mine
    anushkashanitha@gmail.com

    ReplyDelete
  14. hello samuel

    can you give me your contact mail, please.
    or if a privacy, below mail is mine
    risandhadwi@gmail.com

    thank you

    greetings

    ReplyDelete
  15. Hello!

    Can you post the head servo controll program please? :)
    Or send by email? (blintux @ gmail . com)

    Thanks!

    ReplyDelete
  16. Olá Samuel,
    Poderia me enviar o código completo do projeto do robô?
    Não está mais disponível no link que você indicou.
    Obrigado 👍🏻

    ReplyDelete
  17. Could you send the archive to my mail shmidt.artiom2014@yandex.ru
    ? Your link no longer works.

    ReplyDelete
  18. Idem:sepe_marco@libero.It
    Grazie mille.

    ReplyDelete
  19. Idem:sepe_marco@libero.It
    Grazie mille.

    ReplyDelete
  20. Hi Samuel

    You have done some great work there and thanks for sharing your work. But the link to Dropbox has broken. Also it will be great if you can provide the balancing code too for reference.

    ReplyDelete
  21. The link is broken, so can you send the archive to eduardoaqz@gmail.com? Thanks

    ReplyDelete
  22. The link is broken. too, so can you send the archive to notty461@gmail.com? Thanks

    ReplyDelete
  23. Can you please share link on shirishugale@gmail.com

    ReplyDelete
  24. Hi!!, could you give me the whole robot code? Thank you very much
    joseromeroguetta@gmail.com

    ReplyDelete
  25. The link is broken. so can you send the archive to kofure@web.de, too? Thanks

    ReplyDelete
  26. Hello M.
    I wish with my students realize this robot, would you agree to give me the method to compile the code in view to use it on a raspberry or if you can give me the code of the robot.
    Pascal.
    @ : teidi.mount@gmail.com

    cordially

    ReplyDelete