loading

Add to this Thread


Marco from Netherlands 12 days
Hello to anyone who can help me.

I have an (old) roborealm file that I run on images.

Now i would like to start to use the API.

My goal is to have RoboRealm process an image (from file) when available and only do one run/processing on it.

Based on the C# API example I have build:
[code]
// result from some COM object functions
int VARIANT_TRUE = -1;
int VARIANT_FALSE = 0;

RR_COM_APILib.API_Wrapper rr = new API_Wrapper();
rr.SetCOMType(0);

{
    if (rr.Startup() == VARIANT_TRUE)
    {
        rr.Run("off");
        rr.LoadProgram("C:\\run_test.robo");

        //rr.LoadImage("", "C:\\test.jpg");
        rr.LoadImage("", "C:\\test2.bmp");
        
        rr.Run("once");
        
        //rr.WaitImage();

        object nameArray = new object();
        object valueArray;
        int num = rr.GetAllVariables(ref nameArray, out valueArray);
        if (num > 0)
        {
            object[] names = (object[])nameArray;
            object[] values = (object[])valueArray;
            int i;
            for (i = 0; i < num; i++)
                Console.WriteLine(names[i] + "=" + values[i]);
        }

        rr.Disconnect();
        rr.Close();
    }
}
[/code]

This runs fine when using test.jpg, GetAllVariables() returns 109 variable objects.
According to RR runtime is 384ms and 10 blobs are found.

It fails though when I input test2.bmp
GetAllVariables() returns 0 objects.
But RR shows (and also debug output is written to files) all the variable objects.
According to RR runtime is 551ms and 282 blobs are found.

Uncommenting "rr.WaitImage();" doesnt change anything.

My gut feeling tells me "rr.Run("once");"is not a blocking operation.
But "rr.WaitImage();" doesnt change the outcome.

Does anybody have an idea why GetAllVariables() doesnt return anything in this case?
If more information is needed please let me know.

Cheers,
Marco

Pick Avatar
* Question/Comment - Only <b>, <i>, <u> tags are allowed. All others will be escaped.
Use the tags [image1], [image2], etc. to place the images within your question/comment.
Upload Images (.jpg, .png, .gif) < 300K, robofiles (.robo) or Zip files (.zip) < 300K.

If you have any questions/issues about RoboRealm or image processing this is your chance to ask a question. Your question and any responses will be posted to the forum section of the website for others to read and learn from.

Note that any submission will be considered property of RoboRealm. If you do not wish your images to be displayed as part of the RoboRealm site please do not submit those images. Any submission may be removed from the website at the discretion of RoboRealm personnel.