R/RcppExports.R

Defines functions extractEdgeMap fillGlare extractAnnulus findPath

Documented in extractAnnulus extractEdgeMap fillGlare findPath

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' findPath
#' 
#' This function returns a NumeriMatrix, identifying the optimal edge
#' Using the A* algorithm on a canny edge matrix weighted by a neural network
#' The traversal balances clarity/smoothness of the edge against the network evaluation 
#'
#' @param edge Weighted canny edge matrix
#' @param startx Starting pixel x component
#' @param starty Starting pixel y component
#' @param endx Ending pixel x component
#' @param endy Ending pixel y component
#' @param minX Left boundary
#' @param maxX Right boundary
#' @param minY Upper boundary
#' @param maxY Lower boundary
#' @param proximity Distance to ending coordinate at which trace can terminate
findPath <- function(edge, startx, starty, endx, endy, minX, maxX, minY, maxY, proximity) {
    .Call(`_finFindR_findPath`, edge, startx, starty, endx, endy, minX, maxX, minY, maxY, proximity)
}

#' extractAnnulus
#' 
#' This function returns a cimg wrapped as NumeriMatrix.
#' Contains simplified image reduced to relevant identifying features.
#' Features represent 16 point ring from around each coordinate
#' The x component in the returned cimg represents each coordinate
#' The y component from the returned cimg represents each sample from the 16 point ring
#'
#' @param imageFromR cimg wraped as NumericVector
#' @param xCoordinates x pixel coordinates for data extraction
#' @param yCoordinates y pixel coordinates for data extraction
#' @export
extractAnnulus <- function(imageFromR, xCoordinates, yCoordinates) {
    .Call(`_finFindR_extractAnnulus`, imageFromR, xCoordinates, yCoordinates)
}

#' fillGlare
#' 
#' This function returns a cimg wrapped as NumeriMatrix.
#' Using a smoothing kernel, highlights are filled in based on the neighboring values.
#' Iteratively fills in from outer edge inward.
#' Image should have glare cliped to 0 already
#'
#' @param imageFromR cimg wraped as NumericVector
#' @param highlightCoordinates Coordinates to fill in
#' @param aveThresh Weighted sum, representing minimum number of neighboring non 0 pixels
#' @export
fillGlare <- function(imageFromR, highlightCoordinates, aveThresh = 7L) {
    .Call(`_finFindR_fillGlare`, imageFromR, highlightCoordinates, aveThresh)
}

#' extractEdgeMap
#' 
#' This function returns a cimg wrapped as NumeriMatrix.
#' using the gradient magnitude in the x and y directions,
#' estimated by the imager function \code{imgradient}
#' and the greadient angles
#' estimated as atan(dy/dx) and subsequently simplified and discretized
#' the canny edges are calculated, 
#' defined as the points in the gradient magnitude map that are 
#' greater than the 4(of the 8 posible) neighbors, orthogonal to the estimated angle
#'
#' @param gradientFromR cimg wraped as NumericVector
#' @param anglesFromR cimg wraped as NumericVector
#' @export
extractEdgeMap <- function(gradientFromR, anglesFromR) {
    .Call(`_finFindR_extractEdgeMap`, gradientFromR, anglesFromR)
}
haimeh/finFindR documentation built on July 17, 2021, 12:56 a.m.