def METHOD_NAME(diff, reference_dem, epsg, min_height, min_area):
     # Calculate contours
    contours, _ = cv2.findContours(diff, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    # Convert contours into features
    features = [map_contour_to_geojson_feature(contour, diff, epsg, reference_dem, min_height) for contour in contours]
    # Keep features that meet the threshold
    features = [feature for feature in features if feature.properties['area'] >= min_area]
    # Write the GeoJSON to a string
    return dumps(FeatureCollection(features))