View Single Post
  #12   Spotlight this post!  
Unread 05-02-2013, 09:03
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Is vision processing on the crio plausible?

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();
            }
        }
    }
__________________
In life, what you give, you keep. What you fail to give, you lose forever...