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-05 22:58:24 +02:00
|
|
|
|
uLibName in '..\..\..\include\uLibName.pas',
|
|
|
|
|
highgui_c in '..\..\..\include\highgui\highgui_c.pas',
|
|
|
|
|
core_c in '..\..\..\include\<5C>ore\core_c.pas',
|
|
|
|
|
Core.types_c in '..\..\..\include\<5C>ore\Core.types_c.pas',
|
|
|
|
|
imgproc.types_c in '..\..\..\include\imgproc\imgproc.types_c.pas',
|
|
|
|
|
imgproc_c in '..\..\..\include\imgproc\imgproc_c.pas',
|
|
|
|
|
legacy in '..\..\..\include\legacy\legacy.pas',
|
|
|
|
|
calib3d in '..\..\..\include\calib3d\calib3d.pas',
|
|
|
|
|
imgproc in '..\..\..\include\imgproc\imgproc.pas',
|
|
|
|
|
haar in '..\..\..\include\objdetect\haar.pas',
|
|
|
|
|
objdetect in '..\..\..\include\objdetect\objdetect.pas',
|
|
|
|
|
tracking in '..\..\..\include\video\tracking.pas',
|
|
|
|
|
Core in '..\..\..\include\<5C>ore\core.pas'
|
2013-04-05 13:36:47 +02:00
|
|
|
|
;
|
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
|
2013-04-05 13:36:47 +02:00
|
|
|
|
try
|
|
|
|
|
// <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();
|
|
|
|
|
except
|
|
|
|
|
on E: Exception do
|
|
|
|
|
WriteLn(E.ClassName, ': ', E.Message);
|
|
|
|
|
end;
|
2013-01-07 15:02:10 +01:00
|
|
|
|
|
|
|
|
|
end.
|