为什么 UIImageToMat 在被调用时忽略了第三个参数?

why UIImageToMat neglect the third argument when being called?

在 openCV 库中,具体来说,在 ios.h 中,UIImageToMat 声明为:

void UIImageToMat(const UIImage* image,
                         cv::Mat& m, bool alphaExist = false);

但是调用 UIImageToMat 时,为什么人们忽略了第三个参数? 例如:

UIImageToMat(image, cvImage);

从函数原型可以看出,第三个参数的默认值为false... bool alphaExist = false。因此,在没有 alpha 的用例中,无需显式指定最后一个参数。