---
title: "Comment by Abhishek Sharma on \"Image Enhancement Using Zero-Memory Point Processing Operations\" | Hashnode"
description: "Great write-up! I had a question regarding the contrast stretching operation you mentioned—are there any specific heuristics or automated techniques you'd recom"
url: "https://hashnode.com/posts/image-enhancement-using-zero-memory-point-processing-operations/682453f70a5c4428e57b3b6a/comment/6824686e4cd6c406ef71966f"
---

[Discussion](https://hashnode.com/posts/image-enhancement-using-zero-memory-point-processing-operations/682453f70a5c4428e57b3b6a)

Comment [Image Enhancement Using Zero-Memory Point Processing Operations](https://hashnode.com/posts/image-enhancement-using-zero-memory-point-processing-operations/682453f70a5c4428e57b3b6a)

[Abhishek Sharma](https://hashnode.com/@abhishek5)

[May 14, 2025](https://hashnode.com/posts/image-enhancement-using-zero-memory-point-processing-operations/682453f70a5c4428e57b3b6a/comment/6824686e4cd6c406ef71966f)

Great write-up! I had a question regarding the contrast stretching operation you mentioned—are there any specific heuristics or automated techniques you'd recommend for selecting the r1, r2, s1, and s2 values in practice, especially when working with varying lighting conditions across a dataset?

[Manjiri C](https://hashnode.com/@itsmanjiric)

[May 14, 2025](https://hashnode.com/posts/image-enhancement-using-zero-memory-point-processing-operations/682453f70a5c4428e57b3b6a/comment/6824686e4cd6c406ef71966f#reply-68246957143d992f5998a21e)

A common approach is to use histogram analysis : for example, setting r1 and r2 to the 5th and 95th percentiles of pixel intensities helps ignore outliers, and mapping those to s1 = 0 and s2 = 255 stretches the contrast effectively. For varying lighting, adaptive methods like CLAHE (Contrast Limited Adaptive Histogram Equalization) can dynamically adjust based on local regions.
