# OpenCV for Processing -- Extracting Histogram Data

**URL:** <https://discourse.processing.org/t/opencv-for-processing-extracting-histogram-data/993>\
**Category:** Processing\
**Created:** [June 15, 2018, 3:29pm UTC](https://discourse.processing.org/t/opencv-for-processing-extracting-histogram-data/993 "2018-06-15T15:29:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshc6464](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@joshc6464](https://discourse.processing.org/u/joshc6464)\
**Post date:** [June 15, 2018, 3:29pm UTC](https://discourse.processing.org/t/opencv-for-processing-extracting-histogram-data/993/1 "2018-06-15T15:29:23Z")

</div>

Hello all,

New to OpenCV for processing and I am looking to extract the data from the bins of a histogram once I have used the findHistogram method. I have seen this functionality in the actual Java OpenCV, but I cannot find any documentation regarding this for the OpenCV library for processing.

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [June 16, 2018, 5:32pm UTC](https://discourse.processing.org/t/opencv-for-processing-extracting-histogram-data/993/2 "2018-06-16T17:32:44Z")

</div>

If you look at the source code for the Histogram class :

> <https://github.com/atduskgreg/opencv-processing/blob/master/src/gab/opencv/Histogram.java>

You see that you can access to the data by writing :

```auto
Histogram hist;

for(int i=0;i<hist.getMat().height();i++){
    println(hist.getMat().get(i,0)[0]);
}

```
