# why pixels values are unaltered even though after applying double?

조회 수: 1 (최근 30일)
gayathri rajkumar 2018년 1월 11일
댓글: Walter Roberson 2018년 1월 11일
when i have applied double to my image the pixel values are not changing they are not coming in the range [0,1]?

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

### 채택된 답변

Walter Roberson 2018년 1월 11일
You need im2double for that.
##### 댓글 수: 2없음 표시없음 숨기기
gayathri rajkumar 2018년 1월 11일
thank u but whats the difference between im2double and double?
Walter Roberson 2018년 1월 11일
double() applied to an integer converts to the double precision number with the same signed magnitude as the integer. For example A = uint8(17); B = double(A); then afterwards B would be 17.0 -- same numeric value.
im2double() applied to an integer converts to the double precision number with the same relative value for the purposes of images. Images in MATLAB can be represented by uint8, uint16, int16, single, or double. For uint8 and uint16, the values are understood to designate fractions compared to the maximum value of that integer class, so for A = uint8(17); then in an image, A would be interpreted as designating 17/255 of maximum intensity, and im2double() would convert it to 17.0/255.0 = approximately 0.0667 . uint16(17) would represent 17/65535 of maximum intensity and im2double() would convert it to 17.0/65535.0.

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

### 카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by