Hi, how can i scale the image data to 0 and 1
조회 수: 6 (최근 30일)
이전 댓글 표시
채택된 답변
Jan
2017년 3월 29일
편집: Stephen23
2017년 3월 29일
If you divide an uint8, you get an uint8. Therefore either convert the matrix to double at first:
gray_d = double(gray) / 255;
But for productive work and if you have the image processing toolbox, use Thorsten's suggestion. im2double checks the type of the input and considers, if the input is a uint16 or double already.
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!