Visual functions

clean_signature

clean_signature(image)

Gets an image patch of the input value as a base64-encoded string.

Args:
    image (Value[Text]): A provenance-tracked value of extracted image to clean

Returns:
    Returns a base64-encoded string of the extracted and cleaned image patch

Examples:
    clean_signature(list_get(match(INPUT_COL, '[SIGN]'), 0))
    -> '/9j/4AAQSkZ...'

detect_checkbox

detect_checkbox(anchors, relative_positions)

See docs for detect_checkbox_fn_v

detect_signature

detect_signature(anchors, relative_positions)

See docs for detect_signature_fn_v

extract_image_crop

extract_image_crop(value)

Gets an image patch of the input value as a base64-encoded string.

Args:
    value (Value[Text]): A provenance-tracked value to extract a patch of

Returns:
    Returns a base64-encoded string of the extracted image patch

Examples:
    extract_image_crop(list_get(match(INPUT_COL, '[SIGN]'), 0))
    -> '/9j/4AAQSkZ...'

image_crop_relative

image_crop_relative(anchors, relative_positions)

Gets an image patch relative to an anchor as a base64-encoded string

Args:
    anchors (List<Value>): An n-length list of provenance-tracked anchors
    relative_positions (List<List<float>>): An n-length list of lists that define a relative
      positions. Each relative position uses the format [top-left x, top-left y,
      bottom-right-x, bottom-right-y]

Returns:
    Returns a base64-encoded string of the extracted image patch

Examples:
    image_crop_relative([list_get(match(INPUT_COL, 'Anchor'), 0)], [[-2, 0.05,
      -1, 1.05]]) -> '/9j/4AAQSkZJRgABA...'

image_decode_checkbox

image_decode_checkbox(image)

Determines whether an image of just a checkbox is checked

Args:
    image (str): A base64-encoded string that only contains a checkbox

Returns:
    Returns True if the checkbox is checked and false if it is not

Examples:
    image_decode_checkbox('/9j/4AAQSkZ...') -> True

image_decode_signature

image_decode_signature(image)

Determines whether an image of just a signature is signed

Args:
    image (str): A base64-encoded string that only contains a signature region

Returns:
    Returns True if the region is signed

Examples:
    image_decode_signature('/9j/4AAQSkZ...') -> True

match_signature

match_signature(test_image, ref_image)

Gets two image patches of the input value as a base64-encoded string and matches them.

Args:
    test_image (Value[Text]): A provenance-tracked value of extracted and cleaned test signature image
    ref_image (Value[Text]): A value of ref signature image to match against

Returns:
    Returns a match score in [0,1]

Examples:
    match_signature(list_get(match(INPUT_COL, '[SIGN]'), 0), ref_sign_field)
    -> 0.89