![]() |
Camera Tracking Problems...
With this code we get an image from the camera but we have an issue with trying to get the camera to track and print out the results, any ideas? thanks.
Code:
package edu.wpi.first.wpilibj.templates; |
Re: Camera Tracking Problems...
I think the problem with this code is the threshold. If you have the NI Vision Assistant, put the image in that program and then mess with threshold values. Once you have that down, plug those numbers back into the program and that should do it :D
|
Re: Camera Tracking Problems...
Is this copied directly from the demo program with a few modifications? Also what errors are you getting and where?
|
Re: Camera Tracking Problems...
ColorImage image; // next 2 lines read image from flash on cRIO
image = new RGBImage("/10ft2.jpg"); You are reading the image from the crio, so you probably didnt upload the image to it. There were two lines after this code that allowed you to read it from the camera. Try setting the image to the one read from the camera and see what happens. |
Re: Camera Tracking Problems...
Quote:
@severhale yes we did copy this from the demo program and made some modifications and are not getting any errors accordingly. @xmendude217 we did check the thresholds, and they are correct for what we need. |
Re: Camera Tracking Problems...
Our camera is not taking the code... we get an unfiltered image to the driver station, and the camera doesn't seem to have any problems.. it's imaged correctly apparently, but it's not responding to changes in resolution or rotation code, or anything of the sorts.
|
Re: Camera Tracking Problems...
The dashboard image is not affected by certain things like resolution changes. And you will not see the filtered images unless you save them to the cRIO.
|
Re: Camera Tracking Problems...
I would be inclined to agree with xmendude that your problem most likely lies in your thresholding. Setting 0s for all values would, yes, detect black objects, but only perfectly black objects with absolutely no color at all. My bet is as soon as you have any light at all in the image the values would no longer be 0 for R, G, and B.
Out of curiosity, what's your setup that you find it viable to look for only perfectly black objects? |
Re: Camera Tracking Problems...
We have a procedure for determining the distortion for your camera, using JavaCV. See this thread http://chiefdelphi.com/forums/showthread.php?t=101753
Our answer was xc= x*(1 -0.055*r^2 ), and yx = y*(1 - 0.55*r^2), where r is the distance from the center of the image, and x,y is the pixel location from the center of the image. This number is for the Axis 1011 camera. You may use this value either during photo processing or after you get your points, depending on the image processing load you can support. Other calibration techniques exist; this is just the one we used. |
Re: Camera Tracking Problems...
Quote:
@jesusrambo We are setting up for perfectly black objects because of the black tape around our targets because they are black, if we were to compensate for luminosity where would we set that? @jviolette123 we will take that into account. thank you for your time, we will post again if we have more problems. |
Re: Camera Tracking Problems...
Yes the tape is black, but with ambient light and all and with the quality of the cameras I'd be somewhat surprised if it was black enough to be all 0s.
A better solution might be to check out HSL for your thresholding. |
Re: Camera Tracking Problems...
I'd actually be surprised if the sensor returns zeros even in the dark. Sensors are noisy.
Greg McKaskle |
Re: Camera Tracking Problems...
we are still having issues with the code, we have set it with a larger threshold to account luminosity and color gradient. can you give us a direct way to save the image to the rio and then to export it to the dashboard so we can see it? thanks.
|
Re: Camera Tracking Problems...
Quote:
Quote:
|
Re: Camera Tracking Problems...
We have set our code to write the images the camera has retrieved and filtered. After the camera's fresh image is returned, all of them return black, any ideas what caused this? thanks
|
Re: Camera Tracking Problems...
Can we see your code?
|
Re: Camera Tracking Problems...
Code:
/* |
Re: Camera Tracking Problems...
Desperation bump
|
| All times are GMT -5. The time now is 11:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi