Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Static Public Member Functions | List of all members
BIAS::RescaleTransfer Class Reference

Transfer of pixel coordinates for pixel centric reference systems. More...

#include <Filter/RescaleTransfer.hh>

Static Public Member Functions

static void Down (const double &x, const double &y, const double &factor, double &new_x, double &new_y)
 transfer to smaller image if factor > 1. More...
 
static void Down (const Vector2< double > &src, const double &factor, Vector2< double > &dst)
 transfer to smaller image if factor > 1. More...
 
static void Down (const HomgPoint2D &src, const double &factor, HomgPoint2D &dst)
 transfer to smaller image if factor > 1. More...
 
static void Up (const double &x, const double &y, const double &factor, double &new_x, double &new_y)
 transfer to bigger image if factor > 1. More...
 
static void Up (const Vector2< double > &src, const double &factor, Vector2< double > &dst)
 transfer to bigger image if factor > 1. More...
 
static void Up (const HomgPoint2D &src, const double &factor, HomgPoint2D &dst)
 transfer to bigger image if factor > 1. More...
 

Detailed Description

Transfer of pixel coordinates for pixel centric reference systems.

In the BIAS library the pixel coordinate system has its origin at the physical center of the upper left pixel. I dub this the pixel centric coordinate system. Defining the pixel coordinate system in such a way has the huge advantage, that integer pixel coordinates can directly be mapped to memory adresses, for example the grey value of the pixel at (0,0) directly coincides with the value stored at Image.GetImageData()[0].

The pixel centric reference frame has however also a number of catches:

  1. Often the principal point is assumed to be at the center of the imaging chip. The coordinates of the center location in the pixel centric coordinate system are given by (width/2-0.5, height/2-0.5) which at first glance looks a little bit funny. (If you dont believe me, make a small sketch and see for yourself ;-)
  2. Matching coordinates between two differently scaled images is not straight forward. This class aims at providing functionality for this task at a single central location. The rescaled image can be seen as captured by an imaginary camera with almost the same "Eigenschaften" as the true camera. Particularily the physical dimensions of the imaging chip remain the same. The only difference the true imaging chip and the imaginary imaging chip is the number and the size of the photo-cells representing a single pixel. Hence the number of pixels on the two imaging chips differ.

    This results in the basic fact that the boundaries of the two images are invariant. The coordinates of the upper left corner of the imageing chip in the pixel centric reference frame is given by (-0.5, -0.5), no matter which resolution is chosen. The basic underlying "Forderung" leads to somewhat awkward formula for coordinate transfer between to images with different resolution for the pixel centric coordinate system:

    x_new = (x_old-0.5)*factor+0.5; y_new = (y_old-0.5)*factor+0.5;

    Refer to RescaleTransfer.pdf to see a sketch of the physical "Zusammenhang" and some examples.

Author
woelk 10/2008 (c) www.vision-n.de

Definition at line 72 of file RescaleTransfer.hh.

Member Function Documentation

void BIAS::RescaleTransfer::Down ( const double &  x,
const double &  y,
const double &  factor,
double &  new_x,
double &  new_y 
)
static

transfer to smaller image if factor > 1.

factor must not be zero!

Definition at line 144 of file RescaleTransfer.hh.

References BIAS::Equal().

void BIAS::RescaleTransfer::Down ( const Vector2< double > &  src,
const double &  factor,
Vector2< double > &  dst 
)
static

transfer to smaller image if factor > 1.

factor must not be zero!

Definition at line 154 of file RescaleTransfer.hh.

References BIAS::Equal().

void BIAS::RescaleTransfer::Down ( const HomgPoint2D src,
const double &  factor,
HomgPoint2D dst 
)
static

transfer to smaller image if factor > 1.

factor must not be zero!

Sei w=src[2] und dw = dst[2]: Dann gilt für i in {0,1}: (src[i]/w+0.5)/factor-0.5=dst[i]/dw Unter der Vorraussetzung das dst[2] == src[2] oder w==dw gilt dann: (src[i]+0.5*w)/factor-0.5*w = dst[i]

Definition at line 164 of file RescaleTransfer.hh.

References BIAS::Equal().

void BIAS::RescaleTransfer::Up ( const double &  x,
const double &  y,
const double &  factor,
double &  new_x,
double &  new_y 
)
static

transfer to bigger image if factor > 1.

Definition at line 111 of file RescaleTransfer.hh.

void BIAS::RescaleTransfer::Up ( const Vector2< double > &  src,
const double &  factor,
Vector2< double > &  dst 
)
static

transfer to bigger image if factor > 1.

Definition at line 120 of file RescaleTransfer.hh.

void BIAS::RescaleTransfer::Up ( const HomgPoint2D src,
const double &  factor,
HomgPoint2D dst 
)
static

transfer to bigger image if factor > 1.

Sei w=src[2] und dw = dst[2]: Dann gilt für i in {0,1}: (src[i]/w+0.5)*factor-0.5=dst[i]/dw Unter der Vorraussetzung das dst[2] == src[2] oder w==dw gilt dann: (src[i]+0.5*w)*factor-0.5*w = dst[i]

Definition at line 129 of file RescaleTransfer.hh.


The documentation for this class was generated from the following file: