600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > matlab读raw图像数据解析

matlab读raw图像数据解析

时间:2021-01-26 05:58:31

相关推荐

matlab读raw图像数据解析

这里写自定义目录标题

matlab读raw图像数据解析

matlab读raw图像数据解析

function img = read_raw(name, type, num) c_path = 'F:\xxx\test\';switch type case 'd64'file_name = [ c_path, name, '_', type, '_', num2str(num,'%04d'), '.raw'];fid = fopen(file_name, 'rb');src_img = fread(fid, 'double');img = double(reshape(src_img, 1280,1024)'); fclose(fid); case 'f32'file_name = [ c_path, name, '_', type, '_', num2str(num,'%04d'), '.raw'];fid = fopen(file_name, 'rb');src_img = fread(fid, 'single');img = double(reshape(src_img, 1280,1024)'); fclose(fid); case 'u16'file_name = [ c_path, name, '_', type, '_', num2str(num,'%04d'), '.raw'];fid = fopen(file_name, 'rb');src_img = fread(fid, 'uint16');img = double(reshape(src_img, 1280,1024)'); fclose(fid); case 'u8'file_name = [ c_path, name, '_', type, '_', num2str(num,'%04d'), '.raw'];fid = fopen(file_name, 'rb');src_img = fread(fid, 'uint8');img = double(reshape(src_img, 1280,1024)'); fclose(fid); otherwisewarning('Unexpected plot type. No plot created.')endendfk=100img = read_raw('c_prnu', 'u16', fk);%%读取文件 F:\xxx\test\c_prnu_u16_0100.raw的数据.imshow(img,[])

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。