Skip to content

medianFilter1D returns same array of sensor readings if len < windowSize #1

@dcyoung

Description

@dcyoung

The method Processing.Filtering.medianFilter1D() method returns the same array of sensor readings if the array is smaller than the filter window:

if (len < k)
    return sensorReadings;

This is an edge case, but the method is supposed to return a new array of filtered values regardless. If the user's code expects to be able to augment the returned values without disrupting the original array, this could prove problematic. Method should return a newly created or deep copied array instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions