jp2class_degrade.m~

来自「This document is intended to serve as an」· M~ 代码 · 共 22 行

M~
22
字号
function [I_new] = jp2_degrade(Isrc, comp_ratio, bit_depth)% Original jp2k compression/decompression function%% Attention: a) no rounding operation; it should be performed beforehand%            b) returns uint32 matrix; convert it to double for further processing%% See also:%    jp2_codec, TestJP2, MakePlainImagex_size = size(Isrc,2);y_size = size(Isrc,1);I_cropped = int16(Isrc);header_size_in_bytes = 0;                                                           % for large images, it is not importanttarget_size = round(header_size_in_bytes + (x_size * y_size * bit_depth) / (comp_ratio * 8));     % 8 for bytes instead of bits[comp_data] = jp2_class(MakePlainImage(I_cropped), target_size, int(bit_depth));[decoded] = jp2_class(comp_data, 0, 0);I_new = MakePlainImage(decoded);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?