![]() |
Best Way to Learn Vision Processing
So many of you may know how I've been trying vision processing. I finally got a working install of OpenCV in Windows, using VS C++ Express 2010. However, I don't know where to start when learning OpenCV. What tutorials do you suggest? Are there any books I could look out for when I go to the public library? Video tutorials should work too.
Other than that, what webcam should I persuade either my parents or my team to buy? I don't think my laptop's integrated camera will cut it ;) Thanks ;) |
Re: Best Way to Learn Vision Processing
The OpenCV documentation is actually rather good, and I found the example code to be pretty informative when I was learning OpenCV. I learn best by example, though, so YMMV. If you want a more edited, traditional book, there are a bunch listed here; you're probably most likely to find the O'Reilly OpenCV book (the first one listed, with the butterfly).
Once you've gone through a few examples, I'd suggest trying to solve one of the past years' challenges (or you can wait until Saturday :)). OpenCV is a large enough library that you'll get lost if you try to learn the entire thing without some sort of specific challenge to direct your efforts. If you have access to the game elements from those years, that would obviously be the best; else I'd suggest looking for pictures on Chief Delphi (ex: Jared from 341 posted some example camera captures from the 2012 game) or on-robot camera footage off of YouTube (keepvid.com/). Just try applying some of the filters and see what happens. I'd recommend starting with smoothing operators, color-space conversions, and thresholds. From there, you can move onto contour analysis and simple shape detection using Hough transforms. When it comes to webcams, some are slightly better than others, but in my experience they're all about the same. The real advantage to having another webcam besides the one built into your laptop is that you can easily aim it at things without having to contort yourself and your laptop into weird poses. |
Re: Best Way to Learn Vision Processing
C++ OpenCV 2.0 may or may not be the best way to get into vision processing depending on your software background. Because it is a big library that does a lot of complicated things, there is a pretty steep learning curve. Moreover, current versions of OpenCV rely upon a pretty solid foundation in modern C++.
If you know Python, I recommend using OpenCV's Python bindings for rapid prototyping: it is syntactically simplified and quicker to throw together something that works in my experience. If you have access to it, I highly recommend using Matlab's Image Processing Toolbox. I learned a large part of my foundation in vision from using its functions and (just as importantly) reading its documentation. Computer vision is such an interesting subject because it combines so many disciplines of mathematics and computer science. I first took several courses in signal processing before diving into vision, and was glad I did so; many vision problems can be described as filtering problems. Graph theory, 3D geometry, and machine learning are all also very relevant fields. I would start with whichever one of these you might have some background, and grow from there. Classic algorithms or techniques to get familiar with: The pinhole camera model Camera calibration Thresholding Binary morphology (erode/dilate) Edge/corner detection Correlation/Cross-correlation I think that is pretty close to the order I would go in, as well (maybe gloss over calibration quickly at first). |
Re: Best Way to Learn Vision Processing
Here's a Python 'tutorial' I put together to help our team better understand the algorithm described in the FIRST vision processing doc @ http://wpilib.screenstepslive.com/s/3120/m/8731, and the similar team 341 posted vision code.
Maybe you will find it helpful if you aren't past this point yet. https://github.com/LiftingSea/frc_vision_tutorial It also leveraged some of the OpenCV tutorials to open multiple windows for the various stages of the processing, and provide some knobs for experimenting with tuning the algorithm in real time. I started writing it in C++ using just the open source gcc compiler, and, as mentioned in another post here, decided to take advantage of the interactive and friendlier Python environment. The 'tutorial' involves running the program and seeing how the tuning knobs affect the targeting results, as well as some suggested 'next steps' for students to take in the comments at the beginning of the file, to facilitate learning by example. |
Re: Best Way to Learn Vision Processing
Quote:
|
Re: Best Way to Learn Vision Processing
Quote:
Quote:
Quote:
It also comes down to that me (an many other novices) don't know what to learn and what to skip. So far, the only thing I've been able to accomplish is finding a certain color (which didn't work too well because I didn't have a colored object to track). I looked in our library's online catalog and can say that our library is missing basic AI books. The only thing I could find were books on how to hack and use the Kinect, not exactly what I am looking for :rolleyes:. I will probably dissect the 341 code and rewrite it in C. Anyways, so I have an OpenCV C++ installation. How do I install the Java bindings? With 5GB of HDD storage available, I don't want to install a compiler to build it. Also, how well is it documented? Is it as good as the C++ version of OpenCV? Another thing I wonder about is whether to learn C, C++, Java or Python or maybe even something else. One thing that I dislike about C is that the program will compile correctly. However, when I launch it, it will spit out just tons of fatal errors. How can I set the IDE (Visual Studio currently) to tell me that there are errors in the code? I have actually had my system hang because of a simple typo! |
Re: Best Way to Learn Vision Processing
Quote:
Jared and I gave you lists of topics to get started with also as a way to try to give you some direction about where to focus initially. If you like (1), the 341 example code and OpenCV tutorial code is a great way to start. If you like (2), either pick up one of those books (if there's nothing available in the library, then perhaps a late nondenominational winter holiday present? or can you convince your team to buy it as a resource to you and future students?) or you can check out courses on Coursera or EdX - though be warned that these will probably quickly require a decent understanding of calculus and linear algebra. Quote:
Quote:
As Jared says, Python's more concise syntax will allow you to iterate faster than you would in Java. Java will probably have a little better performance, though if you're mostly just calling OpenCV functions and not trying to process the pixels yourself, this is much less of a concern. Go with whatever language is most comfortable for you. Quote:
Code:
java -Djava.library.path=C:\opencv\build\java\x64 -cp .;C:\opencv\build\java\opencv-247.jar MainClass |
Re: Best Way to Learn Vision Processing
1 Attachment(s)
It looks like the wpilib.screenstepslive links were changed when 2014 rolled in, and I don't see that same doc in the 2014 set. I'm posting it here for you. I found it helpful reading to get a handle on the generic approach I'm seeing used in other team's posted code.
|
Re: Best Way to Learn Vision Processing
Quote:
|
Re: Best Way to Learn Vision Processing
Quote:
I have also setup the Axis M1011 Camera (plugged into the D-Link, and it has a green ring light) so it has a brightness of ~10, and have it displaying on the driver station (would like to process it using the cRIO). I added a picture to the cRIO root directory (testimage.jpg) from the vision example program. I loaded the 2014 Vision Code and ran Autonomous but nothing happened. What should I do? |
Re: Best Way to Learn Vision Processing
I strongly recommend the PS3 Eye camera. They can be had for ~$20 on Amazon. They're also proper computer vision cameras, as they're designed to work with the little glowing controller thing from Sony. You get:
* Up to 120fps capture * Up to 640x480 resolution * Good driver support on Windows and Linux * 2 lens settings (50deg and 70deg FOV if memory serves) The other cool thing with the Eye, is so popular you can get 3rd party lenses and IR imaging solutions for it. In 2012 my team had a pretty sophisticated CV approach, but at one competition our sensor was blinded by the stadium lighting being mounted directly behind the backboard. 2013 we switched to using infrared for the retro-illumination and did not have a repeat. |
Re: Best Way to Learn Vision Processing
@DavisC: I haven't tried running the crio hosted vision code. To learn about vision processing, our team is taking the approach of writing algorithms using open cv on laptops and ironing out bugs there, then attempting to deploy to a second on-robot processor that would be running our code in either python or C++, and handing calculated results to the crio code. Sorry I don't have an answer for you about next steps with the approach your taking.
|
Re: Best Way to Learn Vision Processing
I have read this book... http://simplecv.org/ . It is pretty good. I have in past season's used OpenCV 2.0 using C++ ( VS 2010 on windows 7 on a i3 core) and I have used SimpleCV on an Odriod-u2 (just bought the U3). I learned allot more about vision processing itself while using just OpenCV. Lots of tutorials and books. The main reason I learned more was because SimpleCV does allot of the work for you and it is a higher abstraction that is built on OpenCV. Like many abstractions they leak so it is good to know what is underneath. http://www.joelonsoftware.com/articl...tractions.html
We use SimpleCV because I know OpenCV (master beginner) and that makes me more productive. I am glad I started with OpenCV to learn simple vision processing but it is a steeper learning curve. There is this and it is not cheap (though I did get Mathworks to get me a node locked copy for student use for our FIRST team of Matlab with all of the packages). http://www.petercorke.com/Machine_Vision_Toolbox.html I also have access through work. It is not the cheapest way to learn vision but it is a common way in college and it can show you some advanced material and concepts. I have looked at the code that comes with 2014. It is pretty much what we did as far as an algorithm last year to get distance in SimpleCV. |
| All times are GMT -5. The time now is 03:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi