【发布时间】:2015-05-26 00:52:19
【问题描述】:
我真的不知道它是做什么的。
更具体地说,我正在 Matlab 上进行图像压缩,并提供了如下代码:
X=imread('image1.jpg');
s=size(X); % image1.jpg has size 330 x 220
offset1 = mod(8-mod(s(1),8),8);
offset2 = mod(8-mod(s(2),8),8);
if offset1 ~= 0 || offset2 ~= 0
X(s(1)+offset1, s(2)+offset2, 3) = 0;
end
figure(1)
image(X);
axis image
axis off
试图弄清楚 if 语句的作用,但我不知道 offset1 和 offset2 指的是什么。
【问题讨论】: