ImageEn, unit iexBitmaps

TIEBitmap.GetIEVisionImage

TIEBitmap.GetIEVisionImage


Declaration

function GetIEVisionImage(Clone: Boolean = False): TIEVisionImage;


Description

Creates a TIEVisionImage container for the current image.
This method can convert the image to a different pixel format and origin if necessary.
If the bitmap is attached to a TImageEnView, ensure that you call Update if your IEVision method changes the image content.

Note: GetIEVisionImage will make the following changes to your image:
TIEBitmap.Origin changes to ieboTOPLEFT
If image has an 8 bit palette then TIEBitmap.PixelFormat changes to ie24RGB


About GetIEVisionImage and AssignIEVisionImage

GetIEVisionImage does not create a new image, just embeds a TIEBitmap into TIEVisionImage. In other words, the TIEVisionImage is just a container to the original bitmap, and so most of its methods (and methods of other IEVision classes) will change the original bitmap, e.g. ImageEnView1.IEBitmap.GetIEVisionImage.setZero(); will clear the TIEBitmap of TImageEnView..

Some methods, however, cannot use the original image for output (e.g. because a larger image is needed), so the contained image is replaced with a new one (and the original bitmap will not reflect the changes). In this case, assignIEVisionImage can be used to update the original bitmap.
This affects the following methods: resize, makeBorder, filter2D, pyrDown, pyrUp

If Clone is True the original image isn't modified or adapted, and a clone is created.

Examples:

Img1 := ImageEnView1.IEBitmap.GetIEVisionImage;
Img1.setZero;    // ImageEnView1.IEBitmap will be cleared, assignIEVisionImage is not needed
ImageEnView1.Update();

Img1 := ImageEnView1.IEBitmap.GetIEVisionImage;
Img1.makeBorder( 50, 50, 50, 50, ievBORDER_CONSTANT, IEVisionScalar(255, 0, 0 ));
ImageEnView1.IEBitmap.assignIEVisionImage( Img1 );



Examples

// perform OCR (English language is the default) of "input.tiff"
ImageEnView1.IO.LoadFromFile('input.tiff');
str := IEVisionLib.createOCR().recognize(ImageEnView1.IEBitmap.GetIEVisionImage(), IEVisionRect(0, 0, 0, 0)).c_str();

// Smooth image using Bilateral
ImageEnView1.IEBitmap.GetIEVisionImage().smooth( ievBILATERAL, 5, 0, 30, 30 );
ImageEnView1.Update();


See Also

AssignIEVisionImage
TIEVisionImage