title: Matlab gradient equivalent in opencv
body: <p>I am trying to migrate some code from Matlab to Opencv and need an exact replica of the gradient function. I have tried the cv::Sobel function but for some reason the values in the resulting cv::Mat are not the same as the values in the Matlab version. I need the X and Y gradient in separate matrices for further calculations.</p>
  
  <p>Any workaround that could achieve this would be great</p>