getNumThreads
import { getNumThreads } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
ARGUMENTSSee signature below
FUNCTIONgetNumThreads
RETURN TYPEnumber
Returns the number of threads used by OpenCV for parallel regions.
Always returns 1 if OpenCV is built without threading support.
The exact meaning of return value depends on the threading framework used by OpenCV library:
TBB- The number of threads, that OpenCV will try to use for parallel regions. If there is any tbb::thread_scheduler_init in user code conflicting with OpenCV, then function returns default number of threads used by TBB library.OpenMP- An upper bound on the number of threads that could be used to form a new team.Concurrency- The number of threads, that OpenCV will try to use for parallel regions.GCD- Unsupported; returns the GCD thread pool limit (512) for compatibility.C=- The number of threads, that OpenCV will try to use for parallel regions, if before called setNumThreads with threads > 0, otherwise returns the number of logical CPUs, available for the process. See: setNumThreads, getThreadNum
getNumThreads(): number;Returns
The number result.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.