Re: I am Puzzled! How come my JPEG algorithm doesnt work?
- From: "fulltime" <PiaoChieh@xxxxxxxxx>
- Date: 24 Dec 2006 12:07:21 -0800
Pete Fraser wrote:
"fulltime" <PiaoChieh@xxxxxxxxx> wrote in message
news:1166981229.821249.217450@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,
I am trying to include an addition step into the basic JPEG algorithm,
but it puzzles me as to why it WUN work. I included an addition step
which i call it as DPM(differential pixel method) tat is it takes the
1st pixel, (0,0) as the reference. The subsequent neighbours will have
their pixel values subtracted from their previous neighbours, eg. 1st
row of the image array is like [40, 55, 60, 75, 50, 10, 40, 80], after
taking the difference as i mentioned above, it becomes, [40, 15(55-40),
5(60-55), 15(75-60), -25(50-75), -30, -40]. This subtraction of
neighbors will proceed with the 1st element of 2nd row(2,1) It will
subtract from the last element of the 1st row(1,8)
After which, i will take the DCT and then quantize it b4 i reordered
the codes via zig zag manner. In short, this is wat i do
Image --> take DPM --> DCT --->, Quantize ----> Encode
Decode --> Un-Qunatize--> IDCT--> take iverse DPM --> Image
However, the image i reconstructed is very unacceptable, any reasons
why isit so? Why cant i take the DCT of the difference btwn the pixels?
In theory, i think it shld work perfectly fine..
Help is needed urgently on this lonely, cold christmas nite... :(
It should work OK, but is probably pointless.
You're trying to do (very) roughly the same thing with the DCT
and the DPM.
As to why it doesn't look good, perhaps there's something wrong
with the way you deal with pixel ranges. You're starting with +ve
values when you're dealing with pixels, but bipolar values when
you're dealing with the deltas.
Pete
p.s. WTF is WUN?
Hi Peter,
WUN == won't... :)
You're starting with +ve==> so do u mean the deltas (DPM) might be causing the prob? taking the
values when you're dealing with pixels, but bipolar values when
you're dealing with the deltas.
-ve pixel value might be hazardous to the DCT o/p? i am trying to see
if this algo will actually cut down on the bandwidth of the
transmission...
I been debugging my code, but i just cant see whats wrong with the
codes... If i perform normal JPEG, it works perfectly fine, but when i
include DPM, the image sucks big time...
just to check w u, after imread() the image, i convert from RGB to
YCbCr, after which, i perform the necessary DCT n Quant. Then i decode
n get back the pixels in 8*8 block. So i converted back to RGB and then
i do a uint8 to convert to 8 bit unsigned b4 displaying the image in
imshow(), is this way correct?
thks peter, u been of great help. Merry XMAS to u :p
.
- Follow-Ups:
- Re: I am Puzzled! How come my JPEG algorithm doesnt work?
- From: Pete Fraser
- Re: I am Puzzled! How come my JPEG algorithm doesnt work?
- References:
- I am Puzzled! How come my JPEG algorithm doesnt work?
- From: fulltime
- Re: I am Puzzled! How come my JPEG algorithm doesnt work?
- From: Pete Fraser
- I am Puzzled! How come my JPEG algorithm doesnt work?
- Prev by Date: Re: I am Puzzled! How come my JPEG algorithm doesnt work?
- Next by Date: Re: I am Puzzled! How come my JPEG algorithm doesnt work?
- Previous by thread: Re: I am Puzzled! How come my JPEG algorithm doesnt work?
- Next by thread: Re: I am Puzzled! How come my JPEG algorithm doesnt work?
- Index(es):