ImageEn

Preview of Detection Methods


The "Every Method" editing demo allows you to preview 300 editing, analysis and effects methods.


Image Editing Methods
Analysis Methods
Color Adjustment Methods
Color Depth Methods
Detection Methods
Effects Methods
Filter Methods
Geometric Methods
Painting and Alpha Methods
Smoothing Methods
Other Methods
Interactive Tools

 Test Images

ImageEnView1.IO.LoadFromFile( 'D:\ImageTest1.jpg' );

  


 canny (IEVision)

// Find line segments in a binary image using a probabilistic Hough transform
ImageEnView1.IEBitmap.PixelFormat := ie8g;
ImageEnView1.IEBitmap.GetIEVisionImage().canny( 50, 200, 3 );
ImageEnView1.IEBitmap.Negative();  // Which will call ImageEnView1.Update();

  


 EdgeDetect_ShenCastan

// Convert the current color image to black & white (1 bit) using a Shen-Castan (ISEF) edge detection algorithm
ImageEnView1.Proc.EdgeDetect_ShenCastan();

  


 EdgeDetect_Sobel

// Detect the edges of objects within an image using a Sobel filter
ImageEnView1.Proc.EdgeDetect_Sobel();
ImageEnView1.Proc.Negative();

  


 LayersCreateFromEdge

// Automatically select a color region and convert it to a polygon
ImageEnView1.SelectionBase := iesbBitmap;
if ImageEnView1.LayersCreateFromEdge( ClickPt.X, ClickPt.Y, 54, False ) > 0 then
begin
  ImageEnView1.CurrentLayer.BorderWidth := 2;
  ImageEnView1.CurrentLayer.BorderColor := Color;
  ImageEnView1.CurrentLayer.FillColor   := clWhite;
  ImageEnView1.LayersMergeAll();
end;

  


 matchTemplate (IEVision)

// Find a matching image within our image
template := SearchImage.GetIEVisionImage();
image := ImageEnView1.IEBitmap.GetIEVisionImage();
r := image.matchTemplate( template, ievSQDIFF, @rank );
// draw a red box around the found rectangle
with ImageEnView1.IEBitmap.Canvas do
begin
  Pen.Color := clRed;
  Pen.Width := 5;
  Brush.Style := bsClear;
  Rectangle( IEVisionRectToTRect( r ));
  Font.Height := 36;
  Font.Color := clRed;
  Font.Style := [fsBold];
  TextOut( r.x + 10, r.y + 4, Format( 'Match: %d%%', [Round( rank )]));
end;
ImageEnView1.Update();

  


 SeparateObjects

// Show detected objects in the image
ImageEnView1.Proc.SaveUndo();
ImageEnView1.Proc.ConvertToBWThreshold( 80 );    // Better detection
rects := ImageEnView1.Proc.SeparateObjects( 4, True, 10 );
ImageEnView1.Proc.Undo();                        // Get full color image back
ImageEnView1.IEBitmap.IECanvas.DrawRects( rects, clRed, 2 );
// Output object count
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Objects: %d', [ rects.Count ]), 'Arial', 10, clRed, [fsBold] );
ImageEnView1.Update();
rects.Free();

 


 createBlobDetector (IEVision)

// Detect blobs/shapes in image
detector := IEVisionLib().createBlobDetector();
detector.setFilterByInertia( False, 0.1, 3.4e+38 );
detector.setFilterByConvexity( False, 0.95, 3.4e+38 );
keyPoints := detector.detect( ImageEnView1.IEBitmap.GetIEVisionImage() );
ImageEnView1.IEBitmap.IECanvas.DrawRects( keyPoints, clRed, 2, True );
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Found: %d', [ KeyPoints.size ]), 'Arial', 12, Text_Color, [fsBold] );
ImageEnView1.Update();

 


 detectLines (IEVision)

// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

  

// Detect lines using a Binary Descriptor
lines := ImageEnView1.IEBitmap.GetIEVisionImage().detectLines( ievBinaryDescriptor );
ImageEnView1.IEBitmap.IECanvas.DrawLines( lines, clRed, 2 );
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Lines: %d', [ lines.size ]), 'Arial', 12, Text_Color, [fsBold] );
ImageEnView1.Update();

  

// Detect lines using a LSD Detector
lines := ImageEnView1.IEBitmap.GetIEVisionImage().detectLines( ievLSDDetector );
ImageEnView1.IEBitmap.IECanvas.DrawLines( lines, clRed, 2 );
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Lines: %d', [ lines.size ]), 'Arial', 12, Text_Color, [fsBold] );
ImageEnView1.Update();

  


 houghLinesP (IEVision)

// Find line segments in a binary image using the probabilistic Hough transform
ImageEnView1.Proc.SaveUndo();
ImageEnView1.IEBitmap.PixelFormat := ie8g;
ImageEnView1.IEBitmap.GetIEVisionImage().blur( IEVisionSize(3, 3), IEVisionPoint(-1, -1) );
ImageEnView1.IEBitmap.GetIEVisionImage().canny( 50, 200, 3 );
lines := ImageEnView1.IEBitmap.GetIEVisionImage().houghLinesP( 1, PI / 180, 200, 100, 10 );
ImageEnView1.Proc.Undo();    // Restore full color image
ImageEnView1.IEBitmap.IECanvas.DrawLines( lines, clRed, 2 );
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Lines: %d', [ lines.size ]), 'Arial', 12, Text_Color, [fsBold] );
ImageEnView1.Update();

  


 findIn (IEVision)

// Find Faces in image
objectsFinder := IEVisionLib.createObjectsFinder();
objectsFinder.addClassifier('face detector 1', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_DEFAULT));
objectsFinder.addClassifier('face detector 2', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_ALT_TREE));
objectsFinder.addClassifier('face detector 3', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_ALT));
objectsFinder.addClassifier('face detector 4', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_ALT_2));
objectsFinder.addClassifier('face detector 5', IEVisionLib.createCascadeClassifier(IEVC_PROFILE_FACE));
objectsFinder.findIn(ImageEnView1.IEBitmap.GetIEVisionImage());
rects := objectsFinder.mergeAllRects();  // merge intersecting rectangles
ImageEnView1.IEBitmap.IECanvas.DrawRects( rects, clRed, 2 );
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Found: %d', [ rects.size ]), 'Arial', 12, Text_Color, [fsBold] );
ImageEnView1.Update();

  



 createPeopleDetector (IEVision)

// Find and highlight the people in an image
detector := IEVisionLib.createPeopleDetector();
foundRects := detector.detect( ImageEnView1.IEBitmap.GetIEVisionImage() );
for i := 0 to foundRects.size()-1 do
  with foundRects.getRect(i) do
  begin
    ImageEnView1.IEBitmap.Canvas.Brush.Style := bsClear;
    ImageEnView1.IEBitmap.Canvas.Pen.Color := clRed;
    ImageEnView1.IEBitmap.Canvas.Rectangle(x, y, x+width, y+height);
  end;
ImageEnView1.Update();



 createOCR (IEVision)

// Extract text from an image
mOCR := IEVisionLib.createOCR( PAnsiChar( AnsiString( IEOCRLanguageList[OCR_English_Language].Code )) );
mOCR.setSegmentationMode( ievOCRAuto );
Memo1.Text := mOCR.recognize( ImageEnView1.IEBitmap.GetIEVisionImage(), IEVisionRect( ImageEnView1.SelectedRect )).c_str();



"Skew Angle Estimation and Correction of Hand
Written, Textual and Large areas of Non-Textual
Document Images: A Novel Approach
D.R.Ramesh Babu
PES Institute of Technology
Bangalore, Karnataka
India
Piyush M Kumat
Research Scholar
PICT, Pune
India
Mahesh D Dhannawat
Research Scholar
PICT, Pune
India
Abstract- Skew angle estimation and correction of a
document page is an important task for document
analysis and optical character recognition (OCR)
applications. Many approaches of skew detection can
process pure textual document images successfully. But
it is a challenging problem to process documents like
...


 OrbDetectAndDeskew (IEVision)

// Automatically orient an image based on a reference image
ImageEnViewInput.IEBitmap.OrbDetectAndDeskew( ImageEnViewReference.IEBitmap, ImageEnViewResult.IEBitmap, UpDownMaxFeatures.Position );



 createBarCodeScanner (IEVision)

// Find barcode in image
barCodeSymbols := IEVisionLib.createBarCodeScanner().scan( ImageEnView1.IEBitmap.GetIEVisionImage(), IEVisionRect( 0, 0, 0, 0 ) );
if barCodeSymbols.size() > 0 then
  ShowMessage( sym.getData().c_str() + ' (' + sym.getSymbolType().c_str() + ')' );

The following image returns "39123439 (Code-39)"


 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

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

 


 getOrientation (IEVision)

// Auto-fix the orientation and skew of the image
deskewAngle := ImageEnView1.IEBitmap.OCR_GetOrientation();
if deskewAngle <> 0 then
  ImageEnView1.Proc.Rotate( -deskewAngle, ierFast, clWhite );

For the following image, the required rotation would be -92.94°:



See Also

Analysis Methods
Color Adjustment Methods
Color Depth Methods
Detection Methods
Effects Methods
Filter Methods
Geometric Methods
Painting and Alpha Methods
Smoothing Methods
Other Methods
Interactive Tools