updateROI: Update pixels included in a ROI of different pixel size

View source: R/updateROI.R

updateROIR Documentation

Update pixels included in a ROI of different pixel size

Description

This function allows to apply an already drawn ROI to the same image but with different resolution.

Usage

updateROI(old.roi, new.img)

Arguments

old.roi

The roi object

new.img

An image array as read by readJPEG

Details

This function allows to extract pixel information in a ROI on images of different quality with respect to the one where the ROI was first drawn. The typical use of this function is to work on resized (smaller) images. Typically you draw a ROI on your best quality image (say 640 x 480 pixels) and process your images to extract vegetation indexes. But if you then want to use the function spatialGreen to perform a pixel based analysis you have to reduce image size because the analysis is computationally extremely intense. See spatialGreen for more details on computation time. Hence, you typically degradate your image (say to 320 x 240 pixels). The function applies ROI vertices to the new, resized image and returns pixels in the ROI of the new image size.

Author(s)

Gianluca Filippa <gian.filippa@gmail.com>


phenopix documentation built on Aug. 9, 2023, 5:10 p.m.