ImgFindInvertedTextRects

Top  Previous  Next

Prototype

 

intInvertedZonesListHandle:=ImgFindInvertedTextRects(intImageHandle, floatMinWidth, floatMinHeight)

 

Description

 

Find the invert white-on-black text zones on the images..

 

Parameters

 

intImageHandle: integer value corresponding to the image handle.

 

floatMinWidth: float value that specifies the minimal width, in inches, of a zone to be inverted.

 

floatMinWidth: float value that specifies the minimal height, in inches, of a zone to be inverted.

 

Returned value

 

Integer value representing the list handle of inverted zones found.

 

Notes

 

This function can work only on monochrome images.

 

Example

 

// Find inverted zones with minimal size 2" x 1/2"

RectsList:=ImgFindInvertedTextRects(_CurrentImage, 2.0 , 0.5);

 

// Count the zones found

RectsCount:=ImgRectsCount(RectsList);

 

// Log a message 

ApplicationLog('Zones inverted found: '+ IntToStr(RectsCount));

 

// For each zone get the left, top, right and bottom coordinates

For I:=0 to RectsCount-1 do

begin

 X1:= ImgRectGetLeft(RectsList,I);

 Y1:= ImgRectGetTop(RectsList,I);

 X2:= ImgRectGetRight(RectsList,I);

 Y2:= ImgRectGetBottom(RectsList,I);

 

 // Log a message 

 ApplicationLog('Zone #'+IntToStr(i)+' : '+IntToStr(X1)+','+IntToStr(Y1)+','+IntToStr(X2)+','+IntToStr(Y2));

end;

 

// Free the zones list from memory

ImgRectsFree(RectsList);;