text: /**
   * @file equalizeHist.cpp
   * @brief mex interface for cv::equalizeHist
   * @ingroup imgproc
   * @author Kota Yamaguchi
   * @date 2012
   */
  #include "mexopencv.hpp"
  using namespace std;
  using namespace cv;
  
  /**
   * Main entry called from Matlab
   * @param nlhs number of left-hand-side arguments
   * @param plhs pointers to mxArrays in the left-hand-side
   * @param nrhs number of right-hand-side arguments
   * @param prhs pointers to mxArrays in the right-hand-side
   */
  void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
  {
      // Check the number of arguments
      nargchk(nrhs==1 && nlhs<=1);
  
      // Argument vector
      vector<MxArray> rhs(prhs, prhs+nrhs);
  
      // Process
      Mat src(rhs[0].toMat(CV_8U)), dst;
      equalizeHist(src, dst);
      plhs[0] = MxArray(dst);
  }
  