kopia lustrzana https://gitlab.com/sane-project/backends
sheetfed calibration tuning
- use sensor max resolution to do led/offset/gain calibration - use different thresholds when detecting white/black pixels in search strip function - tune device flags for DP485, DP487 and XP100merge-requests/1/head
rodzic
e63118298a
commit
d4079557e4
|
@ -3678,6 +3678,7 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
|
|||
{
|
||||
SANE_Status status = SANE_STATUS_GOOD;
|
||||
SANE_Bool forward = SANE_TRUE;
|
||||
int xres;
|
||||
|
||||
DBG (DBG_proc, "genesys_sheetfed_calibration: start\n");
|
||||
if (dev->model->cmd_set->search_strip == NULL)
|
||||
|
@ -3697,13 +3698,17 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
|
|||
return status;
|
||||
}
|
||||
|
||||
int yres;
|
||||
|
||||
DBG (DBG_info, "genesys_flatbed_calibration\n");
|
||||
|
||||
yres = dev->sensor.optical_res;
|
||||
if (dev->settings.yres <= dev->sensor.optical_res / 2)
|
||||
yres /= 2;
|
||||
/* led, offset and gain calibration are influenced by scan
|
||||
* settings. So we set it to sensor resolution */
|
||||
xres = dev->sensor.optical_res;
|
||||
dev->settings.xres = dev->sensor.optical_res;
|
||||
/* XP200 needs to calibrate a full and half sensor's resolution */
|
||||
if (dev->model->ccd_type == CIS_XP200
|
||||
&& dev->settings.xres <= dev->sensor.optical_res / 2)
|
||||
dev->settings.xres /= 2;
|
||||
|
||||
/* the afe needs to sends valid data even before calibration */
|
||||
|
||||
|
@ -3744,7 +3749,7 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
|
|||
|
||||
/* since all the registers are set up correctly, just use them */
|
||||
|
||||
status = dev->model->cmd_set->coarse_gain_calibration (dev, yres);
|
||||
status = dev->model->cmd_set->coarse_gain_calibration (dev, xres);
|
||||
if (status != SANE_STATUS_GOOD)
|
||||
{
|
||||
DBG (DBG_error,
|
||||
|
@ -3880,6 +3885,9 @@ genesys_sheetfed_calibration (Genesys_Device * dev)
|
|||
sane_strstatus (status));
|
||||
return status;
|
||||
}
|
||||
|
||||
/* resotre settings */
|
||||
dev->settings.xres = xres;
|
||||
DBG (DBG_proc, "genesys_sheetfed_calibration: end\n");
|
||||
return SANE_STATUS_GOOD;
|
||||
}
|
||||
|
|
|
@ -1456,9 +1456,10 @@ static Genesys_Model visioneer_xp100_r3_model = {
|
|||
MOTOR_ROADWARRIOR,
|
||||
GENESYS_FLAG_LAZY_INIT /* Which flags are needed for this scanner? */
|
||||
| GENESYS_FLAG_SKIP_WARMUP
|
||||
| GENESYS_FLAG_NO_CALIBRATION,
|
||||
GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW,
|
||||
300,
|
||||
| GENESYS_FLAG_OFFSET_CALIBRATION
|
||||
| GENESYS_FLAG_DARK_CALIBRATION,
|
||||
GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE,
|
||||
100,
|
||||
400
|
||||
};
|
||||
|
||||
|
@ -1560,7 +1561,7 @@ static Genesys_Model syscan_docketport_485_model = {
|
|||
| GENESYS_FLAG_SKIP_WARMUP
|
||||
| GENESYS_FLAG_OFFSET_CALIBRATION
|
||||
| GENESYS_FLAG_DARK_CALIBRATION,
|
||||
GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW,
|
||||
GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE,
|
||||
100,
|
||||
400
|
||||
};
|
||||
|
@ -1613,7 +1614,7 @@ static Genesys_Model dct_docketport_487_model = {
|
|||
| GENESYS_FLAG_OFFSET_CALIBRATION
|
||||
| GENESYS_FLAG_DARK_CALIBRATION
|
||||
| GENESYS_FLAG_UNTESTED,
|
||||
GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW,
|
||||
GENESYS_HAS_SCAN_SW | GENESYS_HAS_PAGE_LOADED_SW | GENESYS_HAS_CALIBRATE,
|
||||
100,
|
||||
400
|
||||
};
|
||||
|
|
|
@ -5040,7 +5040,7 @@ gl646_search_strip (Genesys_Device * dev, SANE_Bool forward, SANE_Bool black)
|
|||
for (x = 0; x < settings.pixels; x++)
|
||||
{
|
||||
/* when searching for black, detect white pixels */
|
||||
if (black && data[y * settings.pixels + x] > 60)
|
||||
if (black && data[y * settings.pixels + x] > 90)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
|
|
@ -6073,7 +6073,7 @@ gl841_search_strip (Genesys_Device * dev, SANE_Bool forward, SANE_Bool black)
|
|||
for (x = 0; x < pixels; x++)
|
||||
{
|
||||
/* when searching for black, detect white pixels */
|
||||
if (black && data[y * pixels + x] > 60)
|
||||
if (black && data[y * pixels + x] > 90)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue