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_LoadImage2;
|
2012-10-22 05:07:17 +02:00
|
|
|
|
|
|
|
|
|
{$APPTYPE CONSOLE}
|
|
|
|
|
{$R *.res}
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
System.SysUtils,
|
|
|
|
|
Core.types_c in '..\..\include\<5C>ore\Core.types_c.pas',
|
|
|
|
|
core_c in '..\..\include\<5C>ore\core_c.pas',
|
2013-03-27 23:20:08 +01:00
|
|
|
|
highgui_c in '..\..\include\highgui\highgui_c.pas',
|
|
|
|
|
LibName in '..\..\include\LibName.pas';
|
2012-10-22 05:07:17 +02:00
|
|
|
|
|
|
|
|
|
Const
|
2013-03-27 23:20:08 +01:00
|
|
|
|
filename = 'Resource\opencv_logo_with_text.png';
|
2012-10-22 05:07:17 +02:00
|
|
|
|
|
|
|
|
|
Var
|
|
|
|
|
image: pIplImage = nil;
|
|
|
|
|
src: pIplImage = nil;
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
image := cvLoadImage(filename, 1);
|
|
|
|
|
if Assigned(image) then
|
|
|
|
|
begin
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
src := cvCloneImage(image);
|
|
|
|
|
if Assigned(src) then
|
|
|
|
|
begin
|
|
|
|
|
// <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);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cvShowImage('original', image);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
WriteLn('src');
|
|
|
|
|
with src^ do
|
|
|
|
|
begin
|
|
|
|
|
WriteLn(Format('[i] channels: %d', [nChannels]));
|
|
|
|
|
WriteLn(Format('[i] pixel depth: %d bits', [depth]));
|
|
|
|
|
WriteLn(Format('[i] width: %d pixels', [width]));
|
|
|
|
|
WriteLn(Format('[i] height: %d pixels', [height]));
|
|
|
|
|
WriteLn(Format('[i] image size: %d bytes', [imageSize]));
|
|
|
|
|
WriteLn(Format('[i] width step: %d bytes', [widthStep]));
|
|
|
|
|
end;
|
|
|
|
|
WriteLn;
|
|
|
|
|
WriteLn('original');
|
|
|
|
|
with src^ do
|
|
|
|
|
begin
|
|
|
|
|
WriteLn(Format('[i] channels: %d', [nChannels]));
|
|
|
|
|
WriteLn(Format('[i] pixel depth: %d bits', [depth]));
|
|
|
|
|
WriteLn(Format('[i] width: %d pixels', [width]));
|
|
|
|
|
WriteLn(Format('[i] height: %d pixels', [height]));
|
|
|
|
|
WriteLn(Format('[i] image size: %d bytes', [imageSize]));
|
|
|
|
|
WriteLn(Format('[i] width step: %d bytes', [widthStep]));
|
|
|
|
|
end;
|
|
|
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cvWaitKey(0);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cvReleaseImage(image);
|
|
|
|
|
cvReleaseImage(src);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
cvDestroyWindow('original');
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
except
|
|
|
|
|
on E: Exception do
|
|
|
|
|
WriteLn(E.ClassName, ': ', E.Message);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|