【发布时间】:2018-07-13 09:33:33
【问题描述】:
InputOutputArray 的构造函数在构造函数中采用 const cv::Mat&,这意味着编译时不会出现任何警告或错误。
为什么 InputOutputArray 采用 const Mat 引用。我理解为什么 InputArray 需要一个 const 引用,但 OutputArray 真的不应该
void this_shouldnt_compile(const cv::Mat& mat) {
// const, so the header should not be modifiable
// but the data is
putText(mat, "some text", cvPoint(0,10),
FONT_HERSHEY_COMPLEX_SMALL, 0.8,
cvScalar({0,255,0}), 1, CV_AA);
}
【问题讨论】: