# Advanced Medical Image Segmentation Enhancement:
## 4 Results and Discussion
### Segmentation Results Based on Object Cropping
#### 4.3.3 Comparison of Our Method with Other Image Preprocessing Approaches Based on Histograms  
In our exploration of preprocessing methods, as depicted in Figure 9, traditional histogram equalization (HE) emerges as a straightforward yet robust technique that effectively redistributes pixel intensities to enhance overall contrast. However, its application to medical images reveals inherent drawbacks--notably, the risk of over-amplifying noise and limited adaptability to the diverse characteristics of medical images--thereby constraining its efficacy at preserving critical fine details necessary for medical diagnosis. Adaptive histogram equalization (AHE) addresses some of HE's limitations by introducing local contrast adjustments. While successfully handling variable pixel intensities, AHE brings its own challenges, including the potential for artifacts and an in \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**No.**} & \multirow{2}{*}{**Ground Truth**} & \multirow{2}{*}{**HE**} & \multirow{2}{*}{**PSO Proposed**} & \multicolumn{2}{c}{**Comparison with Other Methods**} \\ \cline{5-6}  & & & & & **Otsu** & **Watershed** & **K-Means** \\ \hline \hline \multirow{2}{*}{1} & \multirow{2}{*}{**Yes**} & \multirow{2}{*}{**Yes**} & \multirow{2}{*}{**Yes**} & \multirow{2}{*}{**Yes**} & \multirow{2}{*}{**Yes**} \\ \cline{5-6}  & & & & & & \\ \hline \hline \multirow{2}{*}{2} & \multirow{2}{*}{**Yes**} & \multirow{2}{*}{**No**} & \multirow{2}{*}{**Yes**} & \multirow{2}{*}{**Yes**} \\ \cline{5-6}  & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of PSO segmentation results with other methods (Otsu, Watershed, and K-Means) on medical images with emphasis on histogram equalization (HE). creased risk of noise amplification in homogenous regions. These limitations constrain the method's suitability for medical image enhancement and prompt a quest for more sophisticated approaches. The evolution continues with contrast-limited adaptive histogram equalization (CLAHE), which improves upon AHE by introducing a clip limit to curb over-amplification. Despite this enhancement, determining an optimal clip limit remains a nuanced task, with artifacts still likely to emerge, especially in large images. Bi-histogram equalization (BBHE) modifies the approach by equalizing two separate histogram parts to mitigate over-amplification issues. However, challenges persist in preserving details within regions exhibiting varying intensity distributions. Cumulative histogram equalization (CHE) is another noteworthy method that dynamically enhances image contrast based on cumu  
Figure 9: Comparison of preprocessing approaches based on histogram analysis with samples of (**a**) lung CT scans and (**b**) chest X-rays. The figure illustrates the outcomes of various histogram-based preprocessing methods, including histogram equalization (HE), adaptive histogram equalization (AHE), contrast-limited adaptive histogram equalization (CLAHE), bi-histogram equalization (BBHE), and quadrants dynamic histogram equalization (QDHE). lative histograms to provide an alternative approach with advantages and limitations. Finally, the quadrants dynamic histogram equalization (QDHE) method dynamically applies histogram equalization to image quadrants and shows promise for localized adaptation. However, meticulous parameter adjustments are essential to circumvent artifacts, and computational costs may rise. This comprehensive analysis underpins our innovative integration of histogram equalization with PSO segmentation with the aim of addressing these challenges and optimizing medical image preprocessing. Table 6 comprehensively evaluates several medical image preprocessing methods applied to lung CT and chest X-ray images. The metrics used for assessment include accuracy, precision, recall, specificity, Dice, and Jaccard. The proposed HE method demonstrates outstanding performance, with a high accuracy of 95.63%. This method effectively enhances lung CT images, providing notable improvements across all evaluated metrics.