# Thread Safety for SURF.create(...)

**URL:** <https://forum.opencv.org/t/thread-safety-for-surf-create/12044>\
**Category:** Android/Java\
**Tags:** features2d\
**Created:** [February 19, 2023, 2:33pm UTC](https://forum.opencv.org/t/thread-safety-for-surf-create/12044 "2023-02-19T14:33:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trausch](https://avatars.discourse-cdn.com/v4/letter/t/e68b1a/32.png) [@trausch](https://forum.opencv.org/u/trausch)\
**Post date:** [February 19, 2023, 2:33pm UTC](https://forum.opencv.org/t/thread-safety-for-surf-create/12044/1 "2023-02-19T14:33:33Z")

</div>

I have noticed that with a high computing load (LoadAvarage from 30 and higher) the detector is created, but undefinable errors occur when I use it. All input parameters (of the detector at create and the images) are identical.

`SURF detector = SURF.create(...)`

Has anyone else noticed this?

I use 4.6.0 on Linux.

Here is my first troubleshooting question about it:

> [@Nn\_index.h:71: error: (-215:Assertion failed) in Java](https://forum.opencv.org/t/nn-index-h-error-215-assertion-failed-in-java/12038/):
>
> I have the below error in Java. However, it only occurs when I evaluate many frames in parallel in many threads and the load level rises above 30: opencv-4.6.0/modules/flann/include/opencv2/flann/nn\_index.h:71: error: (-215:Assertion failed) queries.cols == veclen() in function ‘knnSearch’
