loading
 
Issues with processing duration and misc questions
Joshua Robertson from Canada  [11 posts]
1 year
Question 1:


vs


These times have been obtained from running in API mode.

Here we can see that in the first image the duration it takes for us to get a response back from RoboRealm is quite large. One of my questions is that, in the second image, are the times on the right hand  side an accurate depiction of how long RoboRealm took to process the image and obtain the X_COORD/Y_COORD that I am retrieving back?

If those are accurate as too how long it takes to process the image, what would cause the API to take such a long time to respond back via socket on localhost with this information once requested using GetVariable()?


Question 2:



What do the integer values represent that we get back from calling WaitImageFor(n)?


Question 3:

In API mode I am able to pass in an image and it gets processed and returns my X/Y coords as expected based on my pattern match.

When I switch to DLL mode it is not functioning the same way as it does in API mode.
I trigger my camera and take an image. I then take bitmap that is provided from the camera and send it to RoboRealm using SetBitmap, it is not setting the bitmap to the source and is returning me the information for an image that was previously supplied.

Why is it when I switch to DLL mode this functionality seems to disappear?


Question 4:

Is there any other documentation that is more detailed than what is provided on the website?


If there are any questions you have for me, or require more explaining please let me know and I will provide any information you need in order for me to be able to work past these issues.
Steven Gentner from United States  [261 posts] 1 year
Josh,

Q1: Can I assume that you are using the COM object in 32 bit mode? The times in the display are accurate which means that something is causing a delay in the API access. What is the sequence of API calls that you are doing to check this timing? We can try to replicate and see where the delay might be.

Keep in mind that there will be some delay (although it should be less than what you've been seeing) using the API. If there is a high speed need you may instead want to look into writing a plugin which has much more direct interface into RR and runs at a much higher speed within the pipeline. The API is largely asynchronous so requests coming in via the API may need to wait a bit for the current image to finish processing before returning. That adds a couple ms but not as much as what you've been seeing.

Q2: The return values in WaitImageFor are always VARIANT_TRUE if an image is ready WITHIN the time period specified. It will be VARIANT_FALSE if the timeout triggers or some other error is generated (failed network connection, app not running, etc.)

Q3: The API version is also not waiting by default but probably takes a bit longer to execute which is why it seems it might be. Typically after a SetBitmap one would use a WaitImage which would ensure that the image is updated and processed at least once before querying values. A quick example on what you are doing might help us to further understand the difference. The API and DLL version are very similar but the speed of execution will be different which is why you will see somewhat different behaviors.

Q4: The best online document and questions answered in the forum are the most detailed documentation. There are always particulars that come up just due to the way people use the system ... so its best to post these specific questions with references to code segments that you are using. Some languages will just react differently in unexpected ways ... so its not really possible to document all those cases since we are often not aware they even exist!

STeven.


Steven Gentner from United States  [261 posts] 1 year
With some further testing, it occurred to me to ask if you are keeping the connection open during the loop iteration or are closing and opening it? I.e. if you run the following using cscript test.vbs where test.vbs has


set rr=CreateObject("RoboRealm.API.1")

rr.Startup()

for i = 0 to 100

WScript.Echo Timer & ":" & rr.GetVariable("IMAGE_COUNT")

rr.WaitImage

next

rr.Disconnect()

what output do you see? I get

61473.01:4124
61473.02:4125
61473.04:4126
61473.05:4127
61473.07:4128
61473.08:4129
...

which averages to about 15 ms per image. (running a 60fps camera)

Thanks,
STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index