Learn R Programming

CropDetectR (version 0.0.1)

smoothing: Smooth the average of binary picture column values

Description

Reads in an image and takes the average column value then smooths the array for more defined local maximas and minimas.

Usage

smoothing(picture, intensity)

Arguments

picture

The binary image.

intensity

The intensity of smoothening of the vector.

Value

A smoothed vector.

Details

The function reads in an image as a data frame then takes the mean of each column within the picture. Since the image is binary the mean will have a value between [0,1], with one being all white. It then uses https://www.rdocumentation.org/packages/stats/versions/3.6.1/topics/smooth.spline smooth.spline to get rid of jagged portions for more defined local maximas and minimas.

Examples

Run this code
# NOT RUN {
smoothed_vector <- smoothing(picture, intensity)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab