FrameOstream subclass that writes image statistics to an output file. More...
#include <Transport/StatsOutputSeries.H>
Classes | |
struct | Impl |
Public Member Functions | |
StatsOutputSeries (OptionManager &mgr) | |
Constructor. | |
virtual | ~StatsOutputSeries () |
Destructor. | |
virtual void | setConfigInfo (const std::string &filename) |
Override from FrameOstream; just calls setFileName(). | |
virtual bool | setFrameNumber (int n) |
Set the current frame number and remember it. | |
virtual void | writeFrame (const GenericFrame &frame, const std::string &shortname, const FrameInfo &auxinfo) |
Write image statistics to the output file. | |
virtual void | closeStream (const std::string &shortname) |
No-op. | |
void | setFileName (const std::string &s) |
Specify the output filename. |
FrameOstream subclass that writes image statistics to an output file.
To try out StatsOutputSeries, you can for example do the following using bin/stream to generate a listing on stderr of basic statistics for 5 random 300x300 color images:
./bin/stream --in=random:300x300 --out=stats:stderr \ --input-frames=0-4
which will generate output like the following:
000000 R=[0 .. 127.419667 +/- 73.714227 .. 255] G=[0 .. 127.312844 +/- 73.822887 .. 255] B=[0 .. 127.575222 +/- 73.854606 .. 255] % stream-output (300x300 Image<PixRGB<byte>>) 000001 R=[0 .. 127.491533 +/- 73.670695 .. 255] G=[0 .. 127.532900 +/- 74.127892 .. 255] B=[0 .. 127.387644 +/- 73.752754 .. 255] % stream-output (300x300 Image<PixRGB<byte>>) 000002 R=[0 .. 127.553444 +/- 74.032009 .. 255] G=[0 .. 127.531078 +/- 73.875733 .. 255] B=[0 .. 127.660456 +/- 73.902850 .. 255] % stream-output (300x300 Image<PixRGB<byte>>) 000003 R=[0 .. 127.584222 +/- 73.662192 .. 255] G=[0 .. 127.564222 +/- 74.022741 .. 255] B=[0 .. 127.547267 +/- 73.920700 .. 255] % stream-output (300x300 Image<PixRGB<byte>>) 000004 R=[0 .. 127.425100 +/- 73.940624 .. 255] G=[0 .. 127.340178 +/- 73.798693 .. 255] B=[0 .. 127.278911 +/- 73.749278 .. 255] % stream-output (300x300 Image<PixRGB<byte>>) OVERALL R=[0 .. 127.494793 .. 255] G=[0 .. 127.456244 .. 255] B=[0 .. 127.489900 .. 255] % summary of 5 frames
where the first column is the frame number, followed by
[min .. mean +/- stdev .. max]
for each of the R,G,B components. The final line gives
[min .. mean .. max]
over all of the input frames.
If the filename given to StatsOutputSeries is "", "-", "stdout", or "STDOUT" then the output goes to stdout, likewise "stderr" or "STDERR" sends output to stderr, and anything else will be interpreted as a literal filename to which output should be written.
Definition at line 76 of file StatsOutputSeries.H.
StatsOutputSeries::StatsOutputSeries | ( | OptionManager & | mgr | ) |
Constructor.
Definition at line 176 of file StatsOutputSeries.C.
StatsOutputSeries::~StatsOutputSeries | ( | ) | [virtual] |
Destructor.
Definition at line 183 of file StatsOutputSeries.C.
void StatsOutputSeries::closeStream | ( | const std::string & | shortname | ) | [virtual] |
void StatsOutputSeries::setConfigInfo | ( | const std::string & | filename | ) | [virtual] |
Override from FrameOstream; just calls setFileName().
Reimplemented from FrameOstream.
Definition at line 189 of file StatsOutputSeries.C.
References setFileName().
void StatsOutputSeries::setFileName | ( | const std::string & | s | ) |
Specify the output filename.
Definition at line 235 of file StatsOutputSeries.C.
Referenced by setConfigInfo().
bool StatsOutputSeries::setFrameNumber | ( | int | n | ) | [virtual] |
Set the current frame number and remember it.
Reimplemented from FrameOstream.
Definition at line 199 of file StatsOutputSeries.C.
void StatsOutputSeries::writeFrame | ( | const GenericFrame & | frame, | |
const std::string & | shortname, | |||
const FrameInfo & | auxinfo | |||
) | [virtual] |
Write image statistics to the output file.
Implements FrameOstream.
Definition at line 207 of file StatsOutputSeries.C.
References GenericFrame::asRgbU8(), GenericFrame::GRAY_F32, GenericFrame::GRAY_U16, GenericFrame::GRAY_U8, GenericFrame::nativeType(), GenericFrame::nativeTypeName(), GenericFrame::NONE, GenericFrame::RGB_F32, GenericFrame::RGB_U16, GenericFrame::RGB_U8, and GenericFrame::RGBD.