View Single Post
  #1   Spotlight this post!  
Unread 20-01-2013, 14:29
Gmercer Gmercer is offline
Registered User
None #1631
 
Join Date: Jan 2013
Location: Las Vegas
Posts: 15
Gmercer is an unknown quantity at this point
Finding the HSL Threshold for my reflective tape

Im currently progrmming an AxisCamera to pick up reflective tape and crop rectangle around the tape. i have most of the code down except for the parameters of the HSL Threshold, here is what i have:

Code:
public void cameraCapture() throws AxisCameraException, NIVisionException {
        if (joy1.getRawButton(3)) {
            ColorImage initImg;
            BinaryImage dataImg;
            ParticleAnalysisReport[] particle;
            int trgCnt;
            SmartDashboard.putString("Taken Picture", "Picture begun...");
            if(camera.freshImage()) {
                initImg = camera.getImage();

                //RIGHT HERE
                dataImg = initImg.thresholdHSL(0, 0, 0, 0, 0, 0);   //set threshold to bright colors(UNFINISHED)
                //No clue how to find these parameters

                dataImg = dataImg.removeSmallObjects(false, 1);     //remove small pixles from image
                dataImg = dataImg.convexHull(false);                //fill in rectangles selected
                dataImg = dataImg.particleFilter(critCollection);   //filter rectangles
                trgCnt = dataImg.getNumberParticles();
                if(trgCnt > 0) {
                    particle = dataImg.getOrderedParticleAnalysisReports();
                    SmartDashboard.putString("Taken Picture", "binary mapping finished....calling Aim");
                    Aim(particle);
                } else {
                    SmartDashboard.putString("Taken Picture", "No particles to manipulate, picture was not taken?");
                }
                dataImg.free();
                initImg.free(); 
            }
        }
    }
i don't know how to find the values. The function requires:

int hueLow
int hueHigh
int saturationLow
int saturationHigh
int luminenceLow
int luminenceHigh

I was told the NI tool "Particle Classification Training" would help, but i am not sure how to go about finding these limits of an image, how can i attain these values? Example image that i would use(im looking for the green boarder):

Last edited by Gmercer : 20-01-2013 at 14:34.