gpt4 book ai didi

c++ - vector 构造函数和垫

转载 作者:太空宇宙 更新时间:2023-11-03 23:01:57 24 4
gpt4 key购买 nike

如何在 OpenCV 中将 3 元素 vector 构造函数乘以 Mat?我尝试了以下但它抛出错误:

cv::multiply(src, cv::Vec<_Tp, 3>(2.0, 1.0, 1.0), src);

它给出了以下错误:

OpenCV Error: Assertion failed (src2.type() == CV_64F && (src2.rows == 4 || src2.rows == 1)) in arithm_op, file /Users/abhishek/Documents/OpenCV-2.4.3/modules/core/src/arithm.cpp, line 1275
libc++abi.dylib: terminate called throwing an exception

最佳答案

你试过吗:

cv::multiply(src, cv::Scalar(2.0, 1.0, 1.0), src);

关于c++ - vector 构造函数和垫,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15587349/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com