image_prepare: Prepare an image

View source: R/utils_mapedit.R

image_prepareR Documentation

Prepare an image

Description

This function aligns and crops the image using either base or mapview visualization. This is useful to prepare the images to be analyzed with analyze_objects_shp()

Usage

image_prepare(img, viewer = get_pliman_viewer())

Arguments

img

An optional Image object

viewer

The viewer option. If not provided, the value is retrieved using get_pliman_viewer(). This option controls the type of viewer to use for interactive plotting. The available options are "base" and "mapview". If set to "base", the base R graphics system is used for interactive plotting. If set to "mapview", the mapview package is used. To set this argument globally for all functions in the package, you can use the set_pliman_viewer() function. For example, you can run set_pliman_viewer("mapview") to set the viewer option to "mapview" for all functions.

Value

The alighed/cropped image for further visualization or analysis.

Examples

# Example usage:
if(interactive()){
img <- image_pliman("mult_leaves.jpg")
image_prepare(img, viewer = "mapview")
}

pliman documentation built on Oct. 15, 2023, 1:06 a.m.

Related to image_prepare in pliman...