LEADTOOLS画像処理(Leadtools.ImageProcessing.Coreアセンブリ)

フレームを表示

CorrelationCommandクラス








メンバ 
このコマンドは、相関画像(または相関画像の一部)と、検索する画像内の同じサイズの領域すべてとを比較し(Runメソッド画像)、相関の測定値に従って一致するこれらの部分を見つけます。このコマンドはドキュメント/メディカルのツールキットで利用できます。
オブジェクトモデル
構文
'Declaration
 
Public Class CorrelationCommand 
   Inherits Leadtools.ImageProcessing.RasterCommand
   Implements Leadtools.ImageProcessing.IRasterCommand 
'Usage
 
Dim instance As CorrelationCommand
public sealed class CorrelationCommand : Leadtools.ImageProcessing.IRasterCommand  
@interface LTCorrelationCommand : LTRasterCommand
public class CorrelationCommand extends RasterCommand
function Leadtools.ImageProcessing.Core.CorrelationCommand()
解説
詳細については、「LEADTOOLSによる画像処理入門」を参照してください。
サンプル

imageの上のCorrelationCommandを実行します、そして、相関関係フィルタを適用します。

Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

   
Public Sub CorrelationCommandExample()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True
   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"))

   ' Prepare the command
   Dim points() As LeadPoint
   ReDim points(89)

   Dim DstImage As RasterImage = leadImage.Clone()
   Dim command As CorrelationCommand = New CorrelationCommand
   command.CorrelationImage = DstImage
   command.Threshold = 70
   command.XStep = 1
   command.YStep = 1
   command.Points = points
   'Apply the correlation filter.
   command.Run(leadImage)

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 CorrelationCommandExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"));

   // Prepare the command
   RasterImage DstImage = image.Clone();
   CorrelationCommand command = new CorrelationCommand();
   command.CorrelationImage = DstImage;
   command.Threshold = 70;
   command.XStep = 1;
   command.YStep = 1;
   command.Points = new LeadPoint[90];
   //Apply the correlation filter.
   command.Run(image);

}

static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
function CorrelationCommandExample()
{
   var codecs = new Leadtools.Codecs.RasterCodecs();
   codecs.throwExceptionsOnInvalidImages = true;

   // Load the image
   var srcFileName = "Assets\\Image1.cmp";
   return Tools.AppInstallFolder().getFileAsync(srcFileName).then(function (loadFile) {
      return codecs.loadAsync(Leadtools.LeadStreamFactory.create(loadFile));
   }).then(function (image) {
      // Prepare the command
      with (Leadtools.ImageProcessing.Core) {
         var DstImage = image.clone();
         var command = new CorrelationCommand();
         command.correlationImage = DstImage;
         command.threshold = 70;
         command.xStep = 1;
         command.yStep = 1;
         command.points = new Array();
         //Size the array to 90
         for (var i = 0; i < 90; i++)
            command.points[i] = Leadtools.LeadPointHelper.create(0, 0);

         //Apply the correlation filter.
         command.run(image);
      }
   });
}
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;

      
public async Task CorrelationCommandExample()
{
   // 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
   RasterImage DstImage = image.Clone();
   CorrelationCommand command = new CorrelationCommand();
   command.CorrelationImage = DstImage;
   command.Threshold = 70;
   command.XStep = 1;
   command.YStep = 1;
   command.Points = new LeadPoint[90];
   //Apply the correlation filter.
   command.Run(image);

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

public void CorrelationCommandExample(RasterImage image, Stream outStream)
{
   // Prepare the command
   RasterImage DstImage = image.Clone();
   CorrelationCommand command = new CorrelationCommand();
   command.CorrelationImage = DstImage;
   command.Threshold = 70;
   command.XStep = 1;
   command.YStep = 1;
   command.Points = new LeadPoint[90];
   //Apply the correlation filter.
   command.Run(image);
   // Save result image
   RasterCodecs codecs = new RasterCodecs();
   codecs.Save(image, outStream, RasterImageFormat.Jpeg, 24);
   image.Dispose();
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

Public Sub CorrelationCommandExample(ByVal image As RasterImage, ByVal outStream As Stream)
   ' Prepare the command
   Dim DstImage As RasterImage = image.Clone()
   Dim command As CorrelationCommand = New CorrelationCommand()
   command.CorrelationImage = DstImage
   command.Threshold = 70
   command.XStep = 1
   command.YStep = 1
   command.Points = New LeadPoint(89){}
   'Apply the correlation filter.
   command.Run(image)
   ' Save result image
   Dim codecs As RasterCodecs = New RasterCodecs()
   codecs.Save(image, outStream, RasterImageFormat.Jpeg, 24)
   image.Dispose()
End Sub
必要条件

ターゲットプラットホーム

参照

参照

CorrelationCommandメンバ
Leadtools.ImageProcessing.Core名前空間
LEADTOOLSによる画像処理入門
Leadtools.ImageProcessing.Color.IntensityDetectCommand
Leadtools.ImageProcessing.Effects.SpatialFilterCommand
Leadtools.ImageProcessing.Effects.BinaryFilterCommand
MaximumCommandクラス
MinimumCommandクラス