ImageEn, unit imageenproc |
|
TImageEnProc Geometric Method Testing
Testing of TImageEnProc Geometric Methods
These images were generated using the demo:
\Demos\InputOutput\EveryMethod\EveryMethod.dpr
All Test Results-
Analysis Methods-
Color Adjustment Methods-
Color Depth Methods-
Alpha and Painting Methods-
Effects Methods- Geometric Methods-
Filter Methods-
Smoothing Methods-
Other Methods
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );
CropSel
// Make circular selection of entire image and crop
ImageEnView1.SelectionBase := iesbBitmap;
ImageEnView1.SelectEllipse(ImageEnView1.IEBitmap.Width div 2,
ImageEnView1.IEBitmap.Height div 2,
ImageEnView1.IEBitmap.Width,
ImageEnView1.IEBitmap.Height);
ImageEnView1.Proc.CropSel();
Crop
// Crop 25% of all sides of the image
ImageEnView1.Proc.Crop( ImageEnView1.IEBitmap.Width div 4,
ImageEnView1.IEBitmap.Height div 4,
MulDiv( ImageEnView1.IEBitmap.Width, 3, 4 ),
MulDiv( ImageEnView1.IEBitmap.Height, 3, 4 ));
Flip
// Flip the image horizontally
ImageEnView1.Proc.Flip( fdHorizontal );
ImageResize
// Add a black border to the image
ImageEnView1.Proc.ImageResize( ImageEnView1.IEBitmap.Width + 20,
ImageEnView1.IEBitmap.Height + 20,
iehCenter, ievCenter,
255, clBlack );
Resample
// Scale the image to half size
ImageEnView1.Proc.Resample( 0.5, rfLanczos3 );
Rotate
// Rotate the image 90° counter-clockwise
ImageEnView1.Proc.Rotate( 90 );
RotateAndCrop
// Rotate the image 15° counter-clockwise and crop to maintain only image area
ImageEnView1.Proc.RotateAndCrop( 15, ierBicubic, 0, iecaAngledPhoto );
RoundImage
// Add round corners to the image
ImageEnView1.Proc.RoundImage( ImageEnView1.IEBitmap.Width div 10,
ImageEnView1.IEBitmap.Height div 10 );
ShiftChannel
// Shift to -5 horizontally and -2 vertically in the Blue channel, filling new areas with 0
ImageEnView1.Proc.ShiftChannel( -5, -2, iecBlue, 0 );
AutoCrop
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );
// Remove any black border from the image (with tolerance of 30)
ImageEnView1.Proc.AutoCrop( 30, clBlack );
CropTransparentBorder
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );
// Remove any transparent area from the edge of the image
ImageEnView1.Proc.CropTransparentBorder();
CalcOrientation
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );
// Automatically rotate a document
n := ImageEnView1.Proc.CalcOrientation();
ImageEnView1.Proc.Rotate( n );
SkewDetection
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );
// Check for skew within the range -15 to 15 with 0.1 degrees of precision and automatically orient (for printed text)
d := ImageEnView1.Proc.SkewDetection( ImageEnView1.IEBitmap.Width div 4, 30, 0.1, false );
ImageEnView1.Proc.RotateAndCrop( d, ierBicubic );
SkewDetectionFine
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );
// Check for skew within the range -5 to 5 with 0.1 degrees of precision and automatically orient (for printed text)
d := ImageEnView1.Proc.SkewDetectionFine( 0, 0.1, 10, True );
ImageEnView1.Proc.RotateAndCrop( d, ierBicubic );
See Also
-
Analysis Methods-
Color Adjustment Methods-
Color Depth Methods-
Alpha and Painting Methods-
Effects Methods- Geometric Methods-
Filter Methods-
Smoothing Methods-
Other Methods