📄 jp2class_degrade.m
字号:
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, bit_depth +1);[decoded] = jp2_class(comp_data, 0, 0);I_new = MakePlainImage(decoded);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -