I'm going by your C# example. I created a project and a form with 2 buttons. The first button does
if (!rr.connect("localhost"))
{
Console.WriteLine("Could not connect to localhost!");
return;
}
Dimension d = rr.getDimension();
if (d != null)
{
Console.WriteLine("Dimension " + d.width + "x" + d.height);
}
and it returns the dimensions.
The second button does;
byte[] image = new byte[1280 * 960];
// ensure that the camera is on and processing images
rr.setCamera("on");
rr.run("on");
// execute a RGB filter on the loaded image
rr.execute("<head><version>1.50</version></head><RGB_Filter><min_value>40</min_value><channel>3</channel></RGB_Filter>");
// get the current processed image from RoboRealm and save as a PPM
Dimension d = rr.getImage(image, 1280 * 960);
if (d != null)
{
rr.savePPM("c:\\temp\\test.ppm", image, d.width, d.height);
}
// get the current source image from RoboRealm and save as a PPM
d = rr.getImage("source", image, 1280 * 960);
if (d != null)
{
rr.savePPM("c:\\temp\\test2.ppm", image, d.width, d.height);
}
// turn off live camera
rr.setCamera("off");
I see teh camera come to life and get a picture in roborealm. There are 2 ppm files in c\temp, but if I try to open them in roborealm I get "could not read image from disk"
Did I do somethign wrong?
Ringo
|
|