Hello, im using opencv for lazarus from this repository
https://github.com/t-edson/LazarusOpenCV.
I'm trying to calculate the histogram of an image but cant understand how to use this functions
This is what im trying to do but fails, if anyone have some examples in how to use histograms too would be really usefull.
procedure TForm1.MenuItem3Click(Sender: TObject);
type
iArray = array of integer;
iMatrix = array of iArray;
pArray = ^iArray;
var
Range: iArray;
Ranges: iMatrix;
pRanges: ^iMatrix;
histSize: PInteger;
histogram: pCvHistogram;
bmp: TBitmap;
begin
New(histSize);
histSize^:= 256;
SetLength(Range, 2);
SetLength(Ranges, 1);
Range[0]:= 0;
Range[1]:= 256;
Ranges[0]:= Range;
pRanges:= @Ranges;
histogram:= cvCreateHist(1, histSize, CV_HIST_ARRAY, pRanges);
cvCalcHist(pipImage, histogram);
end;