ImageEn, unit iexBitmaps

TIEBitmap.GetIEVisionImage

TIEBitmap.GetIEVisionImage


Declaration


function GetIEVisionImage(): 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.

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, smooth, filter2D, pyrDown, pyrUp

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 ); // ImageEnView1.IEBitmap
ImageEnView1.Update();



Example


// 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();


See Also


- AssignIEVisionImage
- TIEVisionImage