Go to Post TL, DR: You may be skilled at karate on your own, but imagine how much better you'll be with Mr. Miyagi mentoring you. - artdutra04 [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 03-02-2012, 16:42
Supernovapsy Supernovapsy is offline
Registered User
FRC #1334
 
Join Date: Feb 2012
Location: Canada
Posts: 18
Supernovapsy is an unknown quantity at this point
Vision Tracking imaqMorphology exception

Hi, we have been having trouble getting vision tracking, and our problem is at the step in which when we are taking away small objects.

Here's our code:
Code:
AxisCamera& camera = AxisCamera::GetInstance("10.13.34.11");
	if (camera.IsFreshImage())
	{
		int low = 125;
		int high = 255;
		StructuringElement* sElement;
		sElement->matrixCols = 3;
		sElement->matrixRows = 3;
		sElement->hexa = FALSE;
		HSLImage* image = camera.GetImage();
		MonoImage* luminance = image->GetLuminancePlane();
		image->ReplaceRedPlane(luminance);
		image->ReplaceGreenPlane(luminance);
		image->ReplaceBluePlane(luminance);
		BinaryImage* bImage = image->ThresholdHSL(low, high, low, high, low, high);
		BinaryImage* bImage1 = new BinaryImage();
		imaqMorphology(bImage1 -> GetImaqImage(), bImage -> GetImaqImage(), IMAQ_ERODE, sElement);
		delete bImage;
		BinaryImage* bImage2 = new BinaryImage();
		imaqMorphology(bImage2 -> GetImaqImage(), bImage1 -> GetImaqImage(), IMAQ_ERODE, sElement);
		delete bImage1;
		BinaryImage* bImage3 = new BinaryImage();
		imaqMorphology(bImage3 -> GetImaqImage(), bImage2 -> GetImaqImage(), IMAQ_ERODE, sElement);
		delete bImage2;
		BinaryImage* bImage4 = new BinaryImage();
		imaqMorphology(bImage4 -> GetImaqImage(), bImage3 -> GetImaqImage(), IMAQ_ERODE, sElement);
		delete bImage3;
		BinaryImage* bImage5 = new BinaryImage();
		imaqMorphology(bImage5 -> GetImaqImage(), bImage4 -> GetImaqImage(), IMAQ_DILATE, sElement);
		delete bImage4;
		BinaryImage* bImage6 = new BinaryImage();
		imaqMorphology(bImage6 -> GetImaqImage(), bImage5 -> GetImaqImage(), IMAQ_DILATE, sElement);
		delete bImage5;
		BinaryImage* bImage7 = new BinaryImage();
		imaqMorphology(bImage7 -> GetImaqImage(), bImage6 -> GetImaqImage(), IMAQ_DILATE, sElement);
		delete bImage6;
		BinaryImage* bImage8 = new BinaryImage();
	    imaqMorphology(bImage8 -> GetImaqImage(), bImage7 -> GetImaqImage(), IMAQ_DILATE, sElement);
	    delete bImage7;
		vector<ParticleAnalysisReport>* particles = bImage -> GetOrderedParticleAnalysisReports();
		cout << particles->size() << endl;
		delete particles;
		delete bImage8;
		delete luminance;
		delete image;
	}
Our problem is at the imaqMorphology functions. It looks weird because this is our most recent try at fixing it. The code compiles successfully, but gives this error in the console, and prevents the robot from running.


0x2a8cda8 (FRC_RobotTask): memPartAlloc: block too big 3913540616 bytes (0x8 alig
in partition 0x34f600
0
Default TeleopContinuous() method... Overload me!
0x2a8cda8 (FRC_RobotTask): memPartAlloc: block too big 3368229384 bytes (0x8 alig
in partition 0x34f600

program
Exception current instruction address: 0x00000000
Machine Status Register: 0x0008b012
Condition Register: 0x28000828
Task: 0x2a8cda8 "FRC_RobotTask"
0x2a8cda8 (FRC_RobotTask): task 0x2a8cda8 has had a failure and has been stopped.
0x2a8cda8 (FRC_RobotTask): fatal kernel task-level exception!


The first block of the error sometimes repeats itself over and over again.

We have looked at the java version for vision tracking, but it doesn't really help us as some of the functions in java aren't in c++.

Thank you very much.
Reply With Quote
 


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 17:40.

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