From: "Vasco M" <kingjew@hotmail.com>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webx
Newsgroups: comp.soft-sys.matlab
Subject: Re: Image compression in Matlab
Message-ID: <eed822e.45@webx.raydaftYaTP>
Date: Wed, 2 Mar 2005 14:24:46 -0500
References: <wf077lebijgw@legacy> <et9f1l615syn@legacy> <eed822e.42@webx.raydaftYaTP> <eed822e.43@webx.raydaftYaTP> <eed822e.44@webx.raydaftYaTP>
Lines: 73
NNTP-Posting-Host: 64.136.49.226
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:264342



What I meant was, the test was successful. Here I passed each face of
the 3D matrix through "DCT". I'm displaying the compressed image.
It's all blur, nothing much to look at. Then I used "IDCT" to get the
original image back. Try it.

function t6

% Get the image here: <http://www.codeofkings.com/Julius.jpg>

[x,map] = imread('julius.jpg');
size(x)
x2 = x;
figure(1)
colormap(map)
image(x)
a = dct(x(:,:,1));
b = dct(x(:,:,2));
c = dct(x(:,:,3));
x2(:,:,1) = a;
x2(:,:,2) = b;
x2(:,:,3) = c;
size(x2)
figure(2)
colormap(map)
image(x2)

x2(:,:,1) = idct(a);
x2(:,:,2) = idct(b);
x2(:,:,3) = idct(c);
figure(3)
colormap(map)
image(x)

return;

zed wrote:
>
>
> But is this really working or is it just a test?
>
> Vasco M wrote:
>>
>>
>> I did a test:
>>
>> [x,map] = imread('julius.jpg');
>>>> size(x)
>>
>> ans =
>>
>> 77 65 3
>>
>>>> d = dct(x);
>> ??? In an assignment A(matrix,:) = B, the number of columns
in
> A
>> and B
>> must be the same.
>>
>> Error in ==> C:\MATLAB6p5\toolbox\signal\signal\dct.m
>> On line 61 ==> y(1:n,:) = aa;
>>
>>>> d = dct(x(:,:,1)); % You need to extract the individual
> faces
>> from the 3D matrix. x(:,:,1), x(:,:,2), x(:,:,3)
>>
>>>>> Hi,
>>>> I need matlab code for a function that splits an image
> into
>> 8x8
>>> blocks ?
>>> If anybody can help it's am emergency thanks
>>>>