Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Vision Processing on cRIO (http://www.chiefdelphi.com/forums/showthread.php?t=124758)

DavisC 16-01-2014 16:37

Vision Processing on cRIO
 
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

Alan Anderson 16-01-2014 16:43

Re: Vision Processing on cRIO
 
Do you see the targets glowing green on the image returned by the camera?

Joe Ross 16-01-2014 16:46

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

DavisC 16-01-2014 19:03

Re: Vision Processing on cRIO
 
Quote:

Originally Posted by Joe Ross (Post 1328191)
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

Yes, sorry forgot about that.
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)

I added CAMERA_IP as a new #define above

This all built and deployed without errors.

Quote:

Originally Posted by Alan Anderson (Post 1328189)
Do you see the targets glowing green on the image returned by the camera?

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

Greg McKaskle 17-01-2014 08:26

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

DavisC 17-01-2014 16:43

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!");
That did NOT work... So the printf statements are not showing up.
I have looked through some threads about the printf in netConsole but have had no success.

DavisC 18-01-2014 00:50

Re: Vision Processing on cRIO
 
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 :o ).
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.


All times are GMT -5. The time now is 12:05.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi