diff --git a/Java-Sample-TensorFlow-Object-Detection-Op-Mode.md b/Java-Sample-TensorFlow-Object-Detection-Op-Mode.md
index e957cd4..399cb46 100644
--- a/Java-Sample-TensorFlow-Object-Detection-Op-Mode.md
+++ b/Java-Sample-TensorFlow-Object-Detection-Op-Mode.md
@@ -187,11 +187,42 @@ If the list is empty (i.e., if no objects were detected) the op mode sends a tel
If the list is not empty, then the op mode iterates through the list and calls a function "displayInfo" to display information via telemetry about each detected object.
### Modifying the Sample Op Mode to display Target Zone
-Let's modify the sample Blocks Op Mode so it will indicate which target zone the robot should drive to. Using the Blocks editor, modify the conditional clause for an empty list (i.e., no targets detected) so that a telemetry message indicating that zone A should be targeted by the robot (see screenshot below).
+Let's modify the sample Blocks Op Mode so it will indicate which target zone the robot should drive to. Using the Blocks editor, add a conditional clause for an empty list (i.e., no targets detected) so that a telemetry message indicating that zone A should be targeted by the robot.
-
[[/images/Blocks-Sample-TensorFlow-Object-Detection-Op-Mode/targetZoneA.png]]
If the list is empty indicate target zone A.
+```
+ // getUpdatedRecognitions() will return null if no new information is available since
+ // the last time that call was made.
+ List updatedRecognitions = tfod.getUpdatedRecognitions();
+ if (updatedRecognitions != null) {
+ telemetry.addData("# Object Detected", updatedRecognitions.size());
-Also, use the Blocks editor to modify the function "displayInfo" to check the labels of the recognized object. If the label reads "Single" then send a telemetry message to indicate target zone B. If the label reads "Quad" then send a telemetry message to indicate target zone C. If the label is neither "Single" or "Quad" send a telemetry message indicating that the target zone is unknown.
+ // step through the list of recognitions and display boundary info.
+ int i = 0;
+ for (Recognition recognition : updatedRecognitions) {
+ telemetry.addData(String.format("label (%d)", i), recognition.getLabel());
+ telemetry.addData(String.format(" left,top (%d)", i), "%.03f , %.03f",
+ recognition.getLeft(), recognition.getTop());
+ telemetry.addData(String.format(" right,bottom (%d)", i), "%.03f , %.03f",
+ recognition.getRight(), recognition.getBottom());
+
+ // display target zone based on this object.
+ if(recognition.getLabel().equals("Single")) {
+ telemetry.addData("Target Zone", "B");
+ } else if ((recognition.getLabel().equals("Quad"))) {
+ telemetry.addData("Target Zone", "C");
+ } else {
+ telemetry.addData("Target Zone", "UNKNOWN");
+ }
+ }
+ telemetry.update();
+ } else {
+ // updatedRecognitions is null (no objects recognized).
+ telemetry.addData("TFOD", "No items detected.");
+ telemetry.addData("Target Zone", "A");
+ telemetry.update();
+ }
+```
+Also, when an object is detected, check its label to see which target zone is associated with that object. If the label reads "Single" then send a telemetry message to indicate target zone B. If the label reads "Quad" then send a telemetry message to indicate target zone C. If the label is neither "Single" or "Quad" send a telemetry message indicating that the target zone is unknown.
Note that in this example, since the op mode iterates through the list of recognized objects, the target zone will be displayed for each recognized object in the list.