reading pixels from y frame (yuv frame) using fread()?
hi..i would like to know to read pixels and later store the pixel values in arrays..do i use fread()? if yes how? this is a part of my code..please reply ASAP...thank you
.
.
. Code:
fseek(vidf, 0L, SEEK_SET); //same as rewind(vidf)
//initialize array
for(k=0;k<256;k++){
inityHist[k]=0;
}
fseek(vidf,(54+4*256),SEEK_SET);
for(rowpixels=0;rowpixels<height;rowpixels++){
for(colpixels=0; colpixels<width; colpixels++){
fread(ttemp, sizeof(char), 1, vidf);
grayscaleV = *ttemp;
inityHist[grayscaleV] = inityHist[grayscaleV] + 1; //to check the ocurences of pixel
totalPixels++;
}
}
.
.
.