이미지를 표시하기 위해 이진 이미지 파일을 읽는 python 코드를 구현했습니다. 이미지가 불분명하고 MATLAB에서 비슷한 코드를 구현하는 동안 얻은 것과 같은 것이 없습니다. 두 이미지를 여기에 첨부했습니다 : (img obtained using python; Original img using matlab code). 나는 또한 참조를 위해 MATLAB 코드를 첨부이진 파일 이미지가 파이썬 코드 구현시 명확한 이미지로 변환되지 않습니다
import numpy as np
from matplotlib import pylab as plt
from scipy import misc
A = np.fromfile('/home/shruthi/Desktop/1485999630.bin', dtype='int16', sep="")
A = A.reshape([1216, 1216])
imgplot = plt.imshow(A)
imgplot.set_cmap('gray')
plt.show()
:
file= fid = fopen('1486445720.bin');
HDR = reshape(fread(fid,1216*1216,'uint16'),1216,1216);
fclose(fid);
HRGB = demosaic(uint32(HDR'),'rggb'); % Valid for Matlab 2016 and make sense only if HDR is double
RGB = tonemap(double(HRGB), 'AdjustLightness', [0.1 1],'AdjustSaturation', 8);
1485999630.bin 파일을 어떻게 생성 했습니까? –
.bin 파일은 skycameras에서 수신 한 출력 데이터입니다. 이 데이터는 내가 액세스 할 수있는 서버로 직접 전송됩니다. 나는 이것을 똑똑한 이미지로 번역하고 싶다. –