Learn R Programming

CropDetectR (version 0.0.1)

crop_lines: Find crop lines of an image

Description

Finds the crop row lines of an image. It uses other functions in the package such as: smoothing, localMaxima, and localMinima.

Usage

crop_lines(picture_list, final_ratio, best_image, intensity)

Arguments

picture_list

One or more images created from rotating the same image.

final_ratio

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

best_image

The output of the best_rotations function.

intensity

The amount of smoothing of the image.

Value

A vector of x-axis values for a given image.

Details

This function takes in: one or more images, a ratio that will become the threshold of what qualifies as a crop row, the index from best_rotation of what the best image was, and the intensity of smoothening from smoothing. It then uses the ratio as the threshold for acceptable crop rows and makes a list of the x-axis values.

Examples

Run this code
# NOT RUN {
crop_positions <- crop_lines(picture_list, 0.5, best_image, 0.25)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab