1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2026-02-11 13:54:39 +03:00
committed by Alexander Smorkalov
468 changed files with 16647 additions and 11284 deletions
@@ -82,7 +82,7 @@ cv.bitwise_and(logo, logo, imgFg, mask);
// Put logo in ROI and modify the main image
cv.add(imgBg, imgFg, sum);
dst = src.mat_clone();
dst = src.clone();
for (let i = 0; i < logo.rows; i++) {
for (let j = 0; j < logo.cols; j++) {
dst.ucharPtr(i, j)[0] = sum.ucharPtr(i, j)[0];
@@ -248,7 +248,7 @@ function backprojection(src) {
if (base instanceof cv.Mat) {
base.delete();
}
base = src.mat_clone();
base = src.clone();
cv.cvtColor(base, base, cv.COLOR_RGB2HSV, 0);
}
cv.cvtColor(src, dstC3, cv.COLOR_RGB2HSV, 0);
@@ -53,7 +53,7 @@ canvas.addEventListener('click', e => {
});
canvas.addEventListener('mousemove', e => {
let x = e.offsetX, y = e.offsetY; //console.log(x, y);
let dst = src.mat_clone();
let dst = src.clone();
if (hasMap && x >= 0 && x < src.cols && y >= 0 && y < src.rows)
{
let contour = new cv.Mat();
@@ -77,14 +77,12 @@ How to copy Mat
There are 2 ways to copy a Mat:
@code{.js}
// 1. Clone (deep copy)
let dst = src.mat_clone();
// 1. Clone
let dst = src.clone();
// 2. CopyTo(only entries indicated in the mask are copied)
src.copyTo(dst, mask);
@endcode
@note In OpenCV.js, use `mat_clone()` instead of `clone()` to ensure deep copy behavior. The `clone()` method may perform shallow copy due to Emscripten embind limitations.
How to convert the type of Mat
------------------------------
@@ -84,7 +84,12 @@ Building OpenCV.js from Source
@endcode
@note
It requires `python` and `cmake` installed in your development environment.
- It requires `python` and `cmake` installed in your development environment.
- To build with Emscripten 4.0.20 or later, append --cmake_option="-DCMAKE_CXX_STANDARD=17" .
Embind requires C++17 or later since Emscripten 4.0.20.
@code{.bash}
emcmake python ./opencv/platforms/js/build_js.py build_js --cmake_option="-DCMAKE_CXX_STANDARD=17"
@endcode
-# [Optional] To build the OpenCV.js loader, append `--build_loader`.