Description Usage Arguments Author(s) Examples
View source: R/create.new.color.R
Function to calculate the euclidean distance of each pixel to one selected pixel
1 | create.new.color(data, x, y, func)
|
data |
a 3D array, basically create by the function f.read.image |
x |
the x coordonate of the picture (x is the second dimension) |
y |
the y coordonate of the picture (y is the first dimension and start from the top, dont ask why) |
Dimitri Fichou
1 2 3 4 5 6 7 | data <- f.read.image('www/rTLC_demopicture.JPG',format='jpeg',native=F) %>% redim.array(256)
par(mfrow=c(2,1),oma=c(0,0,0,0),mar=c(0,0,1,0),xaxt='n',yaxt='n')
x=180;y=70;
data %>% raster(main='original')
text(x=x,y=y,labels='X',col='red')
data %>% create.new.color(x,y) %>% normalize %>% raster(main='New color')
text(x=x,y=y,labels='X',col='red')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.