回复: [求助]怎样取8*8块?
以下是pseudo code,个人看法,仅供参考.
assume A(i,j) is the image, B(m,n) is the block for memory saving, then
for i from 1 to 32
for j from 1 to 32
for m from 1 to 8
for n from 1 to 8
B(m,n) = A(m+(i-1)*32,n+(j-1)*32)
....(any further process you want)
end
end
end
end
当然 要考虑先按行还是,先按列,做compression的话,取法有很多种,做tracking或者recognition基本这样一行一行取应该没有什么问题;另外,由于有四层循环,要看你自己进一步的处理的复杂度,综合考虑总的运行效率;还有其它的写法,主要看array的indexing methods;提醒:这样得到的B是一个2-D的,不知道你的意图,所以,一旦重新给B赋值,B原先的值就被覆盖了。
Thx for reading.
(缩进出了写问题)
|