@@ -4,8 +4,8 @@ Vision Processor Initialization
44Processor Initialization - Overview
55-----------------------------------
66
7- Your OpMode must **first prepare ** for using AprilTag and/or TensorFlow Object
8- Detection (TFOD) commands, or methods.
7+ Your OpMode must **first prepare ** for using AprilTag and/or
8+ Color Processing commands, or methods.
99
1010In the INIT portion of your Java or Blocks code, before ``waitForStart() ``, use
1111these steps:
@@ -18,11 +18,11 @@ these steps:
1818
1919- **Step 2. ** *Required: *
2020
21- - Create the **AprilTag Processor ** (or the **TFOD
21+ - Create the **AprilTag Processor ** (or the **Color Locator or Color Sensor
2222 Processor **), to analyze frames streaming in from the camera. "Under the
2323 hood", the Apriltag Processor is attached to an EOCV **pipeline **, which
2424 performs various steps, in order, to each stream frame. The stream is the
25- input to the pipeline. A similar process happens for TFOD .
25+ input to the pipeline. A similar process happens for Color Processing .
2626
2727- **Step 3. ** *Required: *
2828
@@ -141,106 +141,15 @@ Here the object ``myAprilTagProcessorBuilder`` was not created; the build was
141141performed directly on ``myAprilTagProcessor ``. The Builder pattern allows the
142142"dot" methods to be chained in a single Java statement ending with ``.build() ``.
143143
144- TensorFlow Initialization - Easy
145- --------------------------------
144+ Color Processing Initialization
145+ -------------------------------
146146
147- **Step 2 ** is similar for creating the **TensorFlow TFOD Processor **, software
147+ **Step 2 ** is similar for creating the **Color Sensor/Locator Processor **, software
148148that evaluates frames streaming in from the camera.
149149
150- The SDK provides an "easy" way to create the processor, using only **defaults **
151- and not mentioning a "Builder":
152-
153- .. tab-set ::
154- .. tab-item :: Blocks
155- :sync: blocks
156-
157- .. figure :: images/040-TFOD-Processor-easy.png
158- :width: 75%
159- :align: center
160- :alt: Easy TFOD Initialization
161-
162- Easy TensorFlow TFOD Processor Initialization without a Builder
163-
164- .. tab-item :: Java
165- :sync: java
166-
167- Example of TensorFlow TFOD Processor Initialization without a Builder
168-
169- .. code-block :: java
170-
171- TfodProcessor myTfodProcessor;
172- // Create the TensorFlow Object Detection processor and assign it to a variable.
173- myTfodProcessor = TfodProcessor . easyCreateWithDefaults();
174-
175-
176- TensorFlow Initialization - Builder
177- -----------------------------------
178-
179- The SDK also provides the "Builder" way to create the processor, allowing
180- **custom settings **.
181-
182- **Builder ** is a Java pattern or structure for adding features or parameters,
183- finalized with the ``.build() `` command. Such features are **not ** modified
184- later during an OpMode.
185-
186- *Inside the SDK, even the "easy" process uses the Builder pattern to set the default parameters. *
187-
188- .. tab-set ::
189- .. tab-item :: Blocks
190- :sync: blocks
191-
192- .. figure :: images/050-TFOD-Processor-builder.png
193- :width: 75%
194- :align: center
195- :alt: TFOD Initialization with Builder
196-
197- TensorFlow TFOD Processor Initialization with a Builder
198-
199- .. tab-item :: Java
200- :sync: java
201-
202- .. code-block :: java
203-
204- TfodProcessor . Builder myTfodProcessorBuilder;
205- TfodProcessor myTfodProcessor;
206-
207- // Create a new TFOD Processor Builder object.
208- myTfodProcessorBuilder = new TfodProcessor .Builder ();
209-
210- // Optional: set other custom features of the TFOD Processor (4 are shown here).
211- myTfodProcessorBuilder. setMaxNumRecognitions(10 ); // Max. number of recognitions the network will return
212- myTfodProcessorBuilder. setUseObjectTracker(true ); // Whether to use the object tracker
213- myTfodProcessorBuilder. setTrackerMaxOverlap((float ) 0.2 ); // Max. % of box overlapped by another box at recognition time
214- myTfodProcessorBuilder. setTrackerMinSize(16 ); // Min. size of object that the object tracker will track
215-
216- // Create a TFOD Processor by calling build()
217- myTfodProcessor = myTfodProcessorBuilder. build();
218-
219- This example shows only 4 TFOD Processor Builder features; others are
220- available. Most others relate to custom TFOD Models, beyond this scope of this
221- VisionPortal Guide.
222-
223- TensorFlow Java Builder Chain
224- -----------------------------
225-
226- The Builder pattern can be implemented in a streamlined manner, using Java. The following code is equivalent to the above individual method calls.
227-
228- Comments are omitted here, to clearly illustrate the chaining.
229-
230- .. code-block :: java
231-
232- TfodProcessor myTfodProcessor;
233-
234- myTfodProcessor = new TfodProcessor .Builder ()
235- .setMaxNumRecognitions(10 )
236- .setUseObjectTracker(true )
237- .setTrackerMaxOverlap((float ) 0.2 )
238- .setTrackerMinSize(16 )
239- .build();
240-
241- Here the object ``myTfodProcessorBuilder `` was not created; the build was
242- performed directly on ``myTfodProcessor ``. The Builder pattern allows the "dot"
243- methods to be chained in a single Java statement ending with ``.build() ``.
150+ The Builder is going to look a little different depending on if you are using
151+ the **Color Sensor ** or the **Color Locator **. For more information, see the
152+ :doc: `Color Processing Documentation </color_processing/index >`.
244153
245154Enabling and Disabling Processors
246155---------------------------------
0 commit comments