2013-03-27 23:20:08 +01:00
|
|
|
|
// JCL_DEBUG_EXPERT_GENERATEJDBG OFF
|
|
|
|
|
// JCL_DEBUG_EXPERT_INSERTJDBG OFF
|
|
|
|
|
// JCL_DEBUG_EXPERT_DELETEMAPFILE OFF
|
|
|
|
|
program cv_Laplace;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
|
|
|
|
{$APPTYPE CONSOLE}
|
|
|
|
|
{$R *.res}
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
System.SysUtils,
|
2013-04-02 00:17:25 +02:00
|
|
|
|
core_c in '..\..\..\include\<5C>ore\core_c.pas',
|
|
|
|
|
Core.types_c in '..\..\..\include\<5C>ore\Core.types_c.pas',
|
|
|
|
|
highgui_c in '..\..\..\include\highgui\highgui_c.pas',
|
|
|
|
|
imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas',
|
|
|
|
|
imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas',
|
|
|
|
|
uLibName in '..\..\..\include\uLibName.pas',
|
|
|
|
|
types_c in '..\..\..\include\<5C>ore\types_c.pas';
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
|
|
|
|
const
|
2013-03-27 23:20:08 +01:00
|
|
|
|
filename = 'Resource\cat2.jpg';
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
|
|
|
|
Var
|
|
|
|
|
image: pIplImage = Nil;
|
|
|
|
|
dst: pIplImage = Nil;
|
|
|
|
|
dst2: pIplImage = Nil;
|
|
|
|
|
aperture: Integer = 3;
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
image := cvLoadImage(filename);
|
|
|
|
|
WriteLn(Format('[i] image: %s', [filename]));
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
dst := cvCreateImage(cvGetSize(image), IPL_DEPTH_16S, image^.nChannels);
|
|
|
|
|
dst2 := cvCreateImage(cvGetSize(image), image^.depth, image^.nChannels);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cvNamedWindow('original', CV_WINDOW_AUTOSIZE);
|
|
|
|
|
cvNamedWindow('cvLaplace', CV_WINDOW_AUTOSIZE);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cvLaplace(image, dst, aperture);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 8-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cvConvertScale(dst, dst2);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cvShowImage('original', image);
|
|
|
|
|
cvShowImage('cvLaplace', dst2);
|
|
|
|
|
|
|
|
|
|
cvWaitKey(0);
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cvReleaseImage(image);
|
|
|
|
|
cvReleaseImage(dst);
|
|
|
|
|
cvReleaseImage(dst2);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
cvDestroyAllWindows();
|
|
|
|
|
|
|
|
|
|
end.
|