IMcPatternMatchingTranspose Method |
![]() |
Namespace: MediaCy.IQL.Align
Function Transpose ( <OptionalAttribute> vSourceImg As Object ) As McImage
'example of FFT cross-correlation Sub CrossCorrelationTest() Dim Im1 As McImage Dim Im2 As McImage 'images must be the same size and power of 2 Set Im1 = ThisApplication.Images.Open(Path & "\Images\SPOTS.TIF").Geometry.Resize(512, 512, mcsmNone).Convert(mciqtFloat) 'search pattern image Set Im2 = ThisApplication.Images.Open(Path & "\Images\SPOTS1.TIF").Geometry.Resize(512, 512, mcsmNone).Convert(mciqtFloat) Dim FFT1 As McImage Dim FFT2 As McImage Set FFT1 = Im1.fft.Forward(mcfoPolar) Set FFT2 = Im2.fft.Forward(mcfoPolar) Dim Out1 Dim Out2 Out1 = FFT1.ColorModel.ExtractMultipleChannels Out2 = FFT2.ColorModel.ExtractMultipleChannels Dim tIm1 As McImage Dim tIm2 As McImage Set tIm1 = Out1(0) Set tIm2 = Out2(0) tIm1.Op.MultEx tIm2 'multiply magnitudes Set tIm1 = Out1(1) Set tIm2 = Out2(1) tIm1.Op.SubEx tIm2 'subtract phases FFT1.ColorModel.MergeMultipleChannels Out1 FFT1.fft.Inverse FFT1, Im1 Windows(Im1).Activate 'set correct display range Set tempHistogram = Im1.Histogram tempHistogram.Interpretation = mciMonochrome Im1.RangeMin = tempHistogram.AbsoluteRange(-1)(0, 0) Im1.RangeMax = tempHistogram.AbsoluteRange(-1)(1, 0) 'transpose quadrants Im1.PatternMatching.Transpose End Sub