9#include <cvb/spectral/spectral.hpp>
10#include <cvb/spectral/cube.hpp>
11#include <cvb/spectral/arithmetic.hpp>
12#include <cvb/spectral/interpolator.hpp>
13#include <cvb/spectral/convert_color_space.hpp>
20 Cvb::String objectHeader(Cvb::ExpandPath(Cvb::InstallPath() + CVB_LIT(
"tutorial/Spectral/Images/Leaf/leaf.hdr")));
21 Cvb::String objectBinary(Cvb::ExpandPath(Cvb::InstallPath() + CVB_LIT(
"tutorial/Spectral/Images/Leaf/leaf.bin")));
22 Cvb::String whiteRefHeader(Cvb::ExpandPath(Cvb::InstallPath() + CVB_LIT(
"tutorial/Spectral/Images/Leaf/WRef.hdr")));
23 Cvb::String whiteRefBinary(Cvb::ExpandPath(Cvb::InstallPath() + CVB_LIT(
"tutorial/Spectral/Images/Leaf/WRef.bin")));
24 Cvb::String blackRefHeader(Cvb::ExpandPath(Cvb::InstallPath() + CVB_LIT(
"tutorial/Spectral/Images/Leaf/BRef.hdr")));
25 Cvb::String blackRefBinary(Cvb::ExpandPath(Cvb::InstallPath() + CVB_LIT(
"tutorial/Spectral/Images/Leaf/BRef.bin")));
28 objectHeader <<
"\n\t" << objectBinary << std::endl;
30 whiteRefHeader <<
"\n\t" << whiteRefBinary << std::endl;
32 blackRefHeader <<
"\n\t" << blackRefBinary << std::endl;
40 std::cout <<
"Normalization done!" << std::endl;
48 std::cout <<
"Lab calculation done!" << std::endl;
50 std::cout <<
"sRGB calculation done!" << std::endl;
52 Cvb::String labFilename(Cvb::ExpandPath(CVB_LIT(
"%TMP%LabImage.tiff")));
53 Cvb::String rgbFilename(Cvb::ExpandPath(CVB_LIT(
"%TMP%sRGBImage.tiff")));
54 labImg->Save(labFilename);
55 rgbImg->Save(rgbFilename);
57 labFilename << std::endl;
58 std::cout <<
"Saved sRGB image to:\n\t" <<
59 rgbFilename << std::endl;
static std::unique_ptr< Cube > Load(Cvb::String EnviHeader, Cvb::String EnviBinary)
Static function Loads a cube from ENVI.
Definition: cube.hpp:317
static std::unique_ptr< Interpolator > Create(const Cube &cube, StdObserver stdObserver, StdIlluminant stdIlluminant, InterpolationMethod interpolationMethod)
Creates an Interpolator object.
Definition: interpolator.hpp:52
std::unique_ptr< Image > LabToRGB8(const Image &LabImage, const Interpolator &interpolator)
Converts a Lab image to a sRGB 8bit image.
Definition: convert_color_space.hpp:119
@ Linear
linear interpolation, at the border the last value is used
@ CIE2006_2deg
2006 Observer with 2 deg
std::unique_ptr< Cube > Normalization(const Cube &cubeIn, const Cube &whiteReference, const Cube &blackReference, NormalizationMethod normalizationMethod)
Normalizes a cube.
Definition: arithmetic.hpp:103
std::unique_ptr< Image > CubeToLab(const Cube &cube, const Interpolator &interpolator)
Converts the cube to a Lab image.
Definition: convert_color_space.hpp:66