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

조회 수: 1 (최근 30일)
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

채택된 답변

Image Analyst
Image Analyst 2018년 3월 3일
Try this:
negPixels = grayImage < 0;
grayImage(negPixels) = 0; % or 1 or whatever you want.
  댓글 수: 3

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by