Reply by jim May 30, 20082008-05-30

huhua wrote:
> > "jim" <"sjedgingN0sp"@m@mwt.net> wrote in message > news:1212070084_3372@isp.n... > > > > > > huhua wrote: > >> > >> "bharat pathak" <bharat@arithos.com> wrote in message > >> news:x-ydnb2qdvrRjKPVnZ2dnUVZ_srinZ2d@giganews.com... > >> > matlab has a function called dct2 > >> > use it. > >> > > >> > bharat pathak > >> > > >> > arithos designs > >> > www.Arithos.com > >> > > >> > >> Do I need to cut the 100 x 100 image into 8x8 first? > > > > If you want to go from 100X100 to 10X10 you need to make each DCT > > transform 10X10 (instead of 8X8). Then when you have 100 transforms > > results with 100 frequency elements in each. Then you need iterate thru > > the 100 elements in each by discarding and quantizing some or all. Usually > > the scheme for doing that affects the higher frequencies the most the > > lower frequencies less and usually leaves the DC element alone). That is > > the lossy part. After that you get data reduction by standard data > > compression techniques which are usually lossless. > > In other words, if you do the quantization and/or discarding part as > > just zeroing bits you will after doing that have the same size data as the > > original (with a lot of bits zeroed). If you then run that data thru a > > typical compression scheme (e.g. zip it) you will get much greater data > > reduction than just compressing the original. Or you can create your own > > compression scheme based on your knowledge of where the data is dense and > > where it is sparse. > > To reverse the process you would uncompress (e.g. unzip) and then do the > > inverse transform. > > > > -jim > > > > Is it possible to run 2D DCT on my 100x100 image directly and select the > top-left panel (approx. 10x100) which are the dominating ones and neglect > the rest?
I don't know what problem you are trying to solve so it's difficult make suggestions on how to perfect your solution. If you are just trying to develop a compression algorithm, You shouldn't need to worry about where the image has the most information. Areas that are blank won't take up much storage space once it is compressed. -jim ----== Posted via Pronews.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.pronews.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= - Total Privacy via Encryption =---
Reply by Jerry Avins May 30, 20082008-05-30
huhua wrote:
> "jim" <"sjedgingN0sp"@m@mwt.net> wrote in message > news:1212070084_3372@isp.n... >> >> huhua wrote: >>> "bharat pathak" <bharat@arithos.com> wrote in message >>> news:x-ydnb2qdvrRjKPVnZ2dnUVZ_srinZ2d@giganews.com... >>>> matlab has a function called dct2 >>>> use it. >>>> >>>> bharat pathak >>>> >>>> arithos designs >>>> www.Arithos.com >>>> >>> Do I need to cut the 100 x 100 image into 8x8 first? >> If you want to go from 100X100 to 10X10 you need to make each DCT >> transform 10X10 (instead of 8X8). Then when you have 100 transforms >> results with 100 frequency elements in each. Then you need iterate thru >> the 100 elements in each by discarding and quantizing some or all. Usually >> the scheme for doing that affects the higher frequencies the most the >> lower frequencies less and usually leaves the DC element alone). That is >> the lossy part. After that you get data reduction by standard data >> compression techniques which are usually lossless. >> In other words, if you do the quantization and/or discarding part as >> just zeroing bits you will after doing that have the same size data as the >> original (with a lot of bits zeroed). If you then run that data thru a >> typical compression scheme (e.g. zip it) you will get much greater data >> reduction than just compressing the original. Or you can create your own >> compression scheme based on your knowledge of where the data is dense and >> where it is sparse. >> To reverse the process you would uncompress (e.g. unzip) and then do the >> inverse transform. >> >> -jim >> > > Is it possible to run 2D DCT on my 100x100 image directly and select the > top-left panel (approx. 10x100) which are the dominating ones and neglect > the rest?
You will get a result, but it may not be a result you like. Try it. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by huhua May 30, 20082008-05-30
"jim" <"sjedgingN0sp"@m@mwt.net> wrote in message 
news:1212070084_3372@isp.n...
> > > huhua wrote: >> >> "bharat pathak" <bharat@arithos.com> wrote in message >> news:x-ydnb2qdvrRjKPVnZ2dnUVZ_srinZ2d@giganews.com... >> > matlab has a function called dct2 >> > use it. >> > >> > bharat pathak >> > >> > arithos designs >> > www.Arithos.com >> > >> >> Do I need to cut the 100 x 100 image into 8x8 first? > > If you want to go from 100X100 to 10X10 you need to make each DCT > transform 10X10 (instead of 8X8). Then when you have 100 transforms > results with 100 frequency elements in each. Then you need iterate thru > the 100 elements in each by discarding and quantizing some or all. Usually > the scheme for doing that affects the higher frequencies the most the > lower frequencies less and usually leaves the DC element alone). That is > the lossy part. After that you get data reduction by standard data > compression techniques which are usually lossless. > In other words, if you do the quantization and/or discarding part as > just zeroing bits you will after doing that have the same size data as the > original (with a lot of bits zeroed). If you then run that data thru a > typical compression scheme (e.g. zip it) you will get much greater data > reduction than just compressing the original. Or you can create your own > compression scheme based on your knowledge of where the data is dense and > where it is sparse. > To reverse the process you would uncompress (e.g. unzip) and then do the > inverse transform. > > -jim >
Is it possible to run 2D DCT on my 100x100 image directly and select the top-left panel (approx. 10x100) which are the dominating ones and neglect the rest?
Reply by bharat pathak May 29, 20082008-05-29
>Do I need to cut the 100 x 100 image into 8x8 first? I remember in JPEG
we
>do that... but not sure here... Any more elaborated examples for a >real-valued (from 0 to 1) image?
Not needed. example listed: a = rand(100, 100); % will generate 100x100 real random nums from 0 to 1 y = dct2(a); %------------------------ done Bharat Pathak Arithos Designs www.Arithos.com DSP Design Consultancy and Training Company.
Reply by jim May 29, 20082008-05-29

huhua wrote:
> > "bharat pathak" <bharat@arithos.com> wrote in message > news:x-ydnb2qdvrRjKPVnZ2dnUVZ_srinZ2d@giganews.com... > > matlab has a function called dct2 > > use it. > > > > bharat pathak > > > > arithos designs > > www.Arithos.com > > > > Do I need to cut the 100 x 100 image into 8x8 first?
If you want to go from 100X100 to 10X10 you need to make each DCT transform 10X10 (instead of 8X8). Then when you have 100 transforms results with 100 frequency elements in each. Then you need iterate thru the 100 elements in each by discarding and quantizing some or all. Usually the scheme for doing that affects the higher frequencies the most the lower frequencies less and usually leaves the DC element alone). That is the lossy part. After that you get data reduction by standard data compression techniques which are usually lossless. In other words, if you do the quantization and/or discarding part as just zeroing bits you will after doing that have the same size data as the original (with a lot of bits zeroed). If you then run that data thru a typical compression scheme (e.g. zip it) you will get much greater data reduction than just compressing the original. Or you can create your own compression scheme based on your knowledge of where the data is dense and where it is sparse. To reverse the process you would uncompress (e.g. unzip) and then do the inverse transform. -jim < I remember in JPEG we
> do that... but not sure here... Any more elaborated examples for a > real-valued (from 0 to 1) image? > > Thanks!
----== Posted via Pronews.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.pronews.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= - Total Privacy via Encryption =---
Reply by rajesh May 29, 20082008-05-29
On May 29, 11:33 am, "huhua" <lunamoonm...@gmail.com> wrote:
> "SteveSmith" <Steve.Smi...@SpectrumSDI.com> wrote in message > > news:Iu2dnbg7Lb0VX6DVnZ2dnUVZ_r3inZ2d@giganews.com... > > > Is this simply for data compression, or are you trying to extract key > > parameters from the original data set? > > > If for data compression, is a lossy algorithm OK, or do you need it to be > > lossless? > > I hope the majority of info/energy is concentrated in the 100 "essential" > elements after transform. > > So lossy is okay. DCT should be enough for me, I guess. Because my 100x100 > image has really very obvious pattern in it.
DCT based compression(as in JPEG,MPEG) is used when the images are of nature generated, meant for human viewing bcoz higher frequencies are not present in naturally generated image and also cannot be percieved by human visual system. What kind of data is your image holding and whoom it is meant for ? If its just a very obvious pattern doesnt mean you can ignore higher frequencies. You can also look for KLT bases compression for obvious patterns. ignore higher frequencies.
> > For example, I hope the 100 "essential" elements will keep 99% of the > energy/info of the original image, so I am willing to do the truncation and > approximation!
Reply by huhua May 29, 20082008-05-29
"bharat pathak" <bharat@arithos.com> wrote in message 
news:x-ydnb2qdvrRjKPVnZ2dnUVZ_srinZ2d@giganews.com...
> matlab has a function called dct2 > use it. > > bharat pathak > > arithos designs > www.Arithos.com >
Do I need to cut the 100 x 100 image into 8x8 first? I remember in JPEG we do that... but not sure here... Any more elaborated examples for a real-valued (from 0 to 1) image? Thanks!
Reply by huhua May 29, 20082008-05-29
"SteveSmith" <Steve.Smith1@SpectrumSDI.com> wrote in message 
news:Iu2dnbg7Lb0VX6DVnZ2dnUVZ_r3inZ2d@giganews.com...
> Is this simply for data compression, or are you trying to extract key > parameters from the original data set? > > If for data compression, is a lossy algorithm OK, or do you need it to be > lossless? > >
I hope the majority of info/energy is concentrated in the 100 "essential" elements after transform. So lossy is okay. DCT should be enough for me, I guess. Because my 100x100 image has really very obvious pattern in it. For example, I hope the 100 "essential" elements will keep 99% of the energy/info of the original image, so I am willing to do the truncation and approximation!
Reply by bharat pathak May 28, 20082008-05-28
matlab has a function called dct2
use it.

bharat pathak

arithos designs
www.Arithos.com
Reply by SteveSmith May 28, 20082008-05-28
Is this simply for data compression, or are you trying to extract key
parameters from the original data set?   

If for data compression, is a lossy algorithm OK, or do you need it to be
lossless?