My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
Image.h
1 // $Id: Image.h,v 1.1.1.1 2009/07/06 23:57:18 eml Exp $
2 
3 #ifndef GCP_GRABBER_IMAGE_H
4 #define GCP_GRABBER_IMAGE_H
5 
16 #include <iostream>
17 #include <valarray>
18 
19 #include "gcp/grabber/common/Channel.h"
20 
21 namespace gcp {
22  namespace grabber {
23 
24  class Image {
25  public:
26 
30  Image();
31 
35  virtual ~Image();
36 
40  void addFakeImage();
41 
45  void addRampImage();
46 
52  void finalize();
53 
57  void flatfield();
58 
59  void rowFlatfield();
60  void imageFlatfield();
61 
62  float getHotPixels(std::valarray<float>& image, float nsigma);
63 
64  float getMaskedMean(std::valarray<float>& image);
65 
66  float getMaskedSigma(std::valarray<float>& image, float mean);
67 
68  unsigned outlierReject(std::valarray<float>& image,
69  float& mean, float& sigma,
70  float nsigma);
71 
72  // Store the current image as the flatfield
73 
75 
76  public:
77 
78  // A buffer where we will store the image just received from the
79  // frame grabber
80 
81  std::valarray<unsigned short> image_;
82 
83  // A flat-field image
84 
85  std::valarray<float> flatfieldImage_;
86 
87  // A buffer where images can be integrated
88 
89  std::valarray<float> intImage_;
90 
91  // Masks used for nulling bad pixels
92 
93  std::valarray<bool> pixelMask_;
94 
95  // Outlier rejection
96 
97  unsigned nSigma_;
98 
99  // The type of flatfielding to perform for this image
100 
101  unsigned flatfield_;
102 
103  // True if a flatfield image has been stored
104 
105  bool haveFlatfieldImage_;
106 
107  // The maximum value of the flatfield image
108 
109  float maxFlatfieldVal_;
110 
111  // The channel this image is associated with
112 
113  Channel::FgChannel channel_;
114 
115  // The number of frames to combine for this channel
116 
117  unsigned int nCombine_;
118 
119  }; // End class Image
120 
121  } // End namespace grabber
122 } // End namespace gcp
123 
124 
125 
126 #endif // End #ifndef GCP_GRABBER_IMAGE_H
void flatfield()
Definition: Image.cc:329
void imageFlatfield()
Definition: Image.cc:371
Image()
Definition: Image.cc:16
void storeCurrentImageAsFlatfield()
Definition: Image.cc:40
virtual ~Image()
Definition: Image.cc:35
unsigned outlierReject(std::valarray< float > &image, float &mean, float &sigma, float nsigma)
Definition: Image.cc:169
float getMaskedMean(std::valarray< float > &image)
Definition: Image.cc:105
void addRampImage()
Definition: Image.cc:299
float getHotPixels(std::valarray< float > &image, float nsigma)
Definition: Image.cc:69
void addFakeImage()
Definition: Image.cc:239
float getMaskedSigma(std::valarray< float > &image, float mean)
Definition: Image.cc:133
void finalize()
Definition: Image.cc:314