Skip to content

Median Filter#

The Median Filter camera feature allows you to reduce noise in your images.

Using the Feature#

General Information#

The median filter is multi-directional and 3x3 weighted. It can be used on mono and color cameras.

Enabling the Median Filter#

Set the MedianFilter parameter to true.

Sample Code#

// Enable the median filter
// Disable the median filter
INodeMap& nodemap = camera.GetNodeMap();
// Enable the median filter
CBooleanParameter(nodemap, "MedianFilter").SetValue(true);
// Disable the median filter
CBooleanParameter(nodemap, "MedianFilter").SetValue(false);
// Enable the median filter
// Disable the median filter
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Enable the median filter */
errRes = PylonDeviceSetBooleanFeature(hdev, "MedianFilter", 1);
/* Disable the median filter */
errRes = PylonDeviceSetBooleanFeature(hdev, "MedianFilter", 0);

You can also use the pylon Viewer to easily set the parameters.