point2image: Point To Image

Description Usage Arguments Value Examples

View source: R/util_helper.R

Description

Transforms a 3 point based on a projection and world to camera matrix into the NPC space.

Usage

1
point2image(x, projection, worldToCamera)

Arguments

x

Vector in 3D.

projection

Matrix describing the camera projection.

worldToCamera

Matrix describing the camera position.

Value

x in NPC space.

Examples

1
2
3
4
x <- c(1,2,3)
projection <- matrix(c(1,0,0,0,0,1,0,0,0,0,1,-1,0,0,0,1),nrow=4,ncol = 4, byrow = TRUE)
worldToCamera <- matrix(c(-1,0,0,-25,0,0,-1,0,0,1,0,-30,0,0,0,1),nrow=4,ncol = 4, byrow = TRUE)
npc_coordinates <- point2image(x)

cog-ethz/evertools documentation built on April 1, 2020, 10:30 p.m.