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

フレームを表示

CorrelationListCommandクラス








メンバ 
リスト内の画像を、画像内の同じサイズのすべての領域と比較し、相関の測定値に従って一致するこれらの部分を見つけます。このメソッドは、Document/Medicalツールキットで利用できるだけです。
オブジェクトモデル
構文
'Declaration
 
Public Class CorrelationListCommand 
   Inherits Leadtools.ImageProcessing.RasterCommand
   Implements Leadtools.ImageProcessing.IRasterCommand 
'Usage
 
Dim instance As CorrelationListCommand
public sealed class CorrelationListCommand : Leadtools.ImageProcessing.IRasterCommand  
@interface LTCorrelationListCommand : LTRasterCommand
public class CorrelationListCommand extends RasterCommand
function Leadtools.ImageProcessing.Core.CorrelationListCommand()
public ref class CorrelationListCommand : public Leadtools.ImageProcessing.RasterCommand, Leadtools.ImageProcessing.IRasterCommand  
解説

LEADTOOLSのSilverlightバージョンにおいて、RasterImageオブジェクトのための画像データがSilverlight WriteableBitmapを用いて内部的に保存されるならば、この画像処理コマンドは失敗しますオブジェクト。詳細については、「Silverlightの画像処理コマンド限界」を参照してください。

サンプル

imageの上でCorrelationListCommandを実行します。

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

   
Public Sub CorrelationListCommandExample()
   ' Load an image
   Dim codecs As RasterCodecs = New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True
   Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"))

   Dim command As CorrelationListCommand = New CorrelationListCommand()
   Dim copyRectangle As CopyRectangleCommand = New CopyRectangleCommand()

   Dim rc_cor As LeadRect = New LeadRect(327, 378, 22, 28)
   copyRectangle.Rectangle = rc_cor
   copyRectangle.Run(image)
   command.CorrelationImage = copyRectangle.DestinationImage.Clone()

   rc_cor = New LeadRect(283, 378, 22, 28)
   copyRectangle.Rectangle = rc_cor
   copyRectangle.Run(image)
   command.CorrelationImage.AddPage(copyRectangle.DestinationImage.Clone())

   Dim points(30) As LeadPoint
   Dim listIndex(30) As Integer

   command.Points = points
   command.ListIndex = listIndex
   command.Threshold = 90
   command.XStep = 1
   command.YStep = 1
   command.Run(image)

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;
using Leadtools.ImageProcessing.Core;

      
public void CorrelationListCommandExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"));

   CorrelationListCommand command = new CorrelationListCommand();
   CopyRectangleCommand copyRectangle = new CopyRectangleCommand();

   LeadRect rc_cor = new LeadRect(327, 378, 22, 28);
   copyRectangle.Rectangle = rc_cor;
   copyRectangle.Run(image);
   command.CorrelationImage = copyRectangle.DestinationImage.Clone();

   rc_cor = new LeadRect(283, 378, 22, 28);
   copyRectangle.Rectangle = rc_cor;
   copyRectangle.Run(image);
   command.CorrelationImage.AddPage(copyRectangle.DestinationImage.Clone());

   command.Points = new LeadPoint[30];
   command.ListIndex = new int[30];
   command.Threshold = 90;
   command.XStep = 1;
   command.YStep = 1;
   command.Run(image);

}

static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
function CorrelationListCommandExample()
{
   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 command = new CorrelationListCommand();
         var copyRectangle = new Leadtools.ImageProcessing.CopyRectangleCommand();

         var rc_cor = Leadtools.LeadRectHelper.create(327, 378, 22, 28);
         copyRectangle.rectangle = rc_cor;
         copyRectangle.run(image);
         command.correlationImage = copyRectangle.destinationImage.clone();

         rc_cor = Leadtools.LeadRectHelper.create(283, 378, 22, 28);
         copyRectangle.rectangle = rc_cor;
         copyRectangle.run(image);
         command.correlationImage.addPage(copyRectangle.destinationImage.clone());

         command.points = new Array();
         //Size the array to 30
         for (var i = 0; i < 30; i++)
            command.points[i] = Leadtools.LeadPointHelper.create(0, 0);

         command.listIndex = new Array();
         //Size the array to 30
         for (var i = 0; i < 30; i++)
            command.listIndex[i] = 0;

         command.threshold = 90;
         command.xStep = 1;
         command.yStep = 1;
         command.run(image);
      }
   });
}
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing;

      
public async Task CorrelationListCommandExample()
{
   // 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));

   CorrelationListCommand command = new CorrelationListCommand();
   CopyRectangleCommand copyRectangle = new CopyRectangleCommand();

   LeadRect rc_cor = LeadRectHelper.Create(327, 378, 22, 28);
   copyRectangle.Rectangle = rc_cor;
   copyRectangle.Run(image);
   command.CorrelationImage = copyRectangle.DestinationImage.Clone();

   rc_cor = LeadRectHelper.Create(283, 378, 22, 28);
   copyRectangle.Rectangle = rc_cor;
   copyRectangle.Run(image);
   command.CorrelationImage.AddPage(copyRectangle.DestinationImage.Clone());

   command.Points = new LeadPoint[30];
   command.ListIndex = new int[30];
   command.Threshold = 90;
   command.XStep = 1;
   command.YStep = 1;
   command.Run(image);

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

public void CorrelationListCommandExample(RasterImage image, Stream outStream)
{
   CorrelationListCommand command = new CorrelationListCommand();
   CopyRectangleCommand copyRectangle = new CopyRectangleCommand();
   LeadRect rc_cor = new LeadRect(327, 378, 22, 28);
   copyRectangle.Rectangle = rc_cor;
   copyRectangle.Run(image);
   command.CorrelationImage = copyRectangle.DestinationImage.Clone();

   rc_cor = new LeadRect(283, 378, 22, 28);
   copyRectangle.Rectangle = rc_cor;
   copyRectangle.Run(image);
   command.CorrelationImage.AddPage(copyRectangle.DestinationImage.Clone());

   command.Points = new LeadPoint[30];
   command.ListIndex = new int[30];
   command.Threshold = 90;
   command.XStep = 1;
   command.YStep = 1;
   command.Run(image);

   // Save result image
   RasterCodecs codecs = new RasterCodecs();
   codecs.Save(image, outStream, RasterImageFormat.Jpeg, 24);
   image.Dispose();
}
Imports Leadtools
Imports Leadtools.ImageProcessing
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

Public Sub CorrelationListCommandExample(ByVal image As RasterImage, ByVal outStream As Stream)
   Dim command As CorrelationListCommand = New CorrelationListCommand()
   Dim copyRectangle As CopyRectangleCommand = New CopyRectangleCommand()
   Dim rc_cor As LeadRect = New LeadRect(327, 378, 22, 28)
   copyRectangle.Rectangle = rc_cor
   copyRectangle.Run(image)
   command.CorrelationImage = copyRectangle.DestinationImage.Clone()

   rc_cor = New LeadRect(283, 378, 22, 28)
   copyRectangle.Rectangle = rc_cor
   copyRectangle.Run(image)
   command.CorrelationImage.AddPage(copyRectangle.DestinationImage.Clone())

   command.Points = New LeadPoint(29){}
   command.ListIndex = New Integer(29){}
   command.Threshold = 90
   command.XStep = 1
   command.YStep = 1
   command.Run(image)

   ' Save result image
   Dim codecs As RasterCodecs = New RasterCodecs()
   codecs.Save(image, outStream, RasterImageFormat.Jpeg, 24)
   image.Dispose()
End Sub
必要条件

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

参照

参照

CorrelationListCommandメンバ
Leadtools.ImageProcessing.Core名前空間
Leadtools.ImageProcessing.Color.IntensityDetectCommand
Leadtools.ImageProcessing.Effects.SpatialFilterCommand
Leadtools.ImageProcessing.Effects.BinaryFilterCommand
MaximumCommandクラス
MinimumCommandクラス
CorrelationCommandクラス