|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Hello,
So I have a set of targets setup for vision processing for this season, and have a green led ring around the M1011 camera lens. I am attempting to use the Vision Sample 2014 default code, however nothing happens. What should I do from here? Thanks, DavisC |
|
#2
|
|||||
|
|||||
|
Re: Vision Processing on cRIO
Do you see the targets glowing green on the image returned by the camera?
|
|
#3
|
||||||
|
||||||
|
Re: Vision Processing on cRIO
It would be helpful to explain what changes you made to the code. By default, it does not read from the camera, but instead reads an image from the cRIO filesystem. http://wpilib.screenstepslive.com/s/...95-c-java-code
|
|
#4
|
|||
|
|||
|
Re: Vision Processing on cRIO
Quote:
I commented out and uncommented the lines referred to (here). After doing that, it threw an error saying "camera" not declared. So after looking around I figured I declare the camera something like so: Code:
class VisionSample2014 : public SimpleRobot... AxisCamera& camera;public:VisionSample2014(void):... camera::GetInstance(CAMERA_IP) This all built and deployed without errors. Yes, I also adjusted the brightness of the camera using the online interface to ~15 to make the green stand out more on the dark/black background Last edited by DavisC : 16-01-2014 at 19:09. |
|
#5
|
|||
|
|||
|
Re: Vision Processing on cRIO
After you've done those steps, you may want to compare the color of the retroreflective glow to the color threshold in the code. You want the glow value to be inside the min/max values. This will result in a binary image mask with on pixels that represent the glow and off pixels being something else. At that point, the rest should start working pretty well.
Greg McKaskle |
|
#6
|
|||
|
|||
|
Re: Vision Processing on cRIO
I tested all of that today in the vision assistant and found the threshold values and plugged them into the code.
I decided to test something I know would work and added a line to run the motors after the line that checks to see if the "reports" is greater than 0. That Worked! (I was using static image for this point). Not sure to what extent the vision tracking worked though. I also added a line in the same place like so: Code:
printf("Hello World!");
I have looked through some threads about the printf in netConsole but have had no success. |
|
#7
|
|||
|
|||
|
Success! Detected the horizontal target from my own testImage, Vertical one did not succeed but will have to test on Tuesday with a new image / live tracking.
For the printf problem (I attempted to print to driver station but that had annoyances), evidently I am blind when it comes to seeing the netConsole option on the Imaging tool (kept thinking Console out is what people meant ).After selecting that, everything printed beautifully and I will perform more operations on the image over the coming week. Thanks for your help! DavisC Must be that Friday success. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|