Description Usage Arguments Details Value Examples
This function exchanges the color of the background and the foreground for a binary image.
| 1 | color_exchange(image1)
 | 
| image1 | A binary matrix of a segmented image | 
Exchange 0 and 1 in the input binary matrix.
A binary matrix with exchanged background and the foreground.
| 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)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.