Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Extra Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=68)
-   -   paper: Team 341 Vision System Code (http://www.chiefdelphi.com/forums/showthread.php?t=106121)

divixsoft 12-08-2012 22:48

Re: paper: Team 341 Vision System Code
 
I fixed the errors, but I still don't know what the code does.

Thanks,
Dimitri

Jared Russell 24-09-2012 19:00

Re: paper: Team 341 Vision System Code
 
Sorry for the (very) late reply, but it has come to my attention that I erroneously included the default WPIlib vision tutorial sample images in this project (which light the target in red) instead of the green-lit test images we actually used for tuning. I will upload the correct test images when I get onto the right laptop.

Of course, you can also re-tune the color segmentation algorithm to look for red instead of green :)

EDIT: I have uploaded some sample images that should work with the default tuning.

Shawstek 10-01-2013 20:17

Re: paper: Team 341 Vision System Code
 
Thanks for uploading this!

carterh062 14-01-2013 09:21

Re: paper: Team 341 Vision System Code
 
3929 was extremely grateful when you posted this code last year. Thanks for posting this extension to setting it up.

twiggzee 02-02-2013 16:12

Re: paper: Team 341 Vision System Code
 
thanks so much for posting this! just got it up and running and it is amazing!! this is our first year doing vision processing so this will help us alot in getting ready for this years competition.

virtuald 06-02-2013 01:45

Re: paper: Team 341 Vision System Code
 
If anyone is interested, I ported the image processing portion of this code to Python. http://www.chiefdelphi.com/forums/sh...d.php?t=112866

twiggzee 07-02-2013 21:55

Re: paper: Team 341 Vision System Code
 
if it's not too much to ask, could someone please walk me through how to run the code with test images? I put the argument (a string with the path to my test image) in the arguments field of the project properties, run window. but when i run it in netbeans, i get the following errors in the netbeans output window. i guess it is trying the run the smartdashboard somehow, as it is supposed to, but how do I make this work for test images.

ant -f \\\\shs-ms10\\Students\\home\\shs.install\\NetBeansProject s\\OctoVision run
init:
Deleting: \\shs-ms10\Students\home\shs.install\NetBeansProjects\Oc toVision\build\built-jar.properties
deps-jar:
Updating property file: \\shs-ms10\Students\home\shs.install\NetBeansProjects\Oc toVision\build\built-jar.properties
Compiling 1 source file to \\shs-ms10\Students\home\shs.install\NetBeansProjects\Oc toVision\build\classes
compile:
run:
Exception in thread "main" java.lang.NullPointerException
at edu.wpi.first.smartdashboard.gui.DashboardPrefs.ge tInstance(DashboardPrefs.java:43)
at edu.wpi.first.smartdashboard.camera.WPICameraExten sion.<init>(WPICameraExtension.java:103)
at edu.octopirates.smartdashboard.octovision.OctoVisi onWidget.<init>(OctoVisionWidget.java:91)
at edu.octopirates.smartdashboard.octovision.OctoVisi onWidget.main(OctoVisionWidget.java:351)

Jared Russell 08-02-2013 10:50

Re: paper: Team 341 Vision System Code
 
It looks like some of the internal changes to SmartDashboard for 2013 have broken stand-alone operation. Never fear, here is how to fix it:

Add the line:
Code:

DashboardFrame frame = new DashboardFrame(false);
...inside the main method before creating the DaisyCVWidget.

twiggzee 08-02-2013 10:55

Re: paper: Team 341 Vision System Code
 
that worked thanks so much!!

mrklempae 09-03-2013 22:15

Re: paper: Team 341 Vision System Code
 
Based on what I've read here in the comments, this vision tracking system is legendary. We're programming in C++, so obviously the code doesn't work for us. We've never actually tried vision processing before, and don't quite know were to start. Could you please give a brief explanation of how it works? I really appreciate it!

bradubv 10-03-2013 11:18

Re: paper: Team 341 Vision System Code
 
Thanks again to Team 341 for posting this code. It was an inspiration and a great learning opportunity for our programming team. Despite not being able to finish the PID Controller that used the vision code as input we reached the NYC Regional Semifinals.

All the elimination matches at the NYC Regional were played with the SmartDashboards turned off and that put us at somewhat of a disadvantage. I will follow up to see if I can get more details and if any of them are relevant to this thread, I'll post them here. One thing we didn't know going into the competition was that teams using the Java SmartDashboard need to apply the latest C++ language updates. Because we use Java on the robot side that wasn't obvious to us, so we were ignoring the notices about C++ language updates.

RufflesRidge 10-03-2013 12:26

Re: paper: Team 341 Vision System Code
 
Quote:

Originally Posted by bradubv (Post 1245893)
One thing we didn't know going into the competition was that teams using the Java SmartDashboard need to apply the latest C++ language updates. Because we use Java on the robot side that wasn't obvious to us, so we were ignoring the notices about C++ language updates.

This makes no sense. Whoever told you this was wrong. Running the C++ language update on a computer that is not being used to build C++ robot code will do nothing.

bradubv 13-03-2013 20:57

Re: paper: Team 341 Vision System Code
 
Quote:

Originally Posted by bradubv (Post 1245893)
I will follow up to see if I can get more details and if any of them are relevant to this thread, I'll post them here.

The FMS White Paper explains that the default camera settings will result in a bandwidth about twice that allotted. The LabVIEW Dashboard overrides those defaults with more reasonable settings, but if your team uses the Smart Dashboard you have to set the Resolution, FPS and compression settings on your own to make sure you don't go over the bandwidth limit.

Jared Russell 14-03-2013 09:46

Re: paper: Team 341 Vision System Code
 
Changing the default camera settings is the most important thing you can do in order to obtain reliable tracking and stay underneath the bandwidth cap.

In particular, there are six settings to pay attention to:

1) Resolution. The smaller you go, the less bandwidth you use but the fewer pixels you will have on the target. If you make all of the other changes here, you should be able to stay at 640x480.

2) Frames per second. "Unlimited" results in a 25 to 30 fps rate under ideal circumstances. Depending on how you use the camera in a control loop, this may be overkill. Experiment with different caps.

3) White balance. You do NOT want automatic white balance enabled! Failing to do so makes your code more susceptible to being thrown off by background lighting in the arena. All of our Axis cameras have a white balance "hold" setting - use it.

4) Exposure time/priority. You want a very dark image, except for the illuminated regions of the reflective tape. Set the exposure time to something very short. Put the camera in a bright scene (e.g. hold up a white frisbee a foot or two in front of the lens) and then do a "hold" on exposure priority. Experiment with different settings. You want virtually all black except for a very bright reflection off of the tape. This is for two purposes: 1) it makes vision processing much easier (fewer false detections), 2) it conserves bandwidth, since dark areas of the image are very compact after JPEG compression. The camera doesn't know what you are looking for, so it will try to send you the entire scene as well as it can. But if it can't see the "background" very well, you are "tricking" the camera into only giving you the part you need!

5) Compression. As the WPI whitepaper says, this makes a huge difference in bandwidth. Use a minimum of 30, but you may be able to get away with more (we are using 50 this year). Experiment with it.

6) Brightness. You can do a lot of fine tuning of the darkness of the image with the brightness slider.

Jared Russell 27-08-2013 17:32

Re: paper: Team 341 Vision System Code
 
http://www.chiefdelphi.com/forums/sh...82&postcount=5

I posted some detailed explanation about the "magic numbers" in our code in the post above.


All times are GMT -5. The time now is 06:53.

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