## 3 Experiment
### Virus Detection Algorithm  
The virus detection flowchart in Figure 5 proceeds with HSV Conversion and Thresholding, where the RGB image is transformed into the HSV color space. This conversion simplifies the detection of color-based regions, particularly focusing on the yellow regions that indicate infected areas. The pre-processing steps, similar to those used in the cell counting algorithm, involve listing and filtering image files, generating the region of interest (ROI), and decomposing the image into RGB channels. To isolate the infected regions, thresholds are applied to both the H (Hue) and V (Value) channels, specifically targeting yellow hues associated with infection. The resulting regions are then refined by intersecting the thresholded areas, excluding non-relevant regions and noise to ensure only potential infected areas remain. In the infected cell identification phase, additional operations are applied to enhance the detected regions. A closing operation is used to smooth the boundaries of these regions and eliminate small gaps or holes. The domain is further reduced on the B (Blue) channel to focus the analysis on the yellow regions, which represent infected cells. A mean filter is applied to the B channel, followed by subtracting the mean to enhance contrast, making it easier to distinguish infected areas from background noise. The Dynamic Thresholding step is critical in classifying pixels based on intensity. A calculated threshold differentiates between the foreground (infected areas) and the background (non-infected areas). Pixels with intensity above the threshold are classified as part of the foreground, signaling infection, while those below are classified as background, refining the detection process. In the post-processing stage, the algorithm cleans up detected regions using an opening operation to remove small noise or artifacts that might have been incorrectly identified as infected cells. The regions are then connected to form larger, continuous areas, representing infected cells. Based on their size, regions are filtered to exclude those that do not meet the criteria for infected cells. In the final phase, cell counting, the algorithm counts the connected regions identified as infected cells and records these counts along with the corresponding image name. During  
Figure 5: Flowchart illustrating the steps of the Virus detection algorithm. the data storage phase, the image names and infected cell counts are stored in a dictionary for future analysis. A decision point ensures efficient batch processing by checking for any additional images to process. The pseudocode of the virus detection algorithm in Algorithm 2 begins by reading and filtering image files from a specified directory. The RGB image is converted into the HSV color space, where thresholding is applied to both the Hue and Value channels to isolate the yellow regions representing viral infection. After intersecting these thresholded regions to remove noise, morphological operations such as closing and domain reduction are performed to refine the infected areas. The algorithm enhances contrast using mean subtraction, followed by further thresholding and morphological operations to accurately isolate infected regions. Finally, the connected regions are counted as infected cells, and the results--image names and virus-infected cell counts--are stored in a JSON file for easy access.