Tag: 相机

OpenCV:在Android上,将Kotlin中的Mat与Scalar相乘

我正在使用Camera API 2编写Android应用程序。它以不同的曝光值在连拍模式下拍摄3张照片,并将它们与OpenCV(3.0.0)合并。 合并我的意思是Mertens算法,这是在照片模块中可用。 为了将结果保存为设备上的图像,我需要将其与标量相乘。 如果我不这样做,那么最终的图像是黑色的。 fun multiply(src: Mat): Mat { val scalar = Scalar(255.0,255.0,255.0) val dest = Mat() Core.multiply(src, scalar, dest) return dest } 源图像(src)是320×240 CV_32FC3。 但乘法失败: android-pack/opencv/modules/core/src/arithm.cpp:1987: error: (-209) The operation is neither ‘array op array’ (where arrays have the same size and the same number of channels), nor ‘array op scalar’, nor […]