Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DeInterlace.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 
26 #ifndef __DeInterlace_hh__
27 #define __DeInterlace_hh__
28 
29 #include "FilterNToN.hh"
30 #include <Base/Common/BIASpragmaStart.hh>
31 
32 namespace BIAS
33 {
34 
35  /**
36  * @enum BIAS_DEINTERLACE_TYPE
37  * @brief the type of deinterlacing:
38  * BIAS_DI_121 : calculate new pixel from old neighbouring pixels with new = (old1+2*old2+old3)/4
39  * BIAS_DI_22 : calculate new pixel from old neighbouring pixels with new = (old1+old2)/2
40  */
44  };
45 
46 
47  /** @class DeInterlace
48  * @ingroup g_filter
49  * @brief Deinterlacer filter for images. There are several options
50  * how deinterlacing is done. You can use even or odd lines or automatically
51  * downsample the image while deinterlacing. Use the Set...() functions
52  * to choose your options
53  * @author ischiller
54  * @date 01/2005
55  * */
56  template <class InputStorageType, class OutputStorageType>
57  class BIASFilter_EXPORT DeInterlace
58  : public FilterNToN<InputStorageType, OutputStorageType>
59  {
60  public:
61  DeInterlace();
63  virtual ~DeInterlace();
64 
65  /** @brief averages over a region with constant weights
66  @author woelk 09/2004 */
67  virtual int Filter(const Image<InputStorageType>& src,
69 
70  /** @brief only calls filter, for consistency of params */
71  virtual int FilterInt(const Image<InputStorageType>& src,
73 
74  /** @brief only calls filter, for consistency of params */
75  virtual int FilterFloat(const Image<InputStorageType>& src,
77 
80 
81  /** @biref applies deinterlacing to each channel sperately */
82  virtual int FilterColorImg(const Image<InputStorageType>& src,
84 
85 
86  /** Set if the even or odd lines in the images should be used */
87  void SetUseEvenLines(bool bEvenLines=true);
88 
89  /** Set the Type of deinterlacing e.g. mean of 2 pixel or weighting with 121... */
90  void SetDeInterlaceType(BIAS_DEINTERLACE_TYPE type);
91 
92  /** Set the downsampling factor while filter */
93  void SetDownSamplingByTwo(bool bDoDownSamplingByTwo = true );
94 
95  protected:
96  virtual void GetBordersValid_(int& border_x, int& border_y) const {};
97  protected:
98  bool bUseEvenLines_;
101  }; // class
102 
103 
104 
105 
106 } // namespace
107 
108 #include <Base/Common/BIASpragmaEnd.hh>
109 
110 #endif // __DeInterlace_hh__
virtual void GetBordersValid_(int &border_x, int &border_y) const
Definition: DeInterlace.hh:96
BIAS_DEINTERLACE_TYPE
the type of deinterlacing: BIAS_DI_121 : calculate new pixel from old neighbouring pixels with new = ...
Definition: DeInterlace.hh:41
virtual FilterNToN< InputStorageType, OutputStorageType > * Clone() const
Definition: DeInterlace.hh:78
bool bDoDownSamplingByTwo_
Definition: DeInterlace.hh:99
Deinterlacer filter for images.
Definition: DeInterlace.hh:57
base class for simple n-&gt;n filter implementations
Definition: FilterNToN.hh:43
BIAS_DEINTERLACE_TYPE eDeInterlaceType_
Definition: DeInterlace.hh:100