From 4fe84ede5a4b65644779b8b3b96067db9eaf90b1 Mon Sep 17 00:00:00 2001 From: FTC Engineering Date: Fri, 23 Oct 2020 21:41:17 -0400 Subject: [PATCH] Updated Blocks Sample TensorFlow Object Detection Op Mode (markdown) --- Blocks-Sample-TensorFlow-Object-Detection-Op-Mode.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode.md b/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode.md index d605bf7..11a6853 100644 --- a/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode.md +++ b/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode.md @@ -52,10 +52,9 @@ If a zoom factor has been set, then the Camera Stream preview on the Driver Stat

[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/magnifiedArea.png]]
Camera stream preview indicating magnified area (at a distance of about 4 feet or 1.2 meters).

### Iterating and Processing List of Recognized Objects +The Op Mode will then iterate until a Stop command is received and it will check with the object detector to see how many objects it recognizes in its field of view. In the screenshot below, the variable "recognitions" is set to a list of objects that were recognized using the TensorFlow technology. -The Op Mode will then check with the object detector to see how many objects it recognizes in its field of view. In the screenshot below, the variable "recognitions" is set to a list of objects that were recognized using the TensorFlow technology. The Op Mode adds a telemetry message to indicate on the Driver Station how many objects were detected in the camera's field of view. - -


Get a list of recognized objects from TensorFlow.

+

[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/whileLoop.png]]
The op mode gets a list of recognized objects with each iteration of the while loop.

If the number of detected objects equals three (i.e., if three Minerals are in the camera's field of view) then the Op Mode will loop through the list of recognized objects and look at the label for each recognized object. If an object has a label that indicates it's a Gold Mineral, then the "Left" coordinate value of its bounding box will be assigned to the variable "goldMineralX". Similarly, if the other two objects in the list have labels that indicate that they are Silver Minerals, then their Left coordinate values will be assigned to the variables "silverMineral1X" and "silverMineral2X".