Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Image.hh
1 /*
2  This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4  Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10  BIAS is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation; either version 2.1 of the License, or
13  (at your option) any later version.
14 
15  BIAS is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with BIAS; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23  */
24 
25 #ifndef __Image_hh__
26 #define __Image_hh__
27 
28 #include "bias_config.h"
29 
30 #define _USE_MATH_DEFINES
31 #include <math.h>
32 
33 #include <iostream>
34 #include <string>
35 #include <fstream>
36 // for MaxSTValue and MinSTValue
37 #include <float.h>
38 #include <limits.h>
39 
40 //BIAS
41 #include <Base/Image/ImageBase.hh>
42 
43 #define MIP_DV_WIDTH 500
44 #define MIP_DV_HEIGHT 288
45 
46 #define D_COPYIN 1<<1
47 #define D_CONVERT 1<<2
48 #define D_CAST_CHECK 1<<3
49 #define D_MI_TOPLANAR 1<<4
50 #define D_MI_IOSTREAM 1<<5
51 #define D_MI_CONVGREY 1<<6
52 #define D_IMAGE_MINMAXCOO 1<<7
53 
54 namespace BIAS
55 {
56 
57  /** @class Image
58  @ingroup g_image_base
59  @brief The image template class for specific storage types.
60 
61  The real image data is stored as an array of the specific storage type.
62  You can get the pointer by GetImageData() while
63  accessing the image data could also be more efficiently done
64  by GetImageDataArray()[y][x],
65  which gives the first channel of pixel at position (x,y).
66  The second and third channels for interleaved images are at
67  [y][channelcount*x+1] and [y][channelcount*x+2].<br>
68 
69  There is an additional MetaData array, which holds information like
70  the Pmatrix, which are used by derived classes.<br>
71 
72  see also ExampleLoad.cpp , ExampleOperator.cpp, ExampleChessboard.cpp
73 
74  @internal The explicit instatiation of the template
75  is handled in ImageInstantiation.cpp
76  **/
77  template<class StorageType>
78  class BIASImageBase_EXPORT Image : public ImageBase
79  {
80  public:
81  Image();
82  virtual
83  ~Image();
84 
85  /** constructor with size and channels
86  allocates image data */
87  Image(unsigned int width, unsigned int height, unsigned int channels = 1,
88  const bool interleaved = true);
89 
90  /** create image from imagebase. this is a dangerous operation and must
91  therefore not be used by implicit conversion. That means, you can
92  manually convert ImageBase->Image, but you cannot pass an
93  Image<float> where Image<char> is expected. */
94  explicit
95  Image(const ImageBase& im);
96 
97  /** virtual covariant copy constructor which produces the same type of
98  object as the template object (Image, Camera, ...).
99  Must be implemented in all derived classes and since some people do
100  work with ImageBase objects, it is also implemented there.
101  The caller is responsible to delete the clone.
102  @author koeser 06/2006 */
103  virtual Image<StorageType>*
104  Clone() const
105  {
106  return new Image<StorageType> (*this);
107  }
108 
109  /** @brief calls Init from ImageBase
110  storageType is ignored, just dummy argument */
111  void
112  Init(unsigned int Width, unsigned int Height, unsigned int channels = 1,
113  enum EStorageType storageType = ST_unsignedchar,
114  const bool interleaved = true);
115 
116  /** @brief reimplemented from ImageBase */
117  void
118  Release();
119 
120  /**
121  This is used to construct a BIAS::Image hull around
122  existing image data. Be sure to ClearDataPointer() _before_
123  destructing the Image object to avoid deletion of the data array
124  @author evers
125  */
126  int InitWithForeignData(unsigned int width, unsigned int height,
127  unsigned int channels, void* data,
128  const bool interleaved = true,
129  const bool shouldRelease = true);
130 
131  /** @name Get Functions
132  @{
133  */
134  /** overloaded GetImageData() from ImageBase
135  @author Felix Woelkt */
136  inline const StorageType*
137  GetImageData() const
138  {
139  return (const StorageType *) ImageData_;
140  }
141 
142  /** overloaded GetImageData() from ImageBase
143  @author Daniel Grest */
144  inline StorageType*
146  {
147  return (StorageType *) ImageData_;
148  }
149 
150  /** overloaded GetImageDataArray() from ImageBase
151  @author Felix Woelk */
152  inline const StorageType**
154  {
155  return (const StorageType **) ImageDataArray_;
156  }
157 
158  /** overloaded GetImageDataArray() from ImageBase
159  @author Daniel Grest */
160  inline StorageType**
162  {
163  return (StorageType **) ImageDataArray_;
164  }
165 
166  /** Returns value of pixel at specific position,
167  using specific channel as offset
168  @attention Checks boundaries in debug build.
169  @author Ingo Thomsen, JW
170  @date 03/27/2002 */
171  inline StorageType
172  PixelValue(const unsigned int x, const unsigned int y,
173  const unsigned short int channel = 0) const;
174 
175  /** Returns value of pixel at specific position, using specific channel
176  as offset, in interleaved images.
177  @attention Checks boundaries and interleaved flag in debug build.
178  @author Johan Skoglund
179  @date 06/10/2004 */
180  inline StorageType
181  PixelValueInterleaved(const int x, const int y, const int channel = 0) const;
182 
183  /** @brief Return pixel value at specified position as reference
184  for read+write access in interleaved images.
185 
186  Useful to iterate with read+write acess over pixels for shorter code.
187  Not faster - but easier to debug.
188  Useful for rapid prototyping of i.e. Cg fragment shaders in Software.
189  Intentionaly NOT const and reference return instead of value.
190  Assume interleaved (color) images of typically 3/4 channels (RGB/RGBA).
191  @attention Checks boundaries and interleaved flag in debug build.
192  @author Jan Woetzel */
193  inline StorageType &
194  PixelValueRefInterleaved(const int x, const int y, const int channel = 0);
195 
196  /** Get the minimal pixel value
197  if coo!=NULL the coo[0]=x of min and coo[1]=y of min
198  @author Felix Woelk **/
199  StorageType
200  GetMinPixelValue(unsigned short int channel = 0, unsigned int *coo =
201  NULL) const;
202 
203  /** Get the maximal pixel value
204  if coo!=NULL the coo[0]=x of max and coo[1]=y of max
205  @author Felix Woelk **/
206  StorageType
207  GetMaxPixelValue(unsigned short int channel = 0, unsigned int *coo =
208  NULL) const;
209 
210  /** @brief returns the minimal and maximal pixel value in channel only
211  Finds minimum and maximum pixel value in image in channel only, i.e.
212  all other channels are ignored during the search. Returns the first
213  occurance of min/max pixelvalue, if they occure multiple times.
214  @param min The variable where to store the minimun value
215  @param max The variable where to store the maximum value
216  if mincoo or maxcoo !=NULL, also stores the location of
217  min resp. max, works slow on
218  @tested woelk 10/2004 ( Examples/ExampleMinMax.cpp )
219  @author Jan Frahm, woelk 01/2003, woelk 10/2004 **/
220  void
221  GetMinMaxPixelValue(StorageType& min, StorageType& max,
222  unsigned short int channel = 0, unsigned int *mincoo = NULL,
223  unsigned int *maxcoo = NULL) const;
224 
225  /** @author woelk 08/2004
226  * @brief calculates mean of pixel
227  * @param mean (output) mean image value with as many entries as image has channels, init before!
228  */
229  void
230  GetMeanPixelValue(StorageType mean[]);
231 
232  /** @author ischiller 12/09
233  * @brief calculates mean of pixel ignoring values between ignoreStart and ignoreEnd
234  * @param mean (output) mean image value with as many entries as image has channels, init before!
235  * @param ignoreStart (input) start of interval of values to ignore (default=0)
236  * @param ignoreEnd (input) end of interval of values to ignore (default=0)
237  */
238  void
239  GetMeanPixelValueIgnoreRange(StorageType mean[],
240  const StorageType ignoreStart = 0, const StorageType ignoreEnd = (StorageType)0) const;
241 
242  /** @brief Get both, minimal and maximal pixel value
243  --actual implementation only for planar images--
244  @param min The variable where to store the minimum value
245  @param max The variable where to store the maximum value
246  @param ignoreStart, ignoreEnd define the range of values to be ignored
247  @param channel to be searched from multi-channel images
248  @return true if a value within range was found, else false
249  @author Jan Woetzel 01/2003 **/
250  bool
251  GetMinMaxPixelValueIgnoreRange(StorageType& min, StorageType& max,
252  const StorageType ignoreStart = 0, const StorageType ignoreEnd = 0,
253  const unsigned short int channel = 0) const;
254 
255  /** @brief Get the value of a specific channel offset of specific pixel
256  nearest to given double coordinates
257 
258  @author Ingo Thomsen
259  @date 03/27/2002
260  @attention Checks boundaries in debug build.
261  @status tested (only with interleaved grey images) **/
262  inline const StorageType&
263  GetPixelNearestNeighbor(const double x, const double y,
264  const unsigned short int channel = 0) const;
265 
266  /** @brief Get the value of a specific channel offset of specific pixel
267  nearest to given float coordinates, using the double version.
268  @author Ingo Thomsen
269  @date 03/28/2002
270  @attention Checks boundaries in debug build.
271  @status tested (only with interleaved gray images) **/
272  inline const StorageType&
273  GetPixelNearestNeighbor(const float x, const float y,
274  const unsigned short int channel = 0) const;
275 
276  // @}
277  ////////end of Get Functions////////////////////////////////////////////
278 
279  /** @name Set Functions
280  @{
281  */
282  /**
283  @brief sets all pixels to zero/value
284 
285  clear all pixels elements and set them to a 'default' value
286  JW 04/2003
287  */
288  inline
289  void Clear(const StorageType value = 0)
290  {
291  FillImageWithConstValue(value);
292  }
293 
294  /** Sets all pixel values in the declared channel to the specified value.
295  * \author bartczak 05/2010
296  **/
297  void ClearChannel(const unsigned int channel, const StorageType value);
298 
299  /// @brief fill grey images
300  void
301  FillImageWithConstValue(StorageType Value);
302  /// @brief fill color images
303  void
304  FillImageWithConstValue(StorageType Value[]);
305 
306  /// @brief fills image with value depending on x coordinate
307  void
308  FillImageWithXValue();
309 
310  /** Set the value of a given pixel (x,y) in channel to value.
311  @warning This function is slower than direct pointer access if you
312  want to access ALL pixels of an image!
313  @attention Checks boundaries in debug build.
314  @author Jan Woetzel 08/2003 */
315  inline void
316  SetPixel(const StorageType & value, const unsigned int & x,
317  const unsigned int & y, const unsigned short int channel = 0);
318 
319  /** Set the values of the first three channels of a given pixel (x,y)
320  in channel to value[0..2].
321  @warning This function is slower than direct pointer access if you
322  want to access ALL pixels of an image!
323  @attention Checks boundaries in debug build.
324  @author Jan Woetzel 08/2003 */
325  inline void
326  SetPixel(const StorageType & value0, const StorageType & value1,
327  const StorageType & value2, const unsigned int & x,
328  const unsigned int & y);
329 
330  // @}
331  //////end of Set Functions /////////////////////////////////////////////
332 
333  /** @name Thresholding and Scaling
334  @{
335  */
336 
337  /** @brief scales and shifts image (all channels simultanously)
338 
339  does scale and shift every channel with same factor so that
340  (max of all channels) = Max and (min of all channels) = Min.
341  First shifts, then scales.
342  @author Felix Woelk **/
343  int
344  ScaleShift(double Scale, double Shift);
345 
346  /** @brief similiar to ScaleShift, but only scales and shifts one
347  image channel
348  @author Patrick Fittkau **/
349  int
350  ScaleShiftChannel(double Scale, double Shift, unsigned int channel);
351 
352  /** @brief scales and shifts image so afterwards every pixel has a value
353  between Min and Max
354 
355  scales and shifts every channel with same factor
356  @author Felix Woelk **/
357  int
358  ScaleShiftBetween(double Min, double Max);
359 
360  /**
361  * @brief Transposes an image on diagonal, rows become columns,
362  * columns become rows
363  */
364  int
365  Transpose(BIAS::Image<StorageType>& result);
366 
367  /**
368  * @brief inverts values of image, new values are StorageType_MAX-oldvalue
369  * or newMax-oldvalue if newMax != NULL
370  * @param inverted (out) the inverted image
371  * @param newMax (in) the new maximum of image
372  */
373  int
374  InvertValues(BIAS::Image<StorageType>& inverted,
375  StorageType* newMax = NULL);
376 
377  /** @brief calculate the values needed by ScaleShiftBetween */
378  int
379  CalcScaleShift(double Min, double Max, double& Scale, double &Shift) const;
380 
381  /// @brief sets alls pixels with values below Threshold to Value
382  int
383  BelowThresholdToValue(StorageType Threshold, StorageType Value);
384 
385  /// @brief sets alls pixels with values above Threshold to Value
386  int
387  AboveThresholdToValue(StorageType Threshold, StorageType Value);
388 
389  /** @brief sets all pixels >= Threshold to MaxPixelValue
390  and all others to MinPixelValue
391  only for one channel / grey images
392  @author woelk
393  @date 01/2003 */
394  void
395  Binarize(StorageType Threshold);
396 
397  /** @brief Wrapper for Binarize()
398  * @author woelk
399  * @date 01/2003 */
400  void
401  Binarise(StorageType Threshold);
403  /** @brief Test for every pixel wether it is >= than the threshold. If so
404  * set to a MaxValue, otherwise to an MinValue. (status tested)
405  * @author Ingo Thomsen
406  * @date 03/28/2002 */
407  int
408  BinaryThreshold(StorageType Threshold, StorageType MinValue,
409  StorageType MaxValue);
410  /**
411  * \brief Calculates a mask image from given image depending on threshold.
412  * If the value of one or more channels is above a pixel, the binary image
413  * is set to 255, if none of the image channels of above the threshold
414  * the binary image is set to 0.
415  * \param Threshold[in]: threshold to check.
416  * \param binaryImage[out]: resulting 1 channel binary image */
417  void
418  MaskValues(StorageType Threshold, Image<unsigned char>& binaryImage);
419  //@}
420  /////// end of thresholding //////////////////////////////////////////////
421  /////////////////////////////////////////////////////////////////////////
422  /**
423  @name Operators
424 
425  Operators -,+,*,/,-=,+=,*=,/= for scalar and image arguments <br>
426  Operators do only work for argument of the same type <br>
427  Division Operators do zero checks (if BIAS_DEBUG is defined)
428  @{
429  */
430  /** copies ImageBase to an desired Image<>,
431  be careful with this, because u can do
432  something like: Image<char> = Image<float>,
433  what usualluy not makes sense
434  @author Friso Evers, Nov. 2002 */
436  operator=(const ImageBase& Source);
437 
438  /// Operator /= for scalar value
440  operator/=(const StorageType& argimage);
442  /// Operator / for scalar value, returning a new image
444  operator/(const StorageType& argimage) const;
445 
446  /// Operator *= for scalar value
448  operator*=(const StorageType& argimage);
449 
450  /// Operator * for scalar value, returning a new image
452  operator*(const StorageType& argimage) const;
453 
454  /// Operator += for scalar value
456  operator+=(const StorageType& argimage);
457 
458  /// Operator + for scalar value, returning a new image
460  operator+(const StorageType& argimage) const;
461 
462  /// Operator -= for scalar value
464  operator-=(const StorageType& argimage);
465 
466  /// Operator - for scalar value, returning a new image
468  operator-(const StorageType& argimage) const;
469 
470  /// Operator /= for another image as argument
472  operator/=(const Image<StorageType>& argimage);
473 
474  /// Operator / for another image as argument, returning a new image
476  operator/(const Image<StorageType>& argimage)const ;
477 
478  /// Operator *= for another image as argument
480  operator*=(const Image<StorageType>& argimage);
481 
482  /// Operator * for another image as argument, returning a new image
484  operator*(const Image<StorageType>& argimage) const;
485 
486  /// Operator += for another image as argument
488  operator+=(const Image<StorageType>& argimage);
489 
490  /// Operator + for another image as argument, returning a new image
492  operator+(const Image<StorageType>& argimage) const;
493 
494  /// Operator -= for another image as argument
496  operator-=(const Image<StorageType>& argimage);
497 
498  /** subtracts every from every pixel (in ROI if defined)
499  the pixel value from argimage
500  !!! negative results are clipped to zero !!!
501  @author Ingo Thomsen
502  @status tested (18/04/2002)
503  */
505  operator-(const Image<StorageType>& argimage) const;
506 
508  operator|(const Image<StorageType>& argimage);
509 
510  /** @} */ //doxygen end operators
511 
512  /////////// end of Operators ////////////////////////////////////////////
513 
514  /** @name Interpolating Functions
515  @{
516  */
517  /** @brief Linear interpolation in image rows.
518  @attention Uses boundary check in debug build, but ignores ROI. */
519  inline double
520  LinearInterpolation(const unsigned int x, const double y) const;
521 
522  /** @brief Linear interpolation in image columns.
523  @attention Uses boundary check in debug build, but ignores ROI. */
524  inline double
525  LinearInterpolation(const double x, const unsigned int y) const;
526 
527  /** @brief Fast bilinear interpolation for grey-value images.
528  Specialisation for storage tupe unsigned char exists which is 20% faster
529  than the generic function!
530  @attention No boundary check! Returns actual storage type rather
531  than double.
532  @author woelk 01/2003 */
533  inline StorageType
534  FastBilinearInterpolationGrey(const double x, const double y) const;
535 
536  /** @brief Generic bilinear interpolation.
537  Returns the bilinear interpolated pixel value (using channel offset)
538  at subpixel position defined by double coordinates.
539  @attention Uses boundary check in debug build, but ignores ROI.
540  Does not work for planar non-RGB images!
541  @date 04.03.2002
542  @status tested (only with gray images yet)
543  @author Ingo Thomsen */
544  double
545  BilinearInterpolation(const double x, const double y,
546  const unsigned short int channel = 0) const;
547 
548  /** @brief Check if subpixel position (x,y) in image is valid for
549  bilinear interpolation (i.e. has 4 neighbors inside the image).
550  @attention Ignores ROI!
551  @author esquivel */
552  inline bool CheckBilinearInterpolation(const double x,
553  const double y) const;
555  /** @brief Check if subpixel position (x,y) in image is valid for bicubic
556  interpolation (i.e. 4x4 window centered at (x,y) is inside the image).
557  @attention Ignores ROI!
558  @author esquivel */
559  inline bool CheckBicubicInterpolation(const double x,
560  const double y) const;
561 
562  /** @brief Bilinear interpolation for grey-value images.
563  @attention No boundary check, ignores ROI!
564  @author Felix Woelk */
565  inline double
566  BilinearInterpolationGrey(const double x, const double y) const;
567 
568  /** @brief Bilinear interpolation for planar RGB images.
569  @attention No boundary check, ignores ROI!
570  @author Felix Woelk */
571  inline double
572  BilinearInterpolationRGBPlanar(const double x, const double y,
573  unsigned int channel) const;
574 
575  /** @brief Bilinear interpolation for interleaved RGB images.
576  @attention No boundary check, ignores ROI!
577  @author Felix Woelk */
578  inline double
579  BilinearInterpolationRGBInterleaved(const double x, const double y,
580  unsigned int channel) const;
581 
582  /** @brief Interpolation for grey-value images with weights according
583  to distance of (x,y) to pixel center.
584  @attention No boundary check, ignores ROI! */
585  inline double
586  DistanceWeightedInterpolationGrey(const double x, const double y) const;
587 
588  /** @brief Interpolate shifted rectangular region centered at given
589  subpixel position.
590  Sample the continuous (bilinear interpolation of (*this))
591  image using a grid with one pixel spacing at subpixel positions
592  (x-hws, y-hws) , ... (x,y), ... (x-hws, y-hws).
593  You get a window of size (2*hws_x+1)*(2*hws_y+1) which is exactly
594  centered at (x,y) (a subpixel position) of the original image
595  @param buffer must have size (2*hws_x+1)*(2*hws_y+1)
596  @param hws_x half window size in x direction
597  @param hws_y half window size in y direction
598  @param x x-center of window
599  @param y y-center of window
600  @attention No boundary check, ignores ROI! Image must be one-channel!
601  Only unsigned char is implemented!
602  @author koeser 01/2004 */
603  inline void
604  BilinearInterpolationShiftRegion(const double& x, const double& y,
605  unsigned int hws_x, unsigned int hws_y, StorageType* buffer);
606 
607  /** @brief Bilinear interpolation for grey-value images with pixel
608  value check.
609  If at least one of the input values is <= minVal, then the unknown
610  value minVal is returned, too.
611  @param minVal all values <= minVal are invalid/unknown.
612  @attention No boundary check, ignores ROI!
613  @author Jan Woetzel 12/2004 */
614  inline double
615  BilinearInterpolationGreyMinVal(const double x, const double y,
616  const StorageType & minVal) const;
617 
618  /** @brief Bilinear interpolation for grey-value images with pixel
619  value check.
620  If at least one of the input values is >= maxVal, then the unknown
621  value maxVal is returned, too.
622  @param maxVal all values >= maxVal are invalid/unknown.
623  @attention No boundary check, ignores ROI!
624  @author bartczak 08/2006 */
625  inline double
626  BilinearInterpolationGreyMaxVal(const double x, const double y,
627  const StorageType & maxVal) const;
628 
629  /** @brief Generic bicubic interpolation.
630  Returns the bicubic interpolated pixel value (using channel offset)
631  at subpixel position defined by double coordinates.
632  The subpixel value is obtained by computing a weighted average of
633  the surrounding 4x4 pixel block. The weights are computed by
634  independent x/y direction cubic polynomials which guarantee
635  constant first order derivatives at the grid positions.
636 
637  @attention Uses boundary check in debug build, but ignores ROI.
638  Does not work for planar multi-channel images!
639 
640  @author koeser 02/2005
641  **/
642  double
643  BicubicInterpolation(const double& x, const double& y,
644  const unsigned short int channel = 0) const;
645 
646  /** @} */ //doxygen end Interpolation
647 
648  /**
649  * @name Misc Functions
650  * @{
651  * \brief Append an image with one channel of same StorageType
652  * Append means: RGB + A => RGBA
653  **/
654  int
655  AppendChannel(Image<StorageType> &img);
656 
657  /**
658  * \brief remove a channel from an image
659  * Remove means: RGB, remove channel 2 => RG
660  * CAUTION, channels start a 0
661  * Status, planar case untested
662  * \param channel, the channel to remove, starting at 0
663  * \author ischiller
664  * \date 04/2010
665  */
666  int
667  RemoveChannel(unsigned int channel);
668 
669  /**
670  * \brief Deletes n pixels at border of image
671  * \param n[in]: number of pixels to delete
672  * \param delVal[in]: new value for deleted pixel (default=0)
673  * \return number of deleted pixel
674  * \author ischiller
675  * \date 08/2010
676  */
677  int
678  DeleteNBorderPixel(int n, StorageType delVal=StorageType(0));
679 
680  /** \brief returns the maximal possible StorageType */
681  inline StorageType
682  MaxSTValue();
683 
684  /** \brief returns the minimal possible StorageType */
685  inline StorageType
686  MinSTValue();
687 
688  /** \brief writes pointer of IplImage_ to os (ascii) */
689  std::ostream&
690  PrintPointer(std::ostream &os) const;
691 
692  /** \brief writes data of IplImage_ to os (ascii) */
693  std::ostream&
694  PrintData(std::ostream &os) const;
695 
696  /** @brief (*this) = | im1 - im2 |
697  sets this as the absolute difference between two arg images
698  @author Felix Woelk */
699  void
700  AbsDiff(const Image<StorageType>& im1, const Image<StorageType>& im2);
701 
702  /** @brief Calculates the reciprocal for each pixel: x' = 1/x
703  computes for exactly one channel (in case of multi channel images)
704  @return resulting reciprocal image
705  @author Jan Woetzel 01/2003 */
707  Reciprocal(const float factor = 1.0,
708  const unsigned short int channel = 0);
709 
710  /// inverts every pixel value, i.e. MaxSTValue() - value
711  void Invert();
712 
713  /** @} */
714 
715  };
716 
717 // inline functions
718 
719 #include "ImageInline.hh"
720 
721 } // namespace BIAS
722 
723 #endif // __Image_hh__
DualQuaternion< T > operator/(const DualQuaternion< T > &l, const T &scalar)
void BilinearInterpolationShiftRegion(const double &x, const double &y, unsigned int hws_x, unsigned int hws_y, StorageType *buffer)
Interpolate shifted rectangular region centered at given subpixel position.
Definition: Image.hh:554
BIASMathBase_EXPORT Vector2< T > & operator/=(Vector2< T > &vec, const Vector2< T > &argvec)
elementwise division
Definition: Vector2.hh:846
DualQuaternion< T > operator-(const DualQuaternion< T > &l, const DualQuaternion< T > &r)
StorageType ** GetImageDataArray()
overloaded GetImageDataArray() from ImageBase
Definition: Image.hh:161
StorageType * GetImageData()
overloaded GetImageData() from ImageBase
Definition: Image.hh:145
Vector2< T > & operator-=(Vector2< T > &vec, const Vector2< T > &argvec)
sub operator for two Vectors
Definition: Vector2.hh:839
class BIASImageBase_EXPORT Image
Definition: ImageBase.hh:91
void Clear(const StorageType value=0)
sets all pixels to zero/value
Definition: Image.hh:289
BIASMathBase_EXPORT Vector2< T > & operator+=(Vector2< T > &vec, const Vector2< T > &argvec)
add operator for two Vectors
Definition: Vector2.hh:830
Vector2< T > & operator*=(Vector2< T > &vec, const T &scalar)
Multiplication operator with scalar argument.
Definition: Vector2.hh:873
DualQuaternion< T > operator+(const DualQuaternion< T > &l, const DualQuaternion< T > &r)
The image template class for specific storage types.
Definition: Image.hh:78
DualQuaternion< T > operator*(const DualQuaternion< T > &l, const T &scalar)
const StorageType * GetImageData() const
overloaded GetImageData() from ImageBase
Definition: Image.hh:137
virtual Image< StorageType > * Clone() const
virtual covariant copy constructor which produces the same type of object as the template object (Ima...
Definition: Image.hh:104
This is the base class for images in BIAS.
Definition: ImageBase.hh:102
const StorageType ** GetImageDataArray() const
overloaded GetImageDataArray() from ImageBase
Definition: Image.hh:153