Description Usage Arguments Details Value Examples

View source: R/best_rotation.R

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

1 | ```
best_rotation(picture_list, ratio, intensity)
``` |

`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. |

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.

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

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.