Enable real-time object vision training using scripts
+ How To Add This Control To Your Project (Click to Expand)
- Make sure you have the latest version of ARC installed.
- Select the Get button in this page to download the archive file.
- Double click the downloaded archive file to execute installer.
- The installer will add this control to ARC.
- Load ARC and press the Project -> Add Control button from the menu.
- Choose the Camera category tab.
- Press the Train Vision Object By Script icon to add the control to your project.
In order to train objects to the camera device, the Train Object menu is used in the camera device skill. This menu normally requires human intervention to enter the object name and use the mouse. This skill allows your robot to learn objects in real-time triggered by ControlCommand() scripts programmatically. Take a look at the Cheat Sheet within the Script skill settings to see what ControlCommand() this skill accepts.
1. Beginning Learning Button
This button will attach/detach the camera configured in the camera device skill to the program with pictures skill window.
2. Attach/Detach Camera Button
This button will attach/detach the camera configured in the camera device skill to the Train Vision Object by Script skill window.
3. Train Status Bar
This will show the object training process time remaining. During this time move the object around to train it at different angles.
4. Status Display
This field will display the status and name of the learned object and any errors that occur.
How To Use the Train Vision Object by Script Skill
1) Add a camera device skill (Project -> Add Skill -> Camera -> Camera Device).
2) Connect to a camera.
3) Add this skill (Project -> Add skill -> Camera -> Train Vision Object by Script).
4) Press the ATTACH button. This will attach this skill to the camera device skill. You will now see a mirror of the camera's video stream in this skill.
5) Center the onscreen pink box on the object that will be trained. Have the object fill up the pink box completely. Press the BEGIN LEARNING button, then physically move the object around during the training process to get multiple angles.
6) Wait until the Train Status bar has completed and make note of the object name in the Status display so that you can use it in your scripts.
Here's an script sample that learns an object titled DJ FACE via ez-script:
# Check if the camera is active. If not, exit the script and notify user
say("The camera is not active")
# This is the name of the object that will be stored
$LearnedObject = "DJ FACE"
# Attach to the camera for the control
ControlCommand("Train Vision Object By Script", Attach)
# Introduce verbally out of the PC speaker what it is about to happen
SayWait("Prepare to learn " + $LearnedObject + ". 3, 2, 1, learning")
# Instruct the skill to begin learning
ControlCommand("Train Vision Object By Script", Learn, $LearnedObject)
# Wait until the skill has completed learning the object
WaitFor($CameraIsLearning == 0)
# Speak what the object has been learned
Say("I have learned " + $LearnedObject)
# Enable object tracking in the camera control
You can also download the project here: trainobjectplugintest.EZB