Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Fast Histograms without Vision

I tested Sys_BuildHisto(1).vi

I am suprised because I get a mean value of 18 ms for the 8 bit image to be histogrammed, with d=2, and with d=4 6 ms.

So times 3 (for the 3 colors), I get a speed of 54 ms for d=2 and 18 ms for d=4
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 11 of 19
(2,387 Views)
word!

I think the nested for loop, indexing pixels, is the most efficient way to do it.
0 Kudos
Message 12 of 19
(2,385 Views)
Hi here is the optimized version of your VI by Machine Vision.

Optimized Image decoding for 24 bit images.

Optimized Histogram computation. Note that if I run the 3 histo processes in parallel on my PC I get 200 ms total time
while if I run one after the other I get a total time of 20 ms ... I already noticed this but nobody was ever able to explaim me why I have this strange thing when I run parrallel loops

So now there is a total time of 50 ms on my PC, so I am sure you can do better on yours.

Cheers
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 13 of 19
(2,385 Views)
Just tried your code.  It does not look like the histogram is correct.
0 Kudos
Message 14 of 19
(2,382 Views)
I am surprised because I compared the images extracted by the 2 methods and they where identical.

The computation of the histogram is based on your implementation which seems correct... where is the difference comming from ?

Cheers
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 15 of 19
(2,362 Views)
Sorry, the histogram was a U8 type, so it could only stack up to 255 points. I modified it to U32, now you can put a very large picture... and it seems to work fine if I compare it to the results of Vision Assistant.

Cheers
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 16 of 19
(2,362 Views)
Ok, in my first code, a few pieces of code were taking too long.  I optimized it for indexing image arrays, pixel by pixel.   I am posting my system version subVI.  There's some saturation indicators in this code also.  I am able to achieve full 3 channel histograms (with grayscale channel outputs) at 7.5fps on my 1.4Mpixel image with only decimating by 3.  If I compute the histogram on the entire image (no decimation), then I can get 1.5fps which is pretty fast in my opinion.  I am also attaching a screenshot of my software so you guys can see what outputs I am getting in real-time.  It's strange, when I use the performance monitor, my performance goes down significantly, so I'm not sure of the actual subVI execution times, but it looks like it runs in about 100ms with a decimation of 3 (and I know decimation may not be the correct term for this).
0 Kudos
Message 17 of 19
(2,354 Views)
did you used the VI I posted ?

Cheers
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 18 of 19
(2,352 Views)
no, I did not as I need to be able to adjust the decimation factor in real-time.  I am happy with the speeds of my solution.
0 Kudos
Message 19 of 19
(2,348 Views)