所以,我用四个量化值量化了一个灰度图像。我试图保持量化图像每一行的第一个像素,并将每个连续的像素替换为其左侧像素的差值。
你如何在matlab中编写代码,有人能从概念上给我解释一下吗?
另外,我担心的是,由于动态范围的量化,图像相对均匀,大部分图像会显示为黑色,不是吗?在我看来,只有过渡区域和边缘在量化值上会有一些差异。
发布于 2011-05-13 09:42:12
为了对左边的像素产生差异,你所要做的就是减去列1,2,3中的像素。从第2,3,4列...
%# create a random image with four values
randomImage = randi(4,[100,90]); %# use different numbers of rows and cols so we know which is which
%# catenate the first column of the image with the difference from the pixel to the left
%# for all pairs of columns in the image
differenceImage = [randomImage(:,1),randomImage(:,1:end-1)-randomImage(:,2:end)];是的,你会看到相当多的均匀的补丁(它们将是灰色的,因为除非你画出差值的绝对值,否则会有一些是负值)。
https://stackoverflow.com/questions/5986384
复制相似问题