Histograms
摘要
This chapter provides a comprehensive introduction to the concept, computation, and applications of histograms in image processing and related disciplines. The chapter explains how histograms quantify the frequency of intensity values, discusses their limitations—such as the lack of spatial information—and highlights their role in detecting issues like poor lighting, underexposure, and low contrast. It then explores fundamental concepts such as illumination effects, contrast properties, and image dynamics, illustrating how each influences image quality. The text introduces the cumulative histogram, emphasizing its use in contrast enhancement and histogram equalization. Practical implementation using Python and OpenCV demonstrates how to calculate and visualize histograms programmatically. Further sections describe how pixel-level operations—such as brightness adjustment, inversion, and binarization—alter the histogram’s shape, linking theory with practical effects on image quality. Finally, the chapter details automatic contrast enhancement, including robust methods that ignore extreme pixel values using percentage thresholds, a technique commonly applied in professional software like Photoshop. Overall, this chapter bridges mathematical foundations, practical computation, and real-world applications, underscoring histograms as indispensable tools for image analysis.