Skip to content

bitwise_and

Core and matricesfunctionOpenCV 5.0.0
import { bitwise_and } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSsrc1, src2, dst, mask
FUNCTIONbitwise_and
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

computes bitwise conjunction of the two arrays (dst = src1 & src2) Calculates the per-element bit-wise conjunction of two arrays or an array and a scalar.

The function cv::bitwise_and calculates the per-element bit-wise logical conjunction for: Two arrays when src1 and src2 have the same size:

\texttt{dst} (I) =  \texttt{src1} (I)  \wedge \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0

An array and a scalar when src2 is constructed from Scalar or has the same number of elements as src1.channels():

\texttt{dst} (I) =  \texttt{src1} (I)  \wedge \texttt{src2} \quad \texttt{if mask} (I) \ne0

A scalar and an array when src1 is constructed from Scalar or has the same number of elements as src2.channels():

\texttt{dst} (I) =  \texttt{src1}  \wedge \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0

In case of floating-point arrays, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel arrays, each channel is processed independently. In the second and third cases above, the scalar is first converted to the array type.

bitwise_and(src1: Mat, src2: Mat, dst: Mat, mask: Mat): void;
2 available overloads
bitwise_and(src1: Mat, src2: Mat, dst: Mat): void;
bitwise_and(src1: Mat, src2: Mat, dst: Mat, mask: Mat): void;
src1

first input array or a scalar.

src2

second input array or a scalar.

dst

Output destination, filled by the native operation. output array that has the same size and type as the input arrays.

mask

optional operation mask, CV_8U, CV_8S or CV_Bool single channel array, that specifies elements of the output array to be changed.

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.