Home Image-Pro Plus Automation with Macros

LowPassFilter Kernel

HI all, 

We realized that the outcome of the Low Pass filter changed from version 9.1.5 to 9.3. 

We use this script part below to subtract a low pass image from the original to correct background in some cases. 
(note that your inbuilt BG correction function do not always work on large images and even worse without throwing an error)

Anyway the method below leads to different results in the two version. 

Can we harmonize? Is there a way to get the Kernel into it? (did not find a valid command for that). 
Or is there a library I could add to 9.1.5?
Public Function LPBGCorrect() As SimpleScript
        LPBGCorrect = New SimpleScript

        Dim  doc3, image1, doc2, image2, window1,
     Dim LPFiltersize = 1001
With Application.DocumentCommands.Active(LPBGCorrect) .Run(doc3) End With With Adjust.ImageCommands.Duplicate(LPBGCorrect) .Name = "Temp" .Visible = True .Run(doc3, image1) End With With Application.DocumentCommands.Activate(LPBGCorrect) .Run(image1, doc2) End With With Process.Filter.LargeCommands.LowPassLarge(LPBGCorrect) .Passes = 1 .Width = LPFiltersize .Height = LPFiltersize .LockWidthHeight = True .Run(image1, image1) End With With Application.DocumentCommands.Activate(LPBGCorrect) .Run(doc3, doc3) End With With Process.ProcessCommands.Operations(LPBGCorrect) .Operation = eOperation.Subtract .NumberValue = 0R .ResultType = eResultType.Apply .Run(doc3, image1, image2) End With With Application.DocumentCommands.Activate(LPBGCorrect) .Run(doc2, doc2) End With With Application.WindowCommands.Define(LPBGCorrect) .Run(doc2, window1) End With With Application.WindowCommands.Close(LPBGCorrect) .Run(window1) End With With Application.DocumentCommands.Activate(LPBGCorrect) .Run(doc3, doc3) End With End Function
Many thanks

Daniel

Best Answer

  • Answer ✓
    Hi Daniel,

    The filter algorithm was not changed, what could be changed is the bit-depth of the processing. The old versions always used "Process in Float", while the new version gives user a choice defaulting to Off (to use less RAM). For most filters the difference is insignificant, but if you want to have absolutely the same results as in the old version, you should activate "Process Large and 3D Filters in Float" option (Advanced page of the Application options, Memory Management group).



    Yuri

Answers

  • Yes that was the perfect answer - indeed that was the case.

    Many thanks

    Dan
Sign In or Register to comment.