Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxNJet Class Reference

Class definition for NJet. More...

#include <HxNJet.h>

List of all members.

Public Methods

 HxNJet ()
 Constructor. More...

 HxNJet (HxImageRep im, int N, double scale, double precision=3)
 Construct an NJet from the given image at the given scale in given precision using Gaussians. More...

 HxNJet (HxString fileName)
 Read an NJet from file. More...

 HxNJet (const HxNJet &rhs)
 Copy constructor. More...

virtual ~HxNJet ()
 Destructor. More...

bool toFile (HxString fileName) const
 Write an NJet to file. More...

HxNJet & operator= (const HxNJet &rhs)
 Assignment operator. More...

int ident () const
 The identity of the NJet. More...

int order () const
 The order N. More...

double scale () const
 The scale. More...

int nrComponents () const
 The number of components. More...

int isColor () const
 Indicator whether its a color or grey value NJet. More...

HxImageRep xy (int x, int y) const
 Get the specified 2D component. More...

HxImageRep xyz (int x, int y, int z) const
 Get the specified 3D component. More...

HxImageRep xyl (int x, int y, int l) const
 Get the specified 2D color component. More...

HxImageRep xyzl (int x, int y, int z, int l) const
 Get the specified 3D color component. More...

HxImageRep getLidx (int i) const
 Get the specified L component. More...

HxImageRep getJidx (int i) const
 Get the specified J component. More...

HxImageRep getMidx (int i) const
 Get the specified M component. More...

HxImageList getLList () const
 Get all the L components. More...

HxImageList getJList () const
 Get all the J components. More...

HxImageList getMList () const
 Get all the M components. More...

HxImageList getList () const
 Get all the components. More...

HxImageRep getLw () const
 Get the L gradient magnitude. More...

HxImageRep getJw () const
 Get the J gradient magnitude. More...

HxImageRep getMw () const
 Get the M gradient magnitude. More...

void rotate (double phi)
void rotateDeg (double phi)
void rotate (HxImageRep phi)
void resample (double fac)
void truncate (int order)
void normalize ()
STD_OSTREAM & put (STD_OSTREAM &os) const
 Put some information on the given stream. More...

int ord2idx (int i, int j) const
 Translate from ord to idx. More...

int ord2idx (int i, int j, int k) const
 Translate from ord to idx 3D (not supported yet). More...


Detailed Description

Class definition for NJet.

Generates all components up to and including the N-th order in the following sequence: For 2D images:

Color images are stored in the opponent color respresentation, the L component representing luminance (the Gaussian smoothed spectral response), the J component the first order spectral derivative (yellow-blue), and the M component the second order spectral derivative (red-green). Grey images are only stored in the L component, J and M being zero.

Components L, J, and M can be specified in one of the following ways:

TODO: IMPLEMENTATION FOR 3D IMAGES AND ORDERS HIGHER THAN 2.


Constructor & Destructor Documentation

HxNJet::HxNJet  
 

Constructor.

00015                : _pointee(0)
00016 {
00017 }

HxNJet::HxNJet HxImageRep    im,
int    N,
double    scale,
double    precision = 3
 

Construct an NJet from the given image at the given scale in given precision using Gaussians.

00020     : _order(N), _scale(scale)
00021 {
00022     _pointee = HxNJetDataFactory::instance().makeGauss(im, N, scale,
00023                                                           precision);
00024 }

HxNJet::HxNJet HxString    fileName
 

Read an NJet from file.

00027 {
00028     HxTagList tags;
00029 
00030     _pointee = HxNJetDataFactory::instance().fromFile(fileName, tags);
00031     _order = HxGetTag(tags, "NJet Order", 4);
00032     _scale = HxGetTag(tags, "NJet Scale", 3.0);
00033 }

HxNJet::HxNJet const HxNJet &    rhs
 

Copy constructor.

00035                                 : _order(rhs._order), _scale(rhs._scale),
00036                                     _pointee(rhs.pointee())
00037 {
00038 }

HxNJet::~HxNJet   [virtual]
 

Destructor.

00041 {
00042 }


Member Function Documentation

bool HxNJet::toFile HxString    fileName const
 

Write an NJet to file.

00046 {
00047     HxTagList tags;
00048 
00049     return HxNJetDataFactory::instance().toFile(*this, fileName, tags);
00050 }

HxNJet & HxNJet::operator= const HxNJet &    rhs
 

Assignment operator.

00054 {
00055     _order = rhs._order;
00056     _scale = rhs._scale;
00057     _pointee = rhs._pointee;
00058     return *this;
00059 }

int HxNJet::ident   const
 

The identity of the NJet.

00063 {
00064     return pointee() ? pointee()->ident() : 0;
00065 }

int HxNJet::order   const
 

The order N.

00069 {
00070     return _order;
00071 }

double HxNJet::scale   const
 

The scale.

00075 {
00076     return _scale;
00077 }

int HxNJet::nrComponents   const
 

The number of components.

00081 {
00082     return pointee() ? pointee()->nrComponents() : 0;
00083 }

int HxNJet::isColor   const
 

Indicator whether its a color or grey value NJet.

00087 {
00088     return pointee() ? pointee()->isColor() : 0;
00089 }

HxImageRep HxNJet::xy int    x,
int    y
const
 

Get the specified 2D component.

00114 {
00115     return getLidx(ord2idx(x, y));
00116 }

HxImageRep HxNJet::xyz int    x,
int    y,
int    z
const
 

Get the specified 3D component.

00120 {
00121     return getLidx(ord2idx(x, y, z));
00122 }

HxImageRep HxNJet::xyl int    x,
int    y,
int    l
const
 

Get the specified 2D color component.

00126 {
00127     switch (l) {
00128     case 0:
00129         return getLidx(ord2idx(x, y));
00130     case 1:
00131         return getJidx(ord2idx(x, y));
00132     case 2:
00133         return getMidx(ord2idx(x, y));
00134     }
00135     return HxImageRep();
00136 }

HxImageRep HxNJet::xyzl int    x,
int    y,
int    z,
int    l
const
 

Get the specified 3D color component.

00140 {
00141     switch (l) {
00142     case 0:
00143         return getLidx(ord2idx(x, y, z));
00144     case 1:
00145         return getJidx(ord2idx(x, y, z));
00146     case 2:
00147         return getMidx(ord2idx(x, y, z));
00148     }
00149     return HxImageRep();
00150 }

HxImageRep HxNJet::getLidx int    i const
 

Get the specified L component.

00093 {
00094     HxImageRep im;
00095     return pointee() ? pointee()->getL(i) : im;
00096 }

HxImageRep HxNJet::getJidx int    i const
 

Get the specified J component.

00100 {
00101     HxImageRep im;
00102     return pointee() ? pointee()->getJ(i) : im;
00103 }

HxImageRep HxNJet::getMidx int    i const
 

Get the specified M component.

00107 {
00108     HxImageRep im;
00109     return pointee() ? pointee()->getM(i) : im;
00110 }

HxImageList HxNJet::getLList   const
 

Get all the L components.

00154 {
00155     HxImageList l;
00156 
00157     for (int i=0; i < nrComponents(); i++)
00158         l += getLidx(i);
00159     
00160     return l;
00161 }

HxImageList HxNJet::getJList   const
 

Get all the J components.

00165 {
00166     HxImageList l;
00167 
00168     if (isColor()) {
00169         for (int i=0; i < nrComponents(); i++)
00170             l += getJidx(i);
00171     }
00172 
00173     return l;
00174 }

HxImageList HxNJet::getMList   const
 

Get all the M components.

00178 {
00179     HxImageList l;
00180 
00181     if (isColor()) {
00182         for (int i=0; i < nrComponents(); i++)
00183             l += getMidx(i);
00184     }
00185 
00186     return l;
00187 }

HxImageList HxNJet::getList   const
 

Get all the components.

00191 {
00192     HxImageList l;
00193 
00194     HxImageList ll = getLList();
00195     HxImageList jl = getJList();
00196     HxImageList ml = getMList();
00197     
00198     l = ll + jl;
00199     l = l + ml;
00200 
00201     return l;
00202 }

HxImageRep HxNJet::getLw   const
 

Get the L gradient magnitude.

00206 {
00207     HxImageRep im;
00208     return pointee() ? pointee()->getLw() : im;
00209 }

HxImageRep HxNJet::getJw   const
 

Get the J gradient magnitude.

00213 {
00214     HxImageRep im;
00215     return pointee() ? pointee()->getJw() : im;
00216 }

HxImageRep HxNJet::getMw   const
 

Get the M gradient magnitude.

00220 {
00221     HxImageRep im;
00222     return pointee() ? pointee()->getMw() : im;
00223 }

STD_OSTREAM & HxNJet::put STD_OSTREAM &    os const
 

Put some information on the given stream.

00265 {
00266     if (isColor())
00267         os << "Color ";
00268     os << "NJet " << ident() << ", N = " << order()
00269        << ", scale = " << scale() << STD_ENDL;
00270     return os;
00271 }

int HxNJet::ord2idx int    i,
int    j
const [inline]
 

Translate from ord to idx.

00161                             {   int n = i+j;
00162                                 return n*(n+1)/2+j;}

int HxNJet::ord2idx int    i,
int    j,
int    k
const [inline]
 

Translate from ord to idx 3D (not supported yet).

00166                             {   int n = i+j;
00167                                 return n*(n+1)/2+j;}


The documentation for this class was generated from the following files:
Generated on Mon Jan 27 15:49:08 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001