Color_Exchange: Exchanging the color of the background and the foreground.

Description Usage Arguments Details Value Examples

Description

This function exchanges the color of the background and the foreground for a binary image.

Usage

1

Arguments

image1

A binary matrix of a segmented image

Details

Exchange 0 and 1 in the input binary matrix.

Value

A binary matrix with exchanged background and the foreground.

Examples

1
2
3
4
5
6
7
8
#read an RGB image
library(png)
image = readPNG(system.file("extdata", "image1.png",
                             package = "implant",
                             mustWork = TRUE))[ , ,c(1:3)]
imageB = imageBinary(image,  weight = c(-1, 2, -1),
threshold1 = 30 / 255, threshold2 = 0.05)
color_exchange(imageB)

rwang14/implant documentation built on Sept. 6, 2020, 3:21 a.m.