What is the best way to solve the issue of encountering division by zero when normalizing an image?
<p>What is the best way to solve the issue of encountering division by zero when normalizing an image?</p>

<p>Currently, what I am doing now is to replace the nan values with zero. Is there a proper way to do this? Will replacing by zero affect the result of normalization?</p>