First, congratulations for your excellent work creating these comprehensive wrappers of OpenCV for Delphi.
While using this wrapper, I discovered some errors in the translation of the headers. Often, but not always, you defined as parameters of procedures PIplImage for src and dst, where the funtion fully accept PCvMat as well via a PCvArr.
To take one example :
CVAPI(void) cvSmooth(
const CvArr src,
CvArr dst,
int smoothtype CV_DEFAULT(CV_GAUSSIAN),
int size1 CV_DEFAULT(3),
int size2 CV_DEFAULT(0),
double sigma1 CV_DEFAULT(0),
double sigma2 CV_DEFAULT(0));
}
procedure cvSmooth(
{ } const src: pIplImage;
{ } dst: pIplImage;
{ } smoothtype: Integer = CV_GAUSSIAN;
{ } size1: Integer = 3;
{ } size2: Integer = 0;
{ } sigma1: Double = 0;
{ } sigma2: Double = 0); cdecl;
As you can see, the correct type for src and dst are PCvArr, that can be PIplImage or PcvMat. You used PIplImage instead.
To be able to work, I do a lot of pointer casting to call the functions with a PCvMat variable (PIlplImage(myPCvMatVar). No problem, it works fine but the code is less easy to read.
I already detected this error in:
CvAdd
CvMinMaxLoc
CvSmooth
CvMul
CvSub
CvFloodFill
CvWarpAffine
CvThreshold
...
Some functions are correctly translated. Example CvFilter2D.
By the way, I see the GPU function is not translated, due to the C++ header. I join here a weblink to some site that gave a try to it with a certain sucess. It may help you to continue your great work. http://gidesa.altervista.org/camshiftdemo.php
Hello,
First, congratulations for your excellent work creating these comprehensive wrappers of OpenCV for Delphi.
While using this wrapper, I discovered some errors in the translation of the headers. Often, but not always, you defined as parameters of procedures PIplImage for src and dst, where the funtion fully accept PCvMat as well via a PCvArr.
To take one example : CVAPI(void) cvSmooth( const CvArr src, CvArr dst, int smoothtype CV_DEFAULT(CV_GAUSSIAN), int size1 CV_DEFAULT(3), int size2 CV_DEFAULT(0), double sigma1 CV_DEFAULT(0), double sigma2 CV_DEFAULT(0)); } procedure cvSmooth( { } const src: pIplImage; { } dst: pIplImage; { } smoothtype: Integer = CV_GAUSSIAN; { } size1: Integer = 3; { } size2: Integer = 0; { } sigma1: Double = 0; { } sigma2: Double = 0); cdecl;
As you can see, the correct type for src and dst are PCvArr, that can be PIplImage or PcvMat. You used PIplImage instead.
To be able to work, I do a lot of pointer casting to call the functions with a PCvMat variable (PIlplImage(myPCvMatVar). No problem, it works fine but the code is less easy to read.
I already detected this error in: CvAdd CvMinMaxLoc CvSmooth CvMul CvSub CvFloodFill CvWarpAffine CvThreshold ... Some functions are correctly translated. Example CvFilter2D.
By the way, I see the GPU function is not translated, due to the C++ header. I join here a weblink to some site that gave a try to it with a certain sucess. It may help you to continue your great work. http://gidesa.altervista.org/camshiftdemo.php
Thank you
Regards