# Get color channel data for each blob

**URL:** https://forums.openmv.io/t/get-color-channel-data-for-each-blob/6251
**Category:** OpenMV Boards
**Created:** [August 23, 2021, 7:31am UTC](https://forums.openmv.io/t/get-color-channel-data-for-each-blob/6251 "2021-08-23T07:31:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![darrask](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@darrask](https://forums.openmv.io/u/darrask)
#### Post date: [August 23, 2021, 7:31am UTC](https://forums.openmv.io/t/get-color-channel-data-for-each-blob/6251/1 "2021-08-23T07:31:48Z")

</div>

I am using find\_blobs to detect and log blobs:

> img.find\_blobs([(0, 3), (-3, 3),(-3, 3)],invert = True, merge = True, pixels\_threshold = 100)

Apart from the usual statistics like elongation, number of pixels, etc. I would like to extract statistics about the Lab color channels. I was thinking that I should set the x\_ or y\_hist\_bis\_max to some integer value above 0 but then I do not know how to access that information (I tried calling “histogram()” on the blob, or accessing its blob.x\_histogram() attribute, etc.).

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [August 23, 2021, 4:29pm UTC](https://forums.openmv.io/t/get-color-channel-data-for-each-blob/6251/2 "2021-08-23T16:29:32Z")

</div>

You just do: [image — machine vision — MicroPython 1.15 documentation](https://docs.openmv.io/library/omv.image.html?highlight=histogram#image.image.blob.blob.x_hist_bins)

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [August 23, 2021, 4:30pm UTC](https://forums.openmv.io/t/get-color-channel-data-for-each-blob/6251/3 "2021-08-23T16:30:00Z")

</div>

The histogram is a list of integers.

---

<div class="post-metadata">

### Author: ![darrask](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@darrask](https://forums.openmv.io/u/darrask)
#### Post date: [August 24, 2021, 7:57am UTC](https://forums.openmv.io/t/get-color-channel-data-for-each-blob/6251/4 "2021-08-24T07:57:51Z")

</div>

thanks! I did not check properly it seems, and now I got it to work and output the list of integers.  
However: would this be a histogram of the “L” channel in Lab space? How do I get the info for each color channel?

---

<div class="post-metadata">

### Author: ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)
#### Post date: [August 24, 2021, 4:25pm UTC](https://forums.openmv.io/t/get-color-channel-data-for-each-blob/6251/5 "2021-08-24T16:25:17Z")

</div>

No, it’s a histogram of the binary mask of the object. It’s meant to be a descriptor that you can use to match binary patterns.

You want to use get\_histogram() with the roi= and threshold= arguments set on a blob location to get the histogram of the color channels.

---

<div class="post-metadata">

### Author: ![darrask](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@darrask](https://forums.openmv.io/u/darrask)
#### Post date: [August 25, 2021, 4:15am UTC](https://forums.openmv.io/t/get-color-channel-data-for-each-blob/6251/6 "2021-08-25T04:15:05Z")

</div>

Thanks Kwabena, you set me on the right path! Following the documentaiton, I then used get\_statistics() with the roi = blob.rect and thresholds equal to the same values that I use in find.blobs() to get the LAB channels’ mode, min, and max values.
