Twinkal
Twinkal

Reputation: 424

Matlab code understanding

I have a matlab code in which an image is subtracted with its min value and then divided by its maximum value.

Why do we do that?

It looks like this:

I1 = I1 - min(I1(:));
I1 = I1 / max(I1(:));

Upvotes: 1

Views: 220

Answers (1)

Leeor
Leeor

Reputation: 637

It is a common task in image processing to compare different images. For example, consider two photos of an object taken under different illumination conditions. In order to compare the images, we would like to normalize the images so that pixel values share a common scale.

Upvotes: 2

Related Questions