Go to Post i swear, if it were april fools day, i would not believe this whole lord dumpling/dean kamen thing...but then again, this is FIRST - sure_smile [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 19-01-2013, 00:03
inkspell4's Avatar
inkspell4 inkspell4 is offline
Registered User
FRC #3650 (Robo Raptors)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Maryland
Posts: 326
inkspell4 will become famous soon enough
I haven't even tested the code yet but i know that the sample seems to filter out all but red while we need it to filter out all but green
__________________
Chesapeake Regional : 2013, 2012, 2011
Rookie Year: 2011
2013 RoboRaptors Team 3650 Programming Team Captain
Team Website : http://www.roboraptorsfrcteam3650.com/index.html
_____________________________________________
Reply With Quote
  #17   Spotlight this post!  
Unread 19-01-2013, 00:06
inkspell4's Avatar
inkspell4 inkspell4 is offline
Registered User
FRC #3650 (Robo Raptors)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Maryland
Posts: 326
inkspell4 will become famous soon enough
Would it be better to replace the hsv threshold with rgb
__________________
Chesapeake Regional : 2013, 2012, 2011
Rookie Year: 2011
2013 RoboRaptors Team 3650 Programming Team Captain
Team Website : http://www.roboraptorsfrcteam3650.com/index.html
_____________________________________________
Reply With Quote
  #18   Spotlight this post!  
Unread 19-01-2013, 07:52
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: Values for Image Proccessing

It is a bit difficult to talk about these with no images.

The Threshold operation compares pixel values and returns a Boolean masked image. The image only has two values, 0 and nonzero. Vision Assistant and other tools will typically display this with two colors. The colors have no relation to any original colors.

If the threshold is masking out the wrong color, change the hue. I attached an approximate hue wheel from a LV panel. I highly recommend you open up Vision Assistant and experiment with an image and the color threshold block.
The block supports RGB, and various HS(IVL) versions.

There was a question about switching to RGB, and that will be a bit faster to process, but I think you'll find it far less accurate for specifying ranges. But the cool thing about Vision Assistant is that you can experiment, discover things, and ask questions.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	8
Size:	42.1 KB
ID:	13575  
Reply With Quote
  #19   Spotlight this post!  
Unread 19-01-2013, 09:33
inkspell4's Avatar
inkspell4 inkspell4 is offline
Registered User
FRC #3650 (Robo Raptors)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Maryland
Posts: 326
inkspell4 will become famous soon enough
Thank you for all your help
__________________
Chesapeake Regional : 2013, 2012, 2011
Rookie Year: 2011
2013 RoboRaptors Team 3650 Programming Team Captain
Team Website : http://www.roboraptorsfrcteam3650.com/index.html
_____________________________________________
Reply With Quote
  #20   Spotlight this post!  
Unread 19-01-2013, 10:08
Chimera0x694's Avatar
Chimera0x694 Chimera0x694 is offline
Registered User
AKA: Kelly Malone
FRC #1684 (The Chimeras)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2010
Location: Lapeer,MI
Posts: 10
Chimera0x694 is just really niceChimera0x694 is just really niceChimera0x694 is just really niceChimera0x694 is just really nice
Talking Re: Values for Image Proccessing

Last year for image processing we put the camera with the LEDs on the robot, lined it up, and used the driver station image. If you look at the bottom of the image you should see RGB values. Put the cursor on the highlighted target and record tose values, then plug them into your code. Now, if you are doing this in your work area, these values are going to be different when you take your robot to competitions. It will need to be calibrated each time you move to a place with different lighting. I hope this helps! Good luck with Java!
__________________

"How do you pronounce your name?"
We get asked this question a lot. Or, We are called "chi-mare-ahs" Or, "chI-mare-ahs"
To set the record straight, It's pronounced "kI-mare-ahs"

2011-
Ranked 172nd in the state of Michigan
2012-
Ranked 24th in the state of Michigan
Kettering University District-Quality Award
Reply With Quote
  #21   Spotlight this post!  
Unread 19-01-2013, 10:17
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: Values for Image Proccessing

Do you recall what the values were? Do you have your camera set to automatically adjust white balance and exposure?

If you were to set the camera up to where the majority of light you care about comes from the LEDs and the camera isn't adjusting settings, I suspect the values won't need to be calibrated or the calibration will not change by much.

Greg McKaskle
Reply With Quote
  #22   Spotlight this post!  
Unread 19-01-2013, 10:31
Chimera0x694's Avatar
Chimera0x694 Chimera0x694 is offline
Registered User
AKA: Kelly Malone
FRC #1684 (The Chimeras)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2010
Location: Lapeer,MI
Posts: 10
Chimera0x694 is just really niceChimera0x694 is just really niceChimera0x694 is just really niceChimera0x694 is just really nice
Re: Values for Image Proccessing

Code:
                //                                   RED    GREEN   BLUE
                if (BlueAlliance) {
//                    greenStuff = image.thresholdRGB(0,140, 240,255, 0,255);
                    greenStuff = image.thresholdRGB(0,140, 200,255, 0,255);
                } else {
                    greenStuff = image.thresholdRGB(100,200, 225,255, 100,200);  // this was sorta OK
                }
This was our thresholding code, and the lighting truly did effect the values. we found this out when our auto targeting would work perfectly at our build facility, and then not work at competitions. we found that at the competitions, the thresholds were drastically different.
__________________

"How do you pronounce your name?"
We get asked this question a lot. Or, We are called "chi-mare-ahs" Or, "chI-mare-ahs"
To set the record straight, It's pronounced "kI-mare-ahs"

2011-
Ranked 172nd in the state of Michigan
2012-
Ranked 24th in the state of Michigan
Kettering University District-Quality Award
Reply With Quote
  #23   Spotlight this post!  
Unread 19-01-2013, 10:48
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: Values for Image Proccessing

I was asking about build versus competition values. Is that the commented code change?

Also, do you know if the exposure and white balance were set to auto or not?

The commented code change is actually not that big a change. It is basically saying that the green lower limit needed to change by 20%.

Do you have any images used to do the calibration?

Greg McKaskle
Reply With Quote
  #24   Spotlight this post!  
Unread 19-01-2013, 10:58
Chimera0x694's Avatar
Chimera0x694 Chimera0x694 is offline
Registered User
AKA: Kelly Malone
FRC #1684 (The Chimeras)
Team Role: Programmer
 
Join Date: Dec 2012
Rookie Year: 2010
Location: Lapeer,MI
Posts: 10
Chimera0x694 is just really niceChimera0x694 is just really niceChimera0x694 is just really niceChimera0x694 is just really nice
Re: Values for Image Proccessing

Yes i think it is what the commented code is, what I meant by the values drastically changing was that the results changed. the robot went from snapping directly to the target with a push of a button to jumping around and not staying still because it couldn't see the target properly. I don't remember changing anything else, so the exposure and white balance must have been set to default. we used a false color image for the robot to parse, filtering everything but the colors within the threshold.
__________________

"How do you pronounce your name?"
We get asked this question a lot. Or, We are called "chi-mare-ahs" Or, "chI-mare-ahs"
To set the record straight, It's pronounced "kI-mare-ahs"

2011-
Ranked 172nd in the state of Michigan
2012-
Ranked 24th in the state of Michigan
Kettering University District-Quality Award
Reply With Quote
  #25   Spotlight this post!  
Unread 19-01-2013, 12:54
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: Values for Image Proccessing

The default settings of the camera are automatic exposure and automatic white balance. These will give more variability than if you calibrate and keep the settings constant. I'd love to be able to set them from code or configuration, but the camera doesn't have full support for that. I think that you may want to experiment with calibration, as discussed in the white paper and then test the results in the shop, outside, perhaps with some work lights or bright flashlights shining on the targets or the robot. No vision system is immune to lighting changes, not even your eyes, but knowing what will break it and what won't is pretty good stuff.

Greg McKaskle
Reply With Quote
  #26   Spotlight this post!  
Unread 19-01-2013, 17:30
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
Re: Values for Image Proccessing

Quote:
Originally Posted by Patrick Chiang View Post
Yeah it's our first year doing image processing too.
We also had some problems with the provided sample code (java) detecting distance, so we're in the process of writing our own distance computing method.
What I did last year was just look at the apparent size of a vertical side of the target, and then compare that to the actual size. It's simple to figure out range from that proportion.

I did have to correct the reported values, but I'd recommend just getting the first part of what I said outputting values, then do some empirical testing, plot the values in excel (computed distance v actual) and then generating a trend line. The equation of that line should correct your calculated distances pretty well.
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 11:19.

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