# Cut an image and count white pixels

**URL:** <https://forums.openmv.io/t/cut-an-image-and-count-white-pixels/1903>\
**Category:** OpenMV Boards\
**Created:** [August 24, 2020, 8:26pm UTC](https://forums.openmv.io/t/cut-an-image-and-count-white-pixels/1903 "2020-08-24T20:26:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaiguaJoao](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@MaiguaJoao](https://forums.openmv.io/u/MaiguaJoao)\
**Post date:** [August 24, 2020, 8:26pm UTC](https://forums.openmv.io/t/cut-an-image-and-count-white-pixels/1903/1 "2020-08-24T20:26:25Z")

</div>

Good afternoon, I’m new to using the openmv H7, how can I cut an image into 4 parts and count its white pixels, to store them in a matrix?  
Beforehand thank you very much

---

<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, 2020, 10:12pm UTC](https://forums.openmv.io/t/cut-an-image-and-count-white-pixels/1903/2 "2020-08-24T22:12:52Z")

</div>

Use find\_blobs(). Set the threshold to look for white pixels. Then, count the number of pixels in each blog returned. You can target the roi for find\_blobs() to an area of the image.

---

<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, 2020, 10:12pm UTC](https://forums.openmv.io/t/cut-an-image-and-count-white-pixels/1903/3 "2020-08-24T22:12:56Z")

</div>

Use find\_blobs(). Set the threshold to look for white pixels. Then, count the number of pixels in each blog returned. You can target the roi for find\_blobs() to an area of the image.

---

<div class="post-metadata">

**Author:** ![MaiguaJoao](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@MaiguaJoao](https://forums.openmv.io/u/MaiguaJoao)\
**Post date:** [September 7, 2020, 10:08pm UTC](https://forums.openmv.io/t/cut-an-image-and-count-white-pixels/1903/4 "2020-09-07T22:08:51Z")

</div>

muchas gracias por la información 😃 me ayudo mucho.
