Faster histogram then histcounts
Show older comments
Does anyone know faster method, which create histogram data then histcounts? Function must include cases when some values are outside edges and when bins are empty.
Answers (1)
Image Analyst
on 23 Jan 2016
0 votes
How many data points do you need, and how are you going to use the histogram counts? If you have lots of data (tens of millions of points) and just need to do something like figure out a threshold or skewness or something, then you could most likely get the same result by analyzing just a subsample of your data, like the first tenth of it or some fraction. Would that work for you?
6 Comments
AnnaG
on 23 Jan 2016
Image Analyst
on 23 Jan 2016
If it's a small amount of data, just try taking the histogram yourself manually with a for loop. Also, define "many" - is that 10 million times, or a billion times, or more?
AnnaG
on 23 Jan 2016
Image Analyst
on 24 Jan 2016
Why do you need to do it 1000 times on each frame? The histogram won't change on one specific frame.
You still haven't said why my subsampling idea won't work. I think it should.
AnnaG
on 24 Jan 2016
Image Analyst
on 24 Jan 2016
You can use blockproc() to get the histogram if you want to move along and do it for rectangles that cover the entire picture. If you want just a few irregularly-shaped regions then you'll have to do it "manually" using mask(s) for those regions.
You might try subsampling in the time dimension. Usually a frame of video is highly correlated with the previous and next several frames because the scene doesn't change much. So you can just take every nth frame.
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!