Go to Post There are always rules we don't agree with, just like in life. Our character is defined by how we respond. - Mr MOE [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 01-16-2014, 04:37 PM
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Question Vision Processing on cRIO

Hello,

So I have a set of targets setup for vision processing for this season, and have a green led ring around the M1011 camera lens.

I am attempting to use the Vision Sample 2014 default code, however nothing happens.

What should I do from here?

Thanks,
DavisC
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #2   Spotlight this post!  
Unread 01-16-2014, 04:43 PM
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: Vision Processing on cRIO

Do you see the targets glowing green on the image returned by the camera?
Reply With Quote
  #3   Spotlight this post!  
Unread 01-16-2014, 04:46 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,547
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Vision Processing on cRIO

It would be helpful to explain what changes you made to the code. By default, it does not read from the camera, but instead reads an image from the cRIO filesystem. http://wpilib.screenstepslive.com/s/...95-c-java-code
Reply With Quote
  #4   Spotlight this post!  
Unread 01-16-2014, 07:03 PM
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: Vision Processing on cRIO

Quote:
Originally Posted by Joe Ross View Post
It would be helpful to explain what changes you made to the code. By default, it does not read from the camera, but instead reads an image from the cRIO filesystem. http://wpilib.screenstepslive.com/s/...95-c-java-code
Yes, sorry forgot about that.
I commented out and uncommented the lines referred to (here).
After doing that, it threw an error saying "camera" not declared. So after looking around I figured I declare the camera something like so:

Code:
class VisionSample2014 : public SimpleRobot
... AxisCamera& camera;
public:
VisionSample2014(void):
... camera::GetInstance(CAMERA_IP)
I added CAMERA_IP as a new #define above

This all built and deployed without errors.

Quote:
Originally Posted by Alan Anderson View Post
Do you see the targets glowing green on the image returned by the camera?
Yes, I also adjusted the brightness of the camera using the online interface to ~15 to make the green stand out more on the dark/black background
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present

Last edited by DavisC : 01-16-2014 at 07:09 PM.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-17-2014, 08:26 AM
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Vision Processing on cRIO

After you've done those steps, you may want to compare the color of the retroreflective glow to the color threshold in the code. You want the glow value to be inside the min/max values. This will result in a binary image mask with on pixels that represent the glow and off pixels being something else. At that point, the rest should start working pretty well.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 01-17-2014, 04:43 PM
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: Vision Processing on cRIO

I tested all of that today in the vision assistant and found the threshold values and plugged them into the code.

I decided to test something I know would work and added a line to run the motors after the line that checks to see if the "reports" is greater than 0. That Worked! (I was using static image for this point).
Not sure to what extent the vision tracking worked though.

I also added a line in the same place like so:

Code:
printf("Hello World!");
That did NOT work... So the printf statements are not showing up.
I have looked through some threads about the printf in netConsole but have had no success.
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #7   Spotlight this post!  
Unread 01-18-2014, 12:50 AM
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Thumbs up Re: Vision Processing on cRIO

Success! Detected the horizontal target from my own testImage, Vertical one did not succeed but will have to test on Tuesday with a new image / live tracking.

For the printf problem (I attempted to print to driver station but that had annoyances), evidently I am blind when it comes to seeing the netConsole option on the Imaging tool (kept thinking Console out is what people meant ).
After selecting that, everything printed beautifully and I will perform more operations on the image over the coming week.

Thanks for your help!
DavisC

Must be that Friday success.
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
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 09:15 AM.

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