Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Matrix ex2(Image myimage){
- Matrix hist=MatAlloc(Int,1,256);
- unsigned char **myI=ImGetI(myimage);
- int **m=MatGetInt(hist);
- for(int i=0;i<256;i++)
- {m[0][i]=0;}
- for(int i=0; i<ImNbRow(myimage);i++){
- for(int j=0;j<ImNbCol(myimage);j++){
- m[0][myI[i][j]]++;
- }
- for(int i=0;i<256;i++){
- printf("%2d %d \n",i,m[0][i]);
- }
- }
- MatWriteAsc(hist,"chenille-hist.mx");
- ImWrite(Hist2Im(hist,ImNbRow(myimage)),"eiloj.pgm");
- return(hist);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement