Australia
Asked
Resolved Resolved by Dunning-Kruger!

Camera Object Name

How do I reset or clear the last object detected by the camera? The $CameraObjectName variable stays set to the last object detected. This means even when no object is detected or recognised, my script executes incorrectly - instead of saying object not recognised..


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

Unlock the true power of automation and robotics by becoming a proud subscriber of Synthiam ARC Pro.

#1  

I believe it is just a global variable so maybe you can just "zero" it out after detection?...

$object = $CameraObjectName 


$CameraObjectName  = ""
PRO
Synthiam
#2  

Don’t reset the variable. Instead check if there’s a detection. Then check the tracking type that’s detected, if there’s more than one tracking type.

PRO
Synthiam
#3  

Such as...

User-inserted image

User-inserted image


if (CameraIsTracking == true && CameraTrackingType == "Object") {

  print(getVar("$CameraObjectName"));
}

PRO
Australia
#4  

I didn't realise one could change these global variables within script. Setting their value to null after tracking ends solved my problem. Thanks.