Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Values for Image Proccessing (http://www.chiefdelphi.com/forums/showthread.php?t=111531)

inkspell4 01-18-2013 02:45 PM

Values for Image Proccessing
 
Hello,

I'm trying to determine what values to replace the ones in the following line with.

BinaryImage thresholdImage = image.thresholdHSV(60, 100, 90, 255, 20, 255);


Any help would be appreciated.

We have never used vision processing before this year as a team and have decided to go with a green ring light.

Arhowk 01-18-2013 03:02 PM

Re: Values for Image Proccessing
 
Quote:

Originally Posted by inkspell4 (Post 1218036)
Hello,

I'm trying to determine what values to replace the ones in the following line with.

BinaryImage thresholdImage = image.thresholdHSV(60, 100, 90, 255, 20, 255);


Any help would be appreciated.

We have never used vision processing before this year as a team and have decided to go with a green ring light.

right now, this seems to be working pretty good for me

10,60,200,255,200,255

though this is our specific test field and im currently working on a system to adjust for light

inkspell4 01-18-2013 03:17 PM

Re: Values for Image Proccessing
 
How did you determine what values to use for your system?

dvanvoorst 01-18-2013 03:22 PM

Re: Values for Image Proccessing
 
You should use the NI Vision Assistant to experiment with the numbers. You can see the results of the changes immediately on the screen. If you've installed the NI FRC tools on your computer, you should have it.
Start it up, choose "Acquire Image", choose "Axis Camera", fill in the IP info, and click the play button and you'll see your camera feed. If you click the single play button it will take a snapshot. Then click the last icon to "store the acquired image in browser". Then go to the Process Images page, choose the Color Threshold tool, select HSV, and then you can tweak the numbers there and see exactly what it would do to your image.
You can, of course, add multiple processing filters along with the final particle report - exactly the same as you would in your program.
Keep in mind that in Java you don't have access to all the different tools that are shown in the Vision Assistant.

Dale

inkspell4 01-18-2013 05:16 PM

What range of values should i start out with.
We are using a green ring light as mentioned before

inkspell4 01-18-2013 06:36 PM

Is it likely that there will be noise/small particles that stray after the threshold is done.

Joe Ross 01-18-2013 06:44 PM

Re: Values for Image Proccessing
 
Have you read the Vision Processing paper? http://wpilib.screenstepslive.com/s/3120/m/8731

inkspell4 01-18-2013 07:20 PM

Yes i have read the linked document but could not find much info on the threshold values

Greg McKaskle 01-18-2013 10:11 PM

Re: Values for Image Proccessing
 
Quote:

thresholdHSV(60, 100, 90, 255, 20, 255)
These are the numbers for minH, maxH, minS, maxS, minV, and maxV. The best way to determine the numbers is to use your LEDs, your camera settings, and either debug using pixel values in your code, or open it in a tool such as NI Vision Assistant and see what the values are.

Without seeing your images, I'd say you should probably start with maxH higher, say at 125 or so. You should also lower minH from90 to 40 or so. Then work the mins higher and the MaxH higher until you eliminate other particles.

Greg McKaskle

inkspell4 01-18-2013 10:55 PM

Which tool in vision assistant should i use for testing and finding the values

Patrick Chiang 01-18-2013 11:37 PM

Re: Values for Image Proccessing
 
In NI Vision Assistant, load the sample script they give you.

Acquire an image by connecting to your camera and using the Acquire Image button (enter IP and settings).

In the Color Threshold, adjust the values until your goal is red (and nothing else is). Those are your HSV values that you want to put into your program.

inkspell4 01-18-2013 11:40 PM

Quote:

Originally Posted by Patrick Chiang (Post 1218338)
In NI Vision Assistant, load the sample script they give you.

Acquire an image by connecting to your camera and using the Acquire Image button (enter IP and settings).

In the Color Threshold, adjust the values until your goal is red (and nothing else is). Those are your HSV values that you want to put into your program.

I thought you wanted everything but your goal to be red

Patrick Chiang 01-18-2013 11:45 PM

Re: Values for Image Proccessing
 
Quote:

Originally Posted by inkspell4 (Post 1218339)
I thought you wanted everything but your goal to be red

Yeah that's what I thought too at first, but apparently not. The red part is what you want.

Ideally you'd see a border of red around some black (goal hole), then everything else is black. Then, if you go down the steps (beyond the color threshold), you should see the goal get entirely filled in with red, and the small particles get eliminated.

Here: http://wpilib.screenstepslive.com/s/...ng-the-targets
RTFM (Read The FIRST Manual) ;)

inkspell4 01-18-2013 11:53 PM

Oh i get what your saying i was think of it in terms of the preview color when applying the threshold in vision assistant not as the image afterwards

Patrick Chiang 01-18-2013 11:55 PM

Re: Values for Image Proccessing
 
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.


All times are GMT -5. The time now is 08:43 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi