average_reducing: Reducing size of an image using the method of averaging in...

Description Usage Arguments Details Value Note Examples

View source: R/average_reducing.R

Description

This function is used for reducing size of an image by averaging its pixels in blocks.

Usage

1
average_reducing(image, block_nrow = 2, block_ncol = 2)

Arguments

image

a pixel matrix or an array of the image for processing.

block_nrow

an integer number, needed to be divisible by number of rows of the pixel-arrary of the image.

block_ncol

an integer number, needed to be divisible by number of columns of the pixel-arrary of the image.

Details

This function is used to reduce the size of an image by dividing the original array into several blocks and calculate the average values within each block.

Value

pixel array of the reduced image.

Note

block_nrow and block_ncol must be divisible by number of rows and columns of the pixel-arrary of the image, respectively. Otherwise, Errors will be reported as: "block_nrow(block_ncol) must be divisible by number of rows(columns) of the pixel-arrary of the image."

Examples

1
2
image1 = average_reducing(image1,2,2)
writePNG(image1,"~/Desktop/Visible/imagereduce.png")

rwang14/implant documentation built on Dec. 9, 2019, 6:36 p.m.