OpenCV iOS seamlessClone函数给出了内存错误

时间:2016-04-24 13:48:36

标签: c++ ios opencv

我正在尝试在iOS上使用seamlessClone OpenCV功能,但我总是收到EXC_BAD_ADDRESS错误。

这是代码:

Mat output;
seamlessClone(warped_frame, backgroundFrame, warped_mask, center, output, 1);

还试过:

Mat output = Mat::zeros(backgroundFrame.rows, backgroundFrame.cols, backgroundFrame.type())
seamlessClone(warped_frame, backgroundFrame, warped_mask, center, output, 1);

在seamlessClone函数中分配输出时会出现内存错误。

输入参数的类型和大小为:

Warped frame type: 16
Background frame type: 16
Warped mask type: 16
Warped frame size: [338 x 338]
Background frame size: [338 x 338]
Warped mask size: [338 x 338]
Center point: [154, 293]

16型是CV_8UC3。

从功能文档:

@param src Input 8-bit 3-channel image.
@param dst Input 8-bit 3-channel image.
@param mask Input 8-bit 1 or 3-channel image.
@param p Point in dst image where object is placed.
@param blend Output image with the same size and type as dst.
@param flags Cloning method.

一切似乎都很好。

有任何线索吗?

0 个答案:

没有答案