create.new.color: Function to calculate the euclidean distance of each pixel to...

Description Usage Arguments Author(s) Examples

View source: R/create.new.color.R

Description

Function to calculate the euclidean distance of each pixel to one selected pixel

Usage

1
create.new.color(data, x, y, func)

Arguments

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)

Author(s)

Dimitri Fichou

Examples

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')

DimitriF/DLC documentation built on Oct. 14, 2020, 4:33 p.m.