Skip to content

pyrUp

Image processingfunctionOpenCV 5.0.0
import { pyrUp } from '@banou/opencv-wasm'

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

Upsamples an image and then blurs it.

By default, size of the output image is computed as Size(src.cols\*2, (src.rows\*2), but in any case, the following conditions should be satisfied:

\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq  ( \texttt{dstsize.width}   \mod  2)  \\ | \texttt{dstsize.height} -src.rows*2| \leq  ( \texttt{dstsize.height}   \mod  2) \end{array}

The function performs the upsampling step of the Gaussian pyramid construction, though it can actually be used to construct the Laplacian pyramid. First, it upsamples the source image by injecting even zero rows and columns and then convolves the result with the same kernel as in pyrDown multiplied by 4.

pyrUp(src: Mat, dst: Mat, dstsize: Size, borderType: number): void;
3 available overloads
pyrUp(src: Mat, dst: Mat): void;
pyrUp(src: Mat, dst: Mat, dstsize: Size): void;
pyrUp(src: Mat, dst: Mat, dstsize: Size, borderType: number): void;
src

input image.

dst

Output destination, filled by the native operation. output image. It has the specified size and the same type as src .

dstsize

size of the output image.

borderType

Pixel extrapolation method, see #BorderTypes (only #BORDER_DEFAULT is supported)

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.