Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   particle filter question and compression question (http://www.chiefdelphi.com/forums/showthread.php?t=104155)

Method 03-03-2012 20:59

particle filter question and compression question
 
Hello, I just wanted clarification on a couple of things.

first, compression: what is it?
I have read in some articles that if it is 0 there is an issue but I don't have it.

second, third and fourth, particle filters: I at first thought that the vector analysis report ordered the targets by score but now it is apparent they are from the top right and i need to do that manually if i want the feature?

Also, if I only use a single step filter it seems to remove particles outside or inside my criteria but if i use a multiple step filter they all remain. To counter this, i have been using multiple filters (is there a way to fix this so i can use one?) which brings me to my last question-

at some point i messed up my code and had to fix some things. What is below does not work but i have a working version. the working version merely does not have the second filter but i do not know what is wrong with this. The issue is that the code gets hung up in the first iteration of my 'while(IsAutonomous() && IsOperatorControl())' loop. the suspect filter and it's criteria are highlighted in yellow


Code:

                AxisCamera &canICam = AxisCamera::GetInstance("10.16.71.11");




                canICam.WriteBrightness(50);
                canICam.WriteWhiteBalance(AxisCamera::kWhiteBalance_Hold);
                canICam.WriteResolution(AxisCamera::kResolution_320x240);
                canICam.WriteColorLevel(50);
                canICam.WriteCompression(0);
                //lower easier on CRIO and harder on cam
                canICam.WriteMaxFPS(5);




                Threshold threshold(RL,RH,GL,GH,BL,BH);
                ParticleFilterCriteria2 criteria[] = {IMAQ_MT_BOUNDING_RECT_HEIGHT, 0, 15, false, true};
                ParticleFilterCriteria2 criteria2[] = {IMAQ_MT_AREA_BY_PARTICLE_AND_HOLES_AREA, 0, 74, false, false};

                                //Set this element to TRUE to indicate that a match occurs when the measurement is outside the criteria range.
                BinaryImage *thresholdImage = img->ThresholdRGB(threshold);        // get just the red target pixels
                delete img;
                BinaryImage *filteredImage = thresholdImage->ParticleFilter(criteria, 1);  // find the rectangles
                delete thresholdImage;
                BinaryImage *biFilteredImage = filteredImage->ParticleFilter(criteria2, 1);  // find the rectangles
                delete filteredImage;

                BinaryImage *convexHullImage = biFilteredImage->ConvexHull(false);  // fill in partial and full rectangles
                delete biFilteredImage;
                                       
                vector<ParticleAnalysisReport> *reports = convexHullImage->GetOrderedParticleAnalysisReports();  // get the results



All times are GMT -5. The time now is 17:39.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi