View Single Post
  #2   Spotlight this post!  
Unread 02-03-2012, 11:37 AM
dominique dominique is offline
Registered User
FTC #0211 (MK211)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Rochester,NY
Posts: 9
dominique is an unknown quantity at this point
Re: Standalone image analysis.

Ok - I will reply to myself as it may help others.
1- I downloaded and installed smartDashboard on my laptop (has a built-in camera).
2- In Netbeans, I created the following (from New Project but no Main Class - in other words it is a class - bot a package).
Quote:
import edu.wpi.first.smartdashboard.camera.WPICameraExten sion;
import edu.wpi.first.wpijavacv.WPIColorImage;
import edu.wpi.first.wpijavacv.WPIImage;

public class BasicCameraExtension extends WPICameraExtension {
@Override
public WPIImage processImage(WPIColorImage rawImage) {
return rawImage.getRedChannel();
}
}
3- Right click on project - select properties and add the following jar to the libraries (Compile):
Quote:
C:\Program Files\SmartDashboard\extension\WPICameraExtension. jar
C:\Program Files\SmartDashboard\SmartDashboard.jar
C:\Program Files\SmartDashboard\extension\WPICameraExtension. jar
This should solve the problems with the imports.

4- Right click on the project and select BUILD
5- Copy the resulting jar file from folder NetBeansProjects\projectname\dist
to folder C:\Program Files\SmartDashboard\extensions (next to WPICameraExtension.jar)
6- Double click on C:\Program Files\SmartDashboard\SmartDashboard.jar, the smartdashboard should launch. Click on View\Add and select the class name of your program : BasicCameraExtension in this example.

You should see the red channel of the image taken by the laptop camera since this is what is returned.

Now...from this how to do image analysis is another story...

Last edited by dominique : 02-03-2012 at 01:24 PM.
Reply With Quote