Weird output while finding entropy of frames of a video in opencv
#include <cv.h> #include <highgui.h> #include <iostream> #include <cmath> #include <cstdlib> #include <fstream> using namespace std; typedef struct histBundle { double rCh[256]; double gCh[256]; double bCh[256]; }bundleForHist; bundleForHist getHistFromImage (IplImage* img, int numBins) { float range[] = { 0, numBins }; float *ranges[] = { range }; bundleForHist bfh; CvHistogram *hist = cvCreateHist (1, &numBins, CV_HIST_ARRAY, ranges, 1); cvClearHist (hist); IplImage* imgRed = cvCreateImage(cvGetSize(img), 8, 1); IplImage* imgGreen = cvCreateImage(cvGetSize(img), 8, 1); IplImage* imgBlue =