LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

using IMAQ functions

Dear Users,

 

I use CVI/2013 together with NiVision library.

For an image I use imaqHistogram to get the histogram parameters from the image.

 

The image is indeed of type Image and not an array that contains the image-pixel values.

 

Now I want to display the histogram.

How can I easely do this?

My aim would be to display the histogram into a EditGraph of a Panel.

 

I found a example for using CVI-native function "Histogram".

With this I can define a "x_array" and "y_array".

With this I can use PlotXY();

 

However using the "imagHistogram"-function I am struggling to find out the "x_array"and "y_array"

 

Thank you,

Philipp

 

0 Kudos
Message 1 of 2
(2,571 Views)

..think i found the solution:

 

// in h.file

int x_array[BitDepth];

int y_array[BitDepth];

HistogramReport * Hist;

 

// in c-file

Hist = imaqHistogram(....necessary entries....);

 

// creating x-array

for(i=0; i < BitDepth; i++)

       x_array[i] = i;

 

// creating y_array

for(i=Hist->min; i < = Hist->max ; i++)

       y_array[i] = Hist->histogram[i];

 

panelHandleHist = LoadPanel (0, "my.uir",PANEL_HIST);

DisplayPanel(panelHandleHist);

PlotXY(panelHandleHist, PANEL_HIST_GRAPH, x_array, y_array, ... );

 

 

0 Kudos
Message 2 of 2
(2,549 Views)