Go to Post Success is inspiring high schoolers to get real world experiance through internships with their sponsors. - Pamela [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-03-2012, 20:59
Method's Avatar
Method Method is offline
Registered User
no team
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Ca
Posts: 38
Method is an unknown quantity at this point
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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:28.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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