further experiments with histogram matching
This commit is contained in:
parent
bb56d73cc8
commit
52957e9eab
@ -79,7 +79,7 @@ void mappingToCurve(const std::vector<int> &mapping, std::vector<double> &curve)
|
|||||||
{
|
{
|
||||||
curve.clear();
|
curve.clear();
|
||||||
|
|
||||||
const int npoints = 20;
|
const int npoints = 8;
|
||||||
int idx = 1;
|
int idx = 1;
|
||||||
for (; idx < int(mapping.size()); ++idx) {
|
for (; idx < int(mapping.size()); ++idx) {
|
||||||
if (mapping[idx] >= idx) {
|
if (mapping[idx] >= idx) {
|
||||||
@ -133,10 +133,17 @@ void RawImageSource::getAutoMatchedToneCurve(std::vector<double> &outCurve)
|
|||||||
source.reset(thumb->quickProcessImage(neutral, rheight, TI_Nearest));
|
source.reset(thumb->quickProcessImage(neutral, rheight, TI_Nearest));
|
||||||
}
|
}
|
||||||
std::unique_ptr<IImage8> target;
|
std::unique_ptr<IImage8> target;
|
||||||
{
|
if (true) {
|
||||||
|
neutral.icm.working = "RT_sRGB";
|
||||||
|
// faster, but has problems likely due to color space transformations that I do not properly understand...
|
||||||
double scale;
|
double scale;
|
||||||
std::unique_ptr<Thumbnail> thumb(Thumbnail::loadFromRaw(getFileName(), rml, sensor_type, w, h, 1, 0.0, false));
|
std::unique_ptr<Thumbnail> thumb(Thumbnail::loadFromRaw(getFileName(), rml, sensor_type, w, h, 1, 0.0, false));
|
||||||
target.reset(thumb->processImage(neutral, sensor_type, rheight, TI_Nearest, getMetaData(), scale));
|
target.reset(thumb->processImage(neutral, sensor_type, rheight, TI_Nearest, getMetaData(), scale, false));
|
||||||
|
} else {
|
||||||
|
ProcessingJob *job = ProcessingJob::create(this, neutral, true);
|
||||||
|
int err = 0;
|
||||||
|
std::unique_ptr<IImagefloat> tmp(processImage(job, err, nullptr, false));
|
||||||
|
target.reset(static_cast<Imagefloat *>(tmp.get())->to8());
|
||||||
}
|
}
|
||||||
if (target->getWidth() != source->getWidth() || target->getHeight() != source->getHeight()) {
|
if (target->getWidth() != source->getWidth() || target->getHeight() != source->getHeight()) {
|
||||||
Image8 *tmp = new Image8(source->getWidth(), source->getHeight());
|
Image8 *tmp = new Image8(source->getWidth(), source->getHeight());
|
||||||
|
@ -915,7 +915,7 @@ IImage8* Thumbnail::quickProcessImage (const procparams::ProcParams& params, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Full thumbnail processing, second stage if complete profile exists
|
// Full thumbnail processing, second stage if complete profile exists
|
||||||
IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorType sensorType, int rheight, TypeInterpolation interp, const FramesMetaData *metadata, double& myscale)
|
IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorType sensorType, int rheight, TypeInterpolation interp, const FramesMetaData *metadata, double& myscale, bool forMonitor)
|
||||||
{
|
{
|
||||||
unsigned int imgNum = 0;
|
unsigned int imgNum = 0;
|
||||||
if (isRaw) {
|
if (isRaw) {
|
||||||
@ -1293,8 +1293,13 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT
|
|||||||
//ipf.colorCurve (labView, labView);
|
//ipf.colorCurve (labView, labView);
|
||||||
|
|
||||||
// obtain final image
|
// obtain final image
|
||||||
Image8* readyImg = new Image8 (fw, fh);
|
Image8* readyImg = nullptr;
|
||||||
ipf.lab2monitorRgb (labView, readyImg);
|
if (forMonitor) {
|
||||||
|
readyImg = new Image8 (fw, fh);
|
||||||
|
ipf.lab2monitorRgb (labView, readyImg);
|
||||||
|
} else {
|
||||||
|
readyImg = ipf.lab2rgb(labView, 0, 0, fw, fh, params.icm);
|
||||||
|
}
|
||||||
delete labView;
|
delete labView;
|
||||||
delete baseImg;
|
delete baseImg;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public:
|
|||||||
|
|
||||||
void init ();
|
void init ();
|
||||||
|
|
||||||
IImage8* processImage (const procparams::ProcParams& pparams, eSensorType sensorType, int rheight, TypeInterpolation interp, const FramesMetaData *metadata, double& scale);
|
IImage8* processImage (const procparams::ProcParams& pparams, eSensorType sensorType, int rheight, TypeInterpolation interp, const FramesMetaData *metadata, double& scale, bool forMonitor=true);
|
||||||
IImage8* quickProcessImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp);
|
IImage8* quickProcessImage (const procparams::ProcParams& pparams, int rheight, TypeInterpolation interp);
|
||||||
int getImageWidth (const procparams::ProcParams& pparams, int rheight, float &ratio);
|
int getImageWidth (const procparams::ProcParams& pparams, int rheight, float &ratio);
|
||||||
void getDimensions (int& w, int& h, double& scaleFac);
|
void getDimensions (int& w, int& h, double& scaleFac);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user