## 3 Experiment
### Cell Detection Algorithm  
The cell detection algorithm is designed to process and analyze images for identifying and counting cells, and its implementation is outlined both through a flowchart and pseudocode. While both representations describe the same core process, the flowchart provides a high-level visual overview, and the pseudocode offers a detailed step-by-step breakdown of the algorithm's operations. The flowchart shown in Figure 4 begins with image acquisition, where relevant images are listed, filtered, and loaded into the system, ensuring that only necessary data are processed. The algorithm then proceeds to the pre-processing phase, where the focus is  
Figure 3: An image captured from a 96-well plate. (**a**) shows the entire well, providing a view of the overall infected cell distribution. (**b**) is a zoomed-in portion of the well, offering a closer look at the virus arrangement. (**c**) presents a cropped section from the zoomed image, highlighting the detailed structure of individual virus for enhanced visualization. on enhancing image quality and isolating regions of interest (ROI). Here, the image is decomposed into RGB channels, with the B channel being selected to capture the color range most representative of the cells. This step is followed by applying a mean filter to reduce noise and subtracting the mean to enhance contrast and highlight significant features for further analysis. Next is the Dynamic Thresholding stage, which plays a critical role in distinguishing between foreground (potential cells) and background pixels. A dynamic threshold is calculated based on the local image characteristics, enabling the algorithm to classify pixels as either part of the cell (foreground) or background [34]. The post-processing phase involves morphological operations, such as opening, which removes small noise while preserving larger structures. Regions are connected to form coherent cell shapes, and shape selection is applied based on area, isolating likely cells for further analysis. In the final steps, the algorithm enters the cell counting phase, quantifying cells based on predefined criteria, and then moves into data storage, where image names and cell counts are systematically stored for easy retrieval. The pseudocode in Algorithm 1 for the cell detection algorithm outlines a structured approach to process images and gather relevant data. The algorithm begins by reading  
Figure 4: Flowchart illustrating the steps of the cell detection algorithm. and filtering images, enhancing important features through preprocessing techniques to improve accuracy. It then focuses on isolating specific color channels for optimal cell identification and applies noise reduction and thresholding to distinguish cell regions from the background. Morphological operations are used to refine these regions, ensuring that only relevant cells are counted. Finally, the algorithm compiles the results' image names and cell count into a structured JSON file, streamlining data storage and retrieval for further analysis. ```
1 Input: directory \(\leftarrow\) {path to image directory}
2 Input: supportedExtensions \(\leftarrow\) {list of supported image file extensions}
3 Output: jsonFile \(\leftarrow\) {file containing image names and normal cell counts}
4 imageFiles \(\leftarrow\) {d\({}_{1}\),..., d\({}_{n}\)} \(\leftarrow\) ListFilesInDirectory(directory)
5 imageFiles \(\leftarrow\) FilterFiles(imageFiles, supportedExtensions)
6 totalData \(\leftarrow\) {empty dictionary}
7 fori = 1 to!imageFiles!