LEADTOOLS Image Processing (Leadtools.ImageProcessing.Core assembly)

IsRegistrationMark Method

Show in webframe
Example 







RasterImage object that references the image to be searched for registration mark.
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.
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 accepts only positive values.
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 accepts only positive values.
The width of the registration mark (in pixels). This parameter accepts only positive values.
The height of the registration mark (in pixels). This parameter accepts only 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
public static bool IsRegistrationMark( 
   RasterImage image,
   RegistrationMarkCommandType type,
   int minScale,
   int maxScale,
   int width,
   int height
)
'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
'Usage
 
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)
public static bool IsRegistrationMark( 
   RasterImage image,
   RegistrationMarkCommandType type,
   int minScale,
   int maxScale,
   int width,
   int height
)
+ (BOOL)isRegistrationMark:(LTRasterImage*)image 
                      type:(LTRegistrationMarkCommandType)type 
                  minScale:(int)minScale maxScale:(int)maxScale width:(int)width height:(int)height error:(NSError**)outError;
            
public static boolean isRegistrationMark(
   RasterImage image, 
   RegistrationMarkCommandType type, 
   int minScale, 
   int maxScale, 
   int width, 
   int height
)
            
 function Leadtools.ImageProcessing.Core.CoreUtilities.IsRegistrationMark( 
   image ,
   type ,
   minScale ,
   maxScale ,
   width ,
   height 
)
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 accepts only 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 accepts only positive values.
width
The width of the registration mark (in pixels). This parameter accepts only positive values.
height
The height of the registration mark (in pixels). This parameter accepts only positive values.

Return Value

Boolean value indicating weather that specific object is registration mark or not.
Remarks
For more information, refer to Detecting Registration Marks.
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

Public Sub IsRegistrationMarkExample()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "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

End Sub

Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;

public void IsRegistrationMarkExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;

   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "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");

}

static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
//   
//   public async Task IsRegistrationMarkExample()
//   {
//      // Load an image
//      RasterCodecs codecs = new RasterCodecs();
//      codecs.ThrowExceptionsOnInvalidImages = true;

//      // Load the image
//      string srcFileName = @"Assets\Image1.cmp";
//      StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
//      RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

//      // Prepare the command
//      bool IsRegMark = CoreUtilities.IsRegistrationMark(image, RegistrationMarkCommandType.TShape, 90, 110, 31, 29);
//      Debug.WriteLine(IsRegMark ? "It's Registration Mark" : "Not a Registration Mark");

//   }
//
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;

      
public async Task IsRegistrationMarkExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   // Load the image
   string srcFileName = @"Assets\Image1.cmp";
   StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

   // Prepare the command
   bool IsRegMark = CoreUtilities.IsRegistrationMark(image, RegistrationMarkCommandType.TShape, 90, 110, 31, 29);
   Debug.WriteLine(IsRegMark ? "It's Registration Mark" : "Not a Registration Mark");

}
Requirements

Target Platforms

See Also

Reference

CoreUtilities Class
CoreUtilities Members
Detecting Registration Marks
Leadtools.ImageProcessing.Effects.CombineCommand
Leadtools.ImageProcessing.RotateCommand
Leadtools.ImageProcessing.SizeCommand
Leadtools.ImageProcessing.ResizeCommand
GetTransformationParameters Method
SearchRegistrationMarksCommand Class
GetRegistrationMarksCenterMass Method

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.