LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating a light intensity histogram

I'm using a (B&W) USB Camera to capture images, of which I wish to analyse the light intensity. I allow the user to draw a rectangular ROI, which is then converted to a rectangle to be used with the "Light Meter Rectangle" VI. I then wish to integrate the histogram produced by this VI. However, I'm a little stuck. Which type of integration should I use? What should the value for dt be? It's a while since I've done any calculus and the fundamentals are lost to me a little. Also, at a more basic level, is this possible? Will the VIs I'm using produce a integral which I can then plot against time to give a quantitative value for pixel intensity of the ROI selected by the user?

 

Thanks in advance,

 

David

0 Kudos
Message 1 of 8
(3,589 Views)

dt will be the bin width of the histogram.

 

Felix 

0 Kudos
Message 2 of 8
(3,583 Views)
Ok, but which method of integration should I use? And how do I calculate the bin width?
0 Kudos
Message 3 of 8
(3,570 Views)

There is a numeric integration somewhere under math.

But lets go for the math behind. Think about the integral as the area below each bar of your histogram. You just sum up the bars along the x-axis. Then you will have n*dt for each bar/bin where n is the number of points in that bin and dt the width of the bin.

 

Example

1..2: 3 values

2..3: 11 values

3..4: 2 values

 

so dt is 1.

 

The integral will be the pairs

2, 3

3, 14

4, 16

 

Pretty simple numerics... (As for numeric stuff the Integral becomes the Sum, numeric integration is a big word for basic math)

 

Felix

0 Kudos
Message 4 of 8
(3,563 Views)
You can find a nice writeup on numerical integration at the Numerical Recipes website.  Note that a simple sum may work in your case, depending on your accuracy requirements.
0 Kudos
Message 5 of 8
(3,531 Views)

Hi David,

 

I have been looking into your issue for you and my first question is, are you aware of the Light Meter Example VI in LabVIEW which can be found at Help>>Find Examples>>Toolkits and Modules>>Vision>>Functions. I think this should be particularly useful for you if you have not seen it.

 

Hope this helps, if you have any further questions don't hesitate to contact me.

 

Best Regards,

 

Christian Hartshorne

Applications Engineer

National Instruments

0 Kudos
Message 6 of 8
(3,526 Views)

Hi guys,

 

Thanks for the help, however I'm still stuck. I guess I'm struggling to get my head around this somewhat due to the fact that the "histogram" doesn't look to me like a histogram.

 

I've looked at the Light Meter Example VI but I'm afraid it's not really helped me to get my head around the VI. Any more explanation would be greatly appreciated.

 

David

0 Kudos
Message 7 of 8
(3,499 Views)

Hi David 

 

I've looked into this and have found an example that should help you out. The Histogram example located in a LabView operates in a similar way to the application you described in your original post. The example is briefly detailed in the following link:

 

http://zone.ni.com/devzone/cda/epd/p/id/5677 

 

The example itself can be located in the Find Examples >> Toolkits and Modules >> Vision >> Functions. The histogram in this example displays the distribution of the pixels over each grey scale level.

 

Have a look through this example and post again if you have any more questions.

 

Regards,

Jas.W  

 

 

Jason W.
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 8 of 8
(3,462 Views)