OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

imgUserfilter

Contents

Menu Information

User Filter

Brief Information

Apply user defined filter

Additional Information

This feature is for OriginPro only.

Command Line Usage

1. imgUserfilter fltm:=[Mbook4]Msheet1!Mat(1);

2. imgUserfilter fltm:=[Mbook4]Msheet1!Mat(1) offset:=2 dv :=10 type:=max;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Matrix img

Input

Image

<active>

Specifies the source image to be manipulated. The default input is the active image.

Output Image oimg

Output

Image

<input>

Specifies the output image. By default, the output image is the same as the input image. See the syntax here.

Filter Matrix fltm

Input

MatrixObject

<unassigned>

Specifies the matrix that represents the mask used for filtering.

Offset offset

Input

int

0

Specifies a value used to offset the final result of the output.

Divisor dv

Input

int

1

Specifies a value used to divide the final result of the output.

Operation Type type

Input

int

sum

Specifies the type of operation used to get the filtering output.

Option list

  • sum:Sum
Performs sum operation.
  • max:Maximum
Performs maximum operation.
  • min:Minimum
Performs minimum operation.

Description

The imgUserfilter function filters the input image using a user-defined mask. With this function you can create a user-defined filter and apply it to the image.

Examples

In this example, we use the imgUserfilter function to apply a user-defined filter to the input image:

  1. Create a new matrix for the mask.
  2. From the menu, select Matrix: Set Dimensions to open the dialog of mdim. Set Columns to 3 and Rows to 3. Click OK to close the dialog.
  3. Enter the values for this matrix as the screenshot below:
    Image:imgUserfilter_help_English_files_image002.jpg
  4. Create another matrix and import myocyte2.tif under \Samples\Image Processing and Analysis folder into it.
  5. When this image is active, select Image: Spatial Filters: User Filter to open the dialog of the imgUserfilter X-Function.
  6. In the dialog, change the settings as the screenshot below and click OK to close the dialog.
    Image:imgUserfilter_help_English_files_image004.jpgA new image is created. We can see that the edges and details are enhanced.
Image:imgUserfilter_help_English_files_image006.jpg
Image:imgUserfilter_help_English_files_image008.jpg
The original image
The output image


Algorithm

The computation uses L_UserFilterBitmap() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_UserFilterBitmap topic.

References

LEADTOOLS Main API Help file, Version 14

Related X-Functions

imgMedian, imgAverage, imgSharpen