Click here to Skip to main content
15,914,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: max number of characters in EDITBOX Pin
Joe Woodbury21-Oct-05 15:55
professionalJoe Woodbury21-Oct-05 15:55 
QuestionMeasurement of Time Difference less than second? Pin
itkid21-Oct-05 11:29
itkid21-Oct-05 11:29 
AnswerRe: Measurement of Time Difference less than second? Pin
Arman S.21-Oct-05 11:46
Arman S.21-Oct-05 11:46 
GeneralRe: Measurement of Time Difference less than second? Pin
itkid21-Oct-05 12:18
itkid21-Oct-05 12:18 
GeneralRe: Measurement of Time Difference less than second? Pin
Indivara21-Oct-05 15:00
professionalIndivara21-Oct-05 15:00 
GeneralRe: Measurement of Time Difference less than second? Pin
Arman S.22-Oct-05 0:53
Arman S.22-Oct-05 0:53 
QuestionPrinting multiple views Pin
BuckBrown21-Oct-05 10:23
BuckBrown21-Oct-05 10:23 
QuestionDiscrete Cosine Transform - Image Processing Pin
Lampros Giampouras21-Oct-05 9:25
Lampros Giampouras21-Oct-05 9:25 
I have this code that doesn't work. I try to convert an image to the frequency domain using dct and then back

numx: width in bytes of the image
numy: height
ppixel[]: the pixels of the image. I use them as a 1-D array.

The code goes like this:
<code>
/********************************Starting the DCT transform**/

double pi = 3.14159265359;
double sum=0;
double *pdct=new double[numx*numy]; //the dct coefficients

for (int xx=0;xx<numx*numy;xx++)
{
sum+=ppixel[xx];
}
pdct[0]=sqrt(1/(numx*numy))*sum; //dct for u=0 (DC)

sum=0; //resetting

for (int u=1;u<numx*numy;u++)
{
for (int x=0;x<numx*numy;x++)
{
sum+=ppixel[x]*cos((pi*(2*x+1)*u)/(2*numx*numy));
}
pdct[u]=sqrt(2/(numx*numy))*sum; //the dct for u!=0 (AC)
}
</code>

My idct code is:

<code>
/********************************Creating the IDCT transform**/

sum=0; //resetting

for (int x=0;x<numx*numy;x++
{
for (int u=1;u<numx*numy;u++)
{
sum+=sqrt(2/(numx*numy))*pdct[u]*cos((pi*(2*x+1)*u)/(2*numx*numy));
}
ppixel[x]=sqrt(1/(numx*numy))*pdct[0]+sum; //the first is for u=0 and the sum for u!=0
}
</code>

Is there somwthing wrong that I don't see? Can anyone help me?

Thanks..

Questionembedded propertysheet in a dialogbar: how to make ON_UPDATE_COMMAND_UI work Pin
kylur21-Oct-05 8:53
kylur21-Oct-05 8:53 
AnswerRe: embedded propertysheet in a dialogbar: how to make ON_UPDATE_COMMAND_UI work Pin
Rage_bla21-Oct-05 10:15
Rage_bla21-Oct-05 10:15 
QuestionTemplates &amp; error C2440 Pin
Rage_bla21-Oct-05 8:12
Rage_bla21-Oct-05 8:12 
AnswerRe: Templates &amp; error C2440 Pin
kylur21-Oct-05 9:11
kylur21-Oct-05 9:11 
GeneralRe: Templates &amp; error C2440 Pin
Rage_bla21-Oct-05 9:57
Rage_bla21-Oct-05 9:57 
GeneralRe: Templates &amp; error C2440 Pin
BadKarma21-Oct-05 12:24
BadKarma21-Oct-05 12:24 
QuestionRe: Templates &amp; error C2440 Pin
Rage_bla21-Oct-05 13:02
Rage_bla21-Oct-05 13:02 
AnswerRe: Templates &amp; error C2440 Pin
BadKarma21-Oct-05 22:30
BadKarma21-Oct-05 22:30 
GeneralRe: Templates &amp; error C2440 Pin
Rage_bla22-Oct-05 4:01
Rage_bla22-Oct-05 4:01 
QuestionSafe Language Pin
Ken Mazaika21-Oct-05 7:47
Ken Mazaika21-Oct-05 7:47 
AnswerRe: Safe Language Pin
Rage_bla21-Oct-05 7:54
Rage_bla21-Oct-05 7:54 
GeneralRe: Safe Language Pin
Ken Mazaika21-Oct-05 8:01
Ken Mazaika21-Oct-05 8:01 
GeneralRe: Safe Language Pin
bugDanny21-Oct-05 8:13
bugDanny21-Oct-05 8:13 
AnswerRe: Safe Language Pin
David Crow21-Oct-05 8:53
David Crow21-Oct-05 8:53 
QuestionPlease help me... (screen shot) Pin
NSoft21-Oct-05 7:33
NSoft21-Oct-05 7:33 
AnswerRe: Please help me... (screen shot) Pin
Rage_bla21-Oct-05 7:49
Rage_bla21-Oct-05 7:49 
AnswerRe: Please help me... (screen shot) Pin
bugDanny21-Oct-05 8:18
bugDanny21-Oct-05 8:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.