Go to Post UFH has substance. It puts the I in FIRST. - Andy Baker [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 23-01-2013, 20:42
ekovacs ekovacs is offline
Registered User
AKA: Evan Kovacs
FRC #2539
Team Role: College Student
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Palmyra, PA
Posts: 21
ekovacs is on a distinguished road
Sample vision code not working

Hi,

We tried to use the sample vision code that came from the latest c++ update and we were not able to get it to work. We placed debug lines to print out to the driver station lcd after every line and found the bad line of code.

Code:
BinaryImage *thresholdImage = image->ThresholdHSV(threshold);
The execution completely stops after this line and we have no other error messages in the diagnostics tab of the drivers station.

Does anyone know how to get around this and get the sample vision code working?
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2013, 13:01
Pulverator's Avatar
Pulverator Pulverator is offline
Registered User
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Naples
Posts: 8
Pulverator is an unknown quantity at this point
Re: Sample vision code not working

We are having the same issue. Hopefully Saturday we'll be able to figure it out. In the meantime, there is another thread you might want to check out.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2013, 13:54
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Sample vision code not working

What kind of checking are you doing to verify your image is valid when you call camera.getImage.

Last year, people had some issues with images that were valid pointers, but had 0 width, and would crash (due to an exception). I used this guard code after getting the image, but before converting to a binaryImage.
Code:
if ((colorImage == (void *) 0) || (colorImage->GetWidth() == 0) || (colorImage->GetHeight() == 0))
{
return returnVal;
}
My full code is here: https://github.com/TeamExcel/Project.../Robot2012.cpp
Line 795 has the camera code.
Reply With Quote
  #4   Spotlight this post!  
Unread 24-01-2013, 19:45
ekovacs ekovacs is offline
Registered User
AKA: Evan Kovacs
FRC #2539
Team Role: College Student
 
Join Date: Dec 2012
Rookie Year: 2011
Location: Palmyra, PA
Posts: 21
ekovacs is on a distinguished road
Re: Sample vision code not working

We ran the check to see if the image was valid and it passed. We then wanted to see what what the height value was.
Code:
screen->PrintfLine(DriverStationLCD::kUser_Line3,
"Valid image:%dx%d,
image->GetHeight(),
image->GetWidth());
This line is giving us a height of 3670016. Does this seem like the correct height value for the image? We don't think this is the right value for height. What do you think is causing this?
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2013, 09:13
AaronS AaronS is offline
Registered User
FRC #0166
 
Join Date: Jan 2013
Location: Merrimack, NH
Posts: 6
AaronS is an unknown quantity at this point
Re: Sample vision code not working

Our team is having a similar issue trying to run the VisionSample2013 code.

We added a GetWidth query after the GetImage line and the value is a very large value.

Similar result that we have a fatal error on the Threshold line.

We also wrote and read the resolution to/from the camera and that seems to be working.
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 14:03.

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