Call setBorder() before demosaic

This commit is contained in:
heckflosse 2018-06-28 15:19:37 +02:00
parent e7010e6a4d
commit f55d89e576
2 changed files with 14 additions and 7 deletions

View File

@ -230,6 +230,13 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
printf ("Demosaic X-Trans image with using method: %s\n", rp.xtranssensor.method.c_str()); printf ("Demosaic X-Trans image with using method: %s\n", rp.xtranssensor.method.c_str());
} }
} }
if(imgsrc->getSensorType() == ST_BAYER) {
if(params.raw.bayersensor.method!= RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)) {
imgsrc->setBorder(params.raw.bayersensor.border);
} else {
imgsrc->setBorder(4);
}
}
bool autoContrast = false; bool autoContrast = false;
double contrastThreshold = 0.f; double contrastThreshold = 0.f;
imgsrc->demosaic (rp, autoContrast, contrastThreshold); //enabled demosaic imgsrc->demosaic (rp, autoContrast, contrastThreshold); //enabled demosaic
@ -243,10 +250,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
highDetailRawComputed = false; highDetailRawComputed = false;
} }
if(imgsrc->getSensorType() == ST_BAYER && params.raw.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)) {
imgsrc->setBorder(params.raw.bayersensor.border);
}
if (params.retinex.enabled) { if (params.retinex.enabled) {
lhist16RETI (32768); lhist16RETI (32768);
lhist16RETI.clear(); lhist16RETI.clear();

View File

@ -203,12 +203,16 @@ private:
if (pl) { if (pl) {
pl->setProgress (0.20); pl->setProgress (0.20);
} }
if(imgsrc->getSensorType() == ST_BAYER) {
if(params.raw.bayersensor.method!= RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)) {
imgsrc->setBorder(params.raw.bayersensor.border);
} else {
imgsrc->setBorder(4);
}
}
double contrastThresholdDummy; double contrastThresholdDummy;
imgsrc->demosaic (params.raw, false, contrastThresholdDummy); imgsrc->demosaic (params.raw, false, contrastThresholdDummy);
if(imgsrc->getSensorType() == ST_BAYER && params.raw.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)) {
imgsrc->setBorder(params.raw.bayersensor.border);
}
if (pl) { if (pl) {
pl->setProgress (0.30); pl->setProgress (0.30);