MATLAB Answers


how to normalize an image

Asked by Matlabques
on 14 Nov 2013
Latest activity Answered by Image Analyst
on 14 Nov 2013

I want to normalize an image by dividing the value of each pixel by the square root of the sum of all pixel squares for each image. What will be the code



No products are associated with this question.

1 Answer

Answer by Image Analyst
on 14 Nov 2013
 Accepted answer

It's practically just like how it sounds:

denominator = sqrt(sum(yourImage(:).^2));
outputImage = double(yourImage) / denominator;

I trust you were honest when you didn't tag this as homework, because I'm not supposed to just give you the answer if it was your homework. Mark the answer as Accepted once you verify that the code works.


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!