sayvortana
sayvortana

Reputation: 825

Analyse features of the connected components with histogram with opencv and c++

I found many example working histogram in opencv, but they are mostly working on images.

For my case, I found each connected components in my image. From these connected components, I calculated their area(); boundingbox(); density(); Thus, I stored value of each features (area, height and density) in each array (arr_area, arr_height, arr_density).

I want to analyse those features in histogram

So I believe histogram can show all these information.

How can I build these histograms in opencv c++? I.e :

Thank

Upvotes: 0

Views: 403

Answers (1)

David Nilosek
David Nilosek

Reputation: 1412

OpenCV might not be the right tool for you to use in order to create and plot histograms. There is a tutorial here which talks about calculating an R,G,B histogram for an image and how to plot that using OpenCV's line function.

There are a number of of simple C++ plotting libraries that you could probably use to build the histograms (if you want to actually plot them).

If you are just looking to get a histogram of a vector of values, then you'll likely have to come up with your own binning function. The concept is fairly simple, and there are a lot of examples out there in googleland.

Upvotes: 1

Related Questions