Has anyone out there have working Vision Processing/Tracking code for Windriver? I can’t seem to get the sample C++ code to work. Any advice would be useful.
Hello! I do; while I am reluctant to make it available as a first resort, I would be happy to get you started.
http://www.virtualroadside.com/WPILib/class_axis_camera.html
There is a page describing the ‘AxisCamera’ Class in the WPI library.
When you initialize your camera code you need to also use this function in order to display the image in your dashboard.
Camera_Object_Name = &AxisCamera::GetInstance(CAMERAIPADDRESS);
sometimes the camera code causes some serious issues; this is my warning. I suggest you check the ‘IsFreshImmage()’ function before you start to try processing to lower the strain on your CRIO. Also, putting the camera code in a loop accessed through a button press or something might be a good idea.
After checking that you need a ColorImage
for example
ColorImage *image = CameraObjectName->GetImage();
Also check if ‘GetWidth()’ is greater than 0 at this point. if the camera is starting up it won’t be and this will cause an exception when you begin image processing.
as far as the processing goes, i suggest you use the VisionAssistant provided by FIRST to see what works for filtering your target then just writing your own code with the color image lib http://www.virtualroadside.com/WPILib/class_color_image.html to do the same processes.
After that all you need to do is get the x, y, values of your targets and whatever else you want!
also, you need to enable anonymous viewer login. this is done in the camera settings