Faster histogram then histcounts

5 views (last 30 days)
AnnaG
AnnaG on 23 Jan 2016
Commented: Image Analyst on 24 Jan 2016
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
Image Analyst on 23 Jan 2016
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
AnnaG on 24 Jan 2016
The idea is to crop fragment of the frame, count histogram, compare it with model and move to next section. After I analize whole frame I find maximum similarity with model and mark corresponding place as searched object. Subsampling woudn't work because I crop small fragment of frame which doesn't have so many pixels and I'm afraid I would lose to much data.
Image Analyst
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.

Sign in to comment.

Categories

Find more on Data Distribution Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!