Go to Post Though, of course, if the old one you like is shot, then you can just beat your new one with a hammer until it works the way you want. - Kevin Sevcik [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 29-01-2013, 19:35
aminnich aminnich is offline
Registered User
FRC #4028
 
Join Date: Jan 2013
Location: Ohio
Posts: 2
aminnich is an unknown quantity at this point
Cannot write image to cRIO?

We took the FRC 2013 Vision Example and uncommented the proper lines to write a threshold image to the cRIO. However, I am not seeing this image anywhere.

Here is some relevant code. All of the changes are in here; everything else is unmodified from the template.
Code:
//while (IsAutonomous() && IsEnabled()) {
            /**
             * Do the image capture with the camera and apply the algorithm described above. This
             * sample will either get images from the camera or from an image file stored in the top
             * level directory in the flash memory on the cRIO. The file name in this case is "testImage.jpg"
             */
			ColorImage *image;
			//image = new RGBImage("/testImage.jpg");		// get the sample image from the cRIO flash

			camera.GetImage(image);				//To get the images from the camera comment the line above and uncomment this one
			BinaryImage *thresholdImage = image->ThresholdHSV(threshold);	// get just the green target pixels
			thresholdImage->Write("/testImage.jpg");
			BinaryImage *convexHullImage = thresholdImage->ConvexHull(false);  // fill in partial and full rectangles
			//convexHullImage->Write("/ConvexHull.bmp");
			BinaryImage *filteredImage = convexHullImage->ParticleFilter(criteria, 1);	//Remove small particles
			//filteredImage->Write("Filtered.bmp");

			vector<ParticleAnalysisReport> *reports = filteredImage->GetOrderedParticleAnalysisReports();  //get a particle analysis report for each particle
			scores = new Scores[reports->size()];
Anybody have an idea why an image isn't being written to the cRIO?
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2013, 21:49
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Cannot write image to cRIO?

Quote:
Originally Posted by aminnich View Post
Anybody have an idea why an image isn't being written to the cRIO?
It looks to me like the entire while loop is commented out.
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2013, 17:18
aminnich aminnich is offline
Registered User
FRC #4028
 
Join Date: Jan 2013
Location: Ohio
Posts: 2
aminnich is an unknown quantity at this point
Re: Cannot write image to cRIO?

Quote:
Originally Posted by Alan Anderson View Post
It looks to me like the entire while loop is commented out.
It's commented out because we only want it to write an image once.
Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2013, 09:14
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Re: Cannot write image to cRIO?

Change the .jpg and .bmp extensions to .png, I had the problem you had and this worked for me.
Also, you should uncomment these lines so you can see all the images proccessed:
Code:
//convexHullImage->Write("/ConvexHull.bmp");
//filteredImage->Write("Filtered.bmp");
__________________

2012 Head of Programming and Electrical
2013-14 Overall Team Captain and Programming Head
2012-14 Mentor of FLL Team Power Surge
2014 Dean's List Finalist
2014 CIR Xerox Creativity Award
Webpage
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 13:00.

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