# TypeError: cv.findNonZero is not a function

**URL:** <https://forum.opencv.org/t/typeerror-cv-findnonzero-is-not-a-function/9126>\
**Category:** Uncategorized\
**Tags:** javascript, opencvjs, build, core\
**Created:** [June 11, 2022, 10:59pm UTC](https://forum.opencv.org/t/typeerror-cv-findnonzero-is-not-a-function/9126 "2022-06-11T22:59:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Kiff](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/justin_kiff/32/5436_2.png) [@Justin\_Kiff](https://forum.opencv.org/u/Justin_Kiff)\
**Post date:** [June 11, 2022, 10:59pm UTC](https://forum.opencv.org/t/typeerror-cv-findnonzero-is-not-a-function/9126/1 "2022-06-11T22:59:01Z")

</div>

Hello, with latest 4.6.0 version of opencv.js i have the following error when using findNonZero function:

```auto
let src = cv.imread('canvasInput');
let dst = new cv.Mat();
cv.threshold(src, dst, 177, 200, cv.THRESH_BINARY);
let nonzero = new cv.Mat();
cv.findNonZero(dst, nonzero);

```

I get :

```auto
TypeError: cv.findNonZero is not a function

```

To reproduce, copy paste the example code to the “Try It” section in [OpenCV: Image Thresholding](https://docs.opencv.org/4.6.0/d7/dd0/tutorial_js_thresholding.html)

The [findNonZero](https://docs.opencv.org/4.6.0/d2/de8/group __core__ array.html#gaed7df59a3539b4cc0fe5c9c8d7586190) function is present in the api documentation, so i suppose it should be available in the js release, am i missing something?

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [June 12, 2022, 8:09am UTC](https://forum.opencv.org/t/typeerror-cv-findnonzero-is-not-a-function/9126/2 "2022-06-12T08:09:02Z")

</div>

> [@Justin\_Kiff](#):
>
> The [findNonZero](https://docs.opencv.org/4.6.0/d2/de8/group __core__ array.html#gaed7df59a3539b4cc0fe5c9c8d7586190) function is present in the api documentation, so i suppose it should be available in the js release

the js wrappers do not cover the full opencv functionality, you can only use functions from the “whitelist” here:

> <https://github.com/opencv/opencv/blob/7676be5570a3a7478e6d67c80221c097a206286d/platforms/js/opencv_js.config.py#L6>

as you can see, it has `countNonZeros()` but not `findNonZeros()`

if you’re able to build opencv.js locally, try to add it to the list, rebuild, and see, what happens
