LUT
import { LUT } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
example: samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp
Check tutorial_how_to_scan_images "the corresponding tutorial" for more details
Performs a look-up table transform of an array.
The function LUT fills the output array with values from the look-up table. Indices of the entries are taken from the input array. That is, the function processes each element of src as follows:
\texttt{dst} (I) \leftarrow \texttt{lut(src(I) + d)}
where
d = \forkthree{0}{if \(\texttt{src}\) has depth \(\texttt{CV_8U}\) or \(\texttt{CV_16U}\)}{128}{if \(\texttt{src}\) has depth \(\texttt{CV_8S}\)}{32768}{if \(\texttt{src}\) has depth \(\texttt{CV_16S}\)}
See: convertScaleAbs, Mat::convertTo
LUT(src: Mat, lut: Mat, dst: Mat): void;srcinput array of 8-bit or 16-bit integer elements.
lutlook-up table of 256 elements (if src has depth CV_8U or CV_8S) or 65536 elements(if src has depth CV_16U or CV_16S); in case of multi-channel input array, the table should either have a single channel (in this case the same table is used for all channels) or the same number of channels as in the input array.
dstOutput destination, filled by the native operation. output array of the same size and number of channels as src, and the same depth as lut.
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.