音频分析
计算RGB文件的熵
#include<stdio.h>
#include<malloc.h>
#include<string.h>
#include<math.h>
int main(){
FILE *fp;
int shape = 256*256;
int size = shape *3;
int count[3][256];
double percent[3][256];
double H[3];
int i,j;
unsigned char * img = (unsigned char *) malloc(size);
fp = fopen("./test.rgb", "r");
fread(img, 1, size, fp);
for(i=0;i<256;i++){
for(j=0;j<3;j++) count[j][i] = 0;
}
for(j=0;j<3;j++){
for(i=0;i<shape;i++){
unsigned char px = img[i*3 + j];