## 2 Materials and Methods
### Vision Module Development
#### 2.6.1 Hardware and Software Development  
Table 2 summarizes the list and function of the hardware components used to develop the vision module. NVIDIA Jetson Nano with 4 GB RAM was used to perform inferencing on 1280 \(\times\) 720 at 30 _fps_ video from a USB webcam (Logitech StreamCam Plus). Powering the whole system is a power adapter that outputs 5 VDC at 4A.  
Table 3 summarizes the software packages used to develop the software framework of the vision module. The software for the vision module was written in Python 2.7. The detectnet object class of Jetson Inference Application Programming Interface (API) was used to develop the major components of the software framework. Detectnet object facilitated connecting to the webcam using gstream, optimizing the PyTorch-based SSD MobileNetV1 model into TensorRT, loading the model, performing inferences on the video stream from the webcam, image processing for drawing bounding boxes onto the processed frame, and displaying the frame. OpenCV is an open-source computer vision library focused on real-time applications. It was used to display the calculated speed of the vision module and convert the detectnet image format from red-green-blue-alpha (RGBA) to blue-green-red (BGR), which was the format needed by ROS for image transmission.  
To enable modularity, the software framework, as illustrated in Figure 5, was also implemented using ROS version Melodic Morenia, which was the version that was compatible with Ubuntu 18.04. A node is a virtual representation of a component that can send or receive messages directly from other nodes. The vision module or node required two inputs: (1) RGB video stream from a video capture device and (2) TensorRT-optimized SSD MobileNetV1 object detection model. It calculates and outputs four parameters, namely: (1) weed coordinates, (2) crop coordinates, (3) processed images, and (4) total delay time. Each parameter was published into its respective topics. Table 4 summarizes the datatype and the function of these outputs.  
\begin{table}
\begin{tabular}{c c c} \hline
**Hardware** & **Model** & **Function** \\ \hline Webcam & Logitech StreamCam Plus & Realtime video capture \\ Vision Compute Unit & NVIDIA Jetson Nano 4 GB & Image inferencing \\ Communication Bus & USB 3.0 & Communication with USB devices \\ Power Adapter & 5 VDC 4A Power Adapter & Supplies power to the vision compute unit \\ \hline \end{tabular}
\end{table}
Table 2: Summary of vision module hardware.  
\begin{table}
\begin{tabular}{c c} \hline
**Software Package** & **Function** \\ \hline NVIDIA Jetson Inference API & Facilitates camera connection, training of object detection model, converting to TensorRT, loading of object detection model, inferencing, and image processing \\ Python & General programming language to implement the algorithms \\ OpenCV & Image processing \\ Robot Operating System (ROS) & Image data, plant coordinate, and processing time transmission \\ Ubuntu 18.04 ARM & The operating system for Jetson Nano and hosts the other software packages \\ \hline \end{tabular}
\end{table}
Table 3: Summary of vision module software.