Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.10
IsRegistrationMark Method
See Also  Example
Leadtools.ImageProcessing.Core Namespace > CoreUtilities Class : IsRegistrationMark Method




image
RasterImage object that references the image to be searched for registration mark.
type
Value that specifies the type of registration mark for which to look. Currently, only one registration mark is defined (T-shape). See the Comments for more information. More shapes will be added in the future.
minScale
Minimum scaling factor of mark to be detected. This is a percentage. It must not exceed maxScale, or an error will be returned. This parameter only accepts positive values.
maxScale
Maximum scaling factor of mark to be detected. This is a percentage. It must not be lower than minScale, or an error will be returned. This parameter only accepts positive values.
width
The width of the registration mark (in pixels). This parameter only accepts positive values.
height
The height of the registration mark (in pixels). This parameter only accepts positive values.
Determines if the object inside the image is a registration mark or not. This method is available in the Document/Medical Toolkits.

Syntax

Visual Basic (Declaration) 
Public Shared Function IsRegistrationMark( _
   ByVal image As RasterImage, _
   ByVal type As RegistrationMarkCommandType, _
   ByVal minScale As Integer, _
   ByVal maxScale As Integer, _
   ByVal width As Integer, _
   ByVal height As Integer _
) As Boolean
Visual Basic (Usage)Copy Code
Dim image As RasterImage
Dim type As RegistrationMarkCommandType
Dim minScale As Integer
Dim maxScale As Integer
Dim width As Integer
Dim height As Integer
Dim value As Boolean
 
value = CoreUtilities.IsRegistrationMark(image, type, minScale, maxScale, width, height)
C# 
public static bool IsRegistrationMark( 
   RasterImage image,
   RegistrationMarkCommandType type,
   int minScale,
   int maxScale,
   int width,
   int height
)
Managed Extensions for C++ 
public: static bool IsRegistrationMark( 
   RasterImage image,
   RegistrationMarkCommandType type,
   int minScale,
   int maxScale,
   int width,
   int height
) 
C++/CLI 
public:
static bool IsRegistrationMark( 
   RasterImage image,
   RegistrationMarkCommandType type,
   int minScale,
   int maxScale,
   int width,
   int height
) 

Parameters

image
RasterImage object that references the image to be searched for registration mark.
type
Value that specifies the type of registration mark for which to look. Currently, only one registration mark is defined (T-shape). See the Comments for more information. More shapes will be added in the future.
minScale
Minimum scaling factor of mark to be detected. This is a percentage. It must not exceed maxScale, or an error will be returned. This parameter only accepts positive values.
maxScale
Maximum scaling factor of mark to be detected. This is a percentage. It must not be lower than minScale, or an error will be returned. This parameter only accepts positive values.
width
The width of the registration mark (in pixels). This parameter only accepts positive values.
height
The height of the registration mark (in pixels). This parameter only accepts positive values.

Return Value

Boolean value indicating weather that specific object is registration mark or not.

Example

Visual BasicCopy Code
ImageProcessing.Core.CoreUtilities.IsRegistrationMark
   Public Sub IsRegistrationMarkExample()
      RasterCodecs.Startup()
      Dim codecs As New RasterCodecs()
      codecs.ThrowExceptionsOnInvalidImages = True

      Dim leadImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg")

      ' Prepare the command
      Dim IsRegMark As Boolean
      IsRegMark = CoreUtilities.IsRegistrationMark(leadImage, RegistrationMarkCommandType.TShape, 90, 110, 31, 29)
      If (IsRegMark) Then
         MessageBox.Show("It's Registration Mark", "IsRegistrationMarkTest")
      Else
         MessageBox.Show("Not a Registration Mark", "IsRegistrationMarkTest")
      End If

      RasterCodecs.Shutdown()
   End Sub
C#Copy Code
ImageProcessing.Core.CoreUtilities.IsRegistrationMark 
      public void IsRegistrationMarkExample() 
      { 
         // Load an image 
         RasterCodecs.Startup(); 
         RasterCodecs codecs = new RasterCodecs(); 
         codecs.ThrowExceptionsOnInvalidImages = true; 
 
         RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg"); 
 
         // Prepare the command 
         bool IsRegMark = CoreUtilities.IsRegistrationMark(image, RegistrationMarkCommandType.TShape, 90, 110, 31, 29); 
         MessageBox.Show(IsRegMark ? "It's Registration Mark" : "Not a Registration Mark"); 
 
         RasterCodecs.Shutdown(); 
      }

Remarks

  • This method verifies whether the object inside the image is a registration mark. The object must be white and the background be black. Objects that are not white will not be detected. The image must have only one object inside it in order to work properly.
  • Currently, there is only one type defined, a T-shaped figure as shown in the following figure. This type is a "T" rotated by 90 degrees counter clockwise. The P4 point must be on the center point of Line P1P2 (that is, the distance from P1 to P4 equals the distance from P2 to P4). The line width should be greater than 2 pixels(preferably 3 pixels). There are no conditions on line lengths since you provide the values for width, height, maxScale, and minScale.

  • Do not use this command to search for registration marks inside the image. Use SearchRegistrationMarksCommand instead.
  • If you simply want to automatically straighten the image, use the DeskewCommand.
  • This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
  • This method does not support signed data images.
For more information, refer to Detecting Registration Marks.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also