If itβs true that you must explicitly pass by reference, then how do all the functions of OpenCV work? None of them pass values ββby reference, but somehow they seem to write the passed in Mat very well. For example, here is the declaration of the Sobel function in imgproc.hpp:
//! applies generalized Sobel operator to the image CV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth, int dx, int dy, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT );
as you can see, it goes into src and dst without &. And yet I know that after I call Sobel with an empty dst, it will be filled. No '&' involved.
john ktejik
source share