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...