读raw数据

image_path= ‘DoubleByte_ave.raw’ ;
image_width=1600;
image_height=1200;
fid=fopen(image_path,‘r’);
image = fread( fid, ‘uint8=>uint16’);
image_raw = image(1:2:end) + image(2:2:end)*256;
image = reshape(image_raw, image_width, image_height)’;

% image2 = uint8(image/4);
image_rgb = demosaic((image), ‘rggb’);
figure(4),imshow(uint8(image_rgb/4));
image_red = image_rgb(:,:,1);
image_green = image_rgb(:,:,2);
image_blue = image_rgb(:,:,3);

image_rgb2 = demosaic((image), ‘bggr’);
figure(5),imshow(uint8(image_rgb2/4));

image_rgb3 = demosaic((image), ‘grbg’);
figure(6),imshow(uint8(image_rgb3/4));
image,[3480000X1]
在这里插入图片描述

image,[3480000,1]
在这里插入图片描述
在这里插入图片描述
image_raw [1920000,1]
在这里插入图片描述
在这里插入图片描述
image [1200,1600]

/
clc;
clear;
image_path= ‘S5KJN1_Fullsize_64.raw’ ;
image_width=8160;
image_height=6144;
fid=fopen(image_path,‘r’);
image_raw = fread( fid, ‘uint8=>uint16’);

image_raw = image_raw(1:2:end) + image_raw(2:2:end)*256;
image_raw = reshape(image_raw, image_width, image_height)’;

filename = ‘Copy_of_S5KJN1_Fullsize_64.raw’;
f=fopen(filename,‘r’);
row = 6144;
col = 8160;
image=fread(f,[col,row],‘uint16’);
image=image’;

figure(1),imshow(uint8(image/4)), title(‘iamge’);
figure(2),imshow(uint8(image_raw/4)), title(‘iamge_raw’);
/
两种方法结果一样

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值