Comments (3)
I check the source code, why cvSetND function will call cvScalarToRawData function.
https://github.com/opencv/opencv/blob/4.x/modules/core/src/array.cpp#L2241
In cvScalarToRawData, it will check depth of Mat.
https://github.com/opencv/opencv/blob/4.x/modules/core/src/array.cpp#L1511
In the comment of cv::Mat::Mat
and setTo
, both of them seem to use Mat::operator=(const Scalar& s) operator
to rewrite the value of the given Mat.
/** @overload
@param rows Number of rows in a 2D array.
@param cols Number of columns in a 2D array.
@param type Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
@param s An optional value to initialize each matrix element with. To set all the matrix elements to
the particular value after the construction, use the assignment operator
Mat::operator=(const Scalar& value) .
*/
Mat(int rows, int cols, int type, const Scalar& s);
cv::Mat &cv::Mat::setTo(cv::InputArray value, cv::InputArray mask = noArray())
Sets all or some of the array elements to the specified value. This is an advanced variant of the Mat::operator=(const Scalar& s) operator.
from opencv.
@destinyzs, did you try newer than 4.1.0 versions of OpenCV? 4.1.0 is super-old and is not supported anymore.
from opencv.
Not yet, but 4.1 is not a very old version. @vpisarev
from opencv.
Related Issues (20)
- the first grab on a camera video stream is consistently several hundreds of milliseconds long HOT 4
- Building OpenCV for Python with Cuda 12.5 and cuDNN 9.1.1: A dynamic link library (DLL) initialization routine failed. HOT 5
- Should the camera pose be changed to object pose in the introduction of Homography from the camera display? HOT 1
- On macOS linking to third-party Orbbec SDK binary by default HOT 3
- `cv::imread` with `OutputArray dst` returns with empty output
- Problem in Subdiv2D, empty triangulation
- CMake install target on Windows does not install libs into correct subdirs HOT 3
- FaceRecognizerSF documentation typos
- Window freezes after 4 updates
- Max/Min pool HOT 2
- OpenCV build with CuDNN 9.x reports false CuDNN version mismatch
- opencv-java 4.10.0 win11 加载yolov10 onnx报错 HOT 3
- Python return types in 4.10 break type checking due to not depending on input types HOT 2
- `floodFill` `mask` argument is missing `| None` part of type signature HOT 2
- Use of omp_set_dynamic() creates nonsensical OpenMP behaviour, using only 1 thread
- OpenCV 4.10.0 does not compile with CUDA 10.2 HOT 3
- There seems to be an issue with the parallel_for_ function in the parallel.cpp file.
- Add SIMD256 intrinsics to demosaicing
- 3rdparty/ ndsrvp and hal_rvv seeems no lincense files. HOT 2
- all: http://opencv.org/license.html returns 404 status. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv.