Yes it is possible and plausible, but there are a few special considerations. We did it last year, and got between 5-10 fps processing time depending on how clean our images were.
You need excellent illumination to create high-contrast images. I recommend two bright green LED ring-lights, or even more. You will also need to tune your camera's exposure settings to give you the most contrast as possible.
Here is a oldie but goodie whitepaper from team 67 on how to do this:
http://thinktank.wpi.edu/article/118
Why do you need to do this?
You need to keep the object recognition routines as simple as possible, so you need to start with very simple images. Black background with your object in bright green is your goal.
Here is Java code from our robot last year showing how we did this:
Code:
public void processCamera() {
if (camera.freshImage()) {
try {
//Take a snapshot of the current turret pot position
curTurretPot = turret.getPos();
colorImage = camera.getImage(); // get the image from the camera
freshImage = true;
//TODO: Tune these HSL values at the venue!
binImage = colorImage.thresholdHSV(ImagingConstants.kHThresholdMin, ImagingConstants.kHThresholdMax, ImagingConstants.kSThresholdMin, ImagingConstants.kSThresholdMax, ImagingConstants.kLThresholdMin, ImagingConstants.kLThresholdMax);
s_particles = binImage.getOrderedParticleAnalysisReports(4);
colorImage.free();
binImage.free();
if (s_particles.length > 0) {
int lowestY = 0;
for (int i = 1; i < s_particles.length; i++) {
circ = s_particles[i];
//Find the highest rectangle (will have the lowest Y coordinate)
if (s_particles[lowestY].boundingRectTop > circ.boundingRectTop) {
if ((circ.boundingRectWidth > 20) && (circ.boundingRectHeight > 20)) {
lowestY = i;
}
}
}
topTarget = s_particles[lowestY];
//Send bounding rectangle info to SmartDashboard
// Check if the best top blob is bigger than 20
if (topTarget.particleArea > 20) {
xOffset = ((topTarget.boundingRectLeft + topTarget.boundingRectWidth / 2) - 160.0) / 160.0;
size = topTarget.particleArea;
} else {
xOffset = 0;
topTarget = null;
}
} else {
xOffset = 0;
topTarget = null;
}
} catch (AxisCameraException ex) {
ex.printStackTrace();
} catch (NIVisionException ex) {
ex.printStackTrace();
}
}
}