smooth_histogram {OtsuSeg}R Documentation

Smooth Histogram Data

Description

This is an internal function that applies a moving average filter to smooth a histogram. It is not intended for direct use by package users.

Usage

smooth_histogram(hist_counts, window_size = 5)

Arguments

hist_counts

A numeric vector of histogram bin counts.

window_size

An integer specifying the smoothing window size (default is 5).

Value

A numeric vector of smoothed histogram counts.

Examples


  raw_counts <- hist(rnorm(1000), plot = FALSE)$counts
  smoothed <- smooth_histogram(raw_counts)
  plot(smoothed, type = "l", col = "blue")


[Package OtsuSeg version 0.1.0 Index]