crop_img: crop_img

Description Usage Arguments Details Value Examples

View source: R/crop_img.R

Description

Crops temperature data to the desired area.

Usage

1
crop_img(img, crop_poly = NULL, rtn_format = "matrix")

Arguments

img

A numeric temperature matrix (such as that returned from Thermimage::raw2temp) or raster.

crop_poly

If polygon of cropping area is already defined, supply here. Defaults to NULL.

rtn_format

Desired format ('matrix' or 'raster') of the area returned after cropping. Defaults to 'matrix'.

Details

Unless the cropping polygon is already available, function requires user input to iteratively refine the size, location and angle (optional) of the cropping area.

Value

A cropped version of the input image.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Crop thermal image of wasp nest to the nest only
# N.B. For this example, a good approximation is an ellipse with
# origin coordinates at x = 350, y = 290, x-axis radius of 145
# and y-axis radius of 190.

## Not run: 
cropped <- crop_img(img = waspnest_mat)

# Get patches
crop_patches <- get_patches(cropped)

# Plot with patches
plot_patches(df = crop_patches$df,
             patches = crop_patches$patches,
             plot_distribution = FALSE)

## End(Not run)

rasenior/PatchStatsFLIR documentation built on Oct. 28, 2020, 11:53 p.m.