image processing in c
i'm unable to read an jpeg image in c ... i had written the following code ...
#include<stdio.h>
main()
{ int mat[101][100];
FILE *fp,*fo,*fl;
int n,init,i,j,k;
char ch=0;
fp= fopen("
fo=fopen(
// this a routine to read the pixel values of len.jpg and write into file f1 i.e., pix.c. pix.c will contain the pixel values after executing the program.
for( n=0;n<101;n++)
{
for( k=0;k<100;k++)
{
fprintf(fl,"%d ",mat[n][k]);
}
}
// this a routine to write the pixel values from pix.c. origin.png will contain the constructed image from pixel values in pix.c
for( n=0;n<101;n++)
{
for( k=0;k<100;k++)
fprintf(
}
fclose(fp);
fclose(fo);
fclose(fl);
}
wen i executed the above code i got the entirely different image other than the original one(len.jpg)
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- mycae
- Solved:
- Last query:
- Last reply: