Using double instead of im2double for images?
이전 댓글 표시
I want to convert an input image into floating point, so that interpolation using interp2 will be possible. I want to achieve this without using the Image Processing Toolbox and without the im2double function. So I tried the syntax I=double(I), however, the resulting image looked very different than the original.
Here is a comparison of the resulting images using im2double(I) and double(I) respectively:

What is happening here? It looks like the double(I) code eliminates the higher frequencies from the spectrum of the image:

When I plot double(I) using imagesc instead of imshow I get the right image displayed, but the spectrum is still shrunken.
So, how can I implement what im2double does without using the pre-defined function? Any explanation is greatly appreciated.
채택된 답변
추가 답변 (1개)
Mohammad Anas
2017년 4월 1일
1 개 추천
From your question, I can guess the solution to your problem is very simple. You probably may have to scale back the resulting image by multiplying with a factor of 255 in order to see the same image that would result by using im2double. Hope that helps.
카테고리
도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!