best_rotation: Find the best rotated image for crop row detection

Description Usage Arguments Details Value Examples

View source: R/best_rotation.R

Description

Analyzes the list of rotated images of crop rows and finds the best angle of rotation for row detection.

Usage

1
best_rotation(picture_list, ratio, intensity)

Arguments

picture_list

One or more images created from rotating the same image.

ratio

Any number, typically (0-1) that will be the ratio needed to determine a true crop row.

intensity

The amount of smoothing of the image.

Details

This takes in a list of images and looks at the average of each column in the form of an arry. Ideally the image is black and white, with crops being white, so the range of numbers in the array 0,1.

The function then smooths out the array using smoothing so the local minima and maximas using (localMaxima and localMaxima) are more pronounced, then creates two vectors of the local min/max of each image. Then the ratio between neighbor local minima and maxima are calculated and compared to a threshold given by the user. If the found ratio is larger than the threshold the ratio is counted.

Value

The index of the image with the most good ratios (ratios that exceed the given threshold).

Examples

1
best_image <- best_rotation(picture_list, 0.5, 0.25)

niconaut/crop.row.finder documentation built on June 29, 2020, 6:10 a.m.