how to encode and decode negative pixel to positive pixel in matlab ?

2 visualizaciones (últimos 30 días)
hi, I want to ask. I have 512x512 image and I want to calculate the entropy. But, it has some error because the pixel contains negative value. Has anybody in here know how to do Matlab code to convert negative pixel to positive pixel and decode it back? please help me

Respuesta aceptada

Image Analyst
Image Analyst el 3 de Mzo. de 2018
Try this:
negPixels = grayImage < 0;
grayImage(negPixels) = 0; % or 1 or whatever you want.
  3 comentarios

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Import, Export, and Conversion en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by