genesys: Adjust host side calibration by shading pixel offset

merge-requests/244/head
Povilas Kanapickas 2020-05-26 01:10:51 +03:00
rodzic 8a10e33a13
commit 56db2b988a
4 zmienionych plików z 14 dodań i 4 usunięć

Wyświetl plik

@ -921,6 +921,8 @@ void compute_session(const Genesys_Device* dev, ScanSession& s, const Genesys_Se
s.buffer_size_read = s.output_line_bytes_raw * 64;
compute_session_pixel_offsets(dev, s, sensor);
s.shading_pixel_offset = sensor.shading_pixel_offset;
if (dev->model->asic_type == AsicType::GL124 ||
dev->model->asic_type == AsicType::GL845 ||
dev->model->asic_type == AsicType::GL846)
@ -1071,10 +1073,10 @@ ImagePipelineStack build_image_pipeline(const Genesys_Device& dev, const ScanSes
!has_flag(dev.model->flags, ModelFlag::DISABLE_SHADING_CALIBRATION) &&
!has_flag(session.params.flags, ScanFlag::DISABLE_SHADING))
{
unsigned offset_pixels = session.params.startx + dev.calib_session.shading_pixel_offset;
unsigned offset_bytes = offset_pixels * dev.calib_session.params.channels;
pipeline.push_node<ImagePipelineNodeCalibrate>(dev.dark_average_data,
dev.white_average_data,
session.params.startx *
dev.calib_session.params.channels);
dev.white_average_data, offset_bytes);
if (log_image_data) {
pipeline.push_node<ImagePipelineNodeDebug>(debug_prefix + "_9_after_calibrate.tiff");

Wyświetl plik

@ -286,7 +286,8 @@ struct Genesys_Sensor {
// How many real pixels correspond to one shading pixel that is sent to the scanner
unsigned shading_factor = 1;
// How many pixels the shading data is offset from the acquired data
// How many pixels the shading data is offset to the right from the acquired data. Calculated
// in shading resolution.
int shading_pixel_offset = 0;
// This defines the ratio between logical pixel coordinates and the pixel coordinates sent to

Wyświetl plik

@ -126,6 +126,7 @@ bool ScanSession::operator==(const ScanSession& other) const
conseq_pixel_dist == other.conseq_pixel_dist &&
output_segment_pixel_group_count == other.output_segment_pixel_group_count &&
output_segment_start_offset == other.output_segment_start_offset &&
shading_pixel_offset == other.shading_pixel_offset &&
buffer_size_read == other.buffer_size_read &&
enable_ledadd == other.enable_ledadd &&
use_host_side_calib == other.use_host_side_calib;
@ -161,6 +162,7 @@ std::ostream& operator<<(std::ostream& out, const ScanSession& session)
<< " conseq_pixel_dist: " << session.conseq_pixel_dist << '\n'
<< " output_segment_pixel_group_count: "
<< session.output_segment_pixel_group_count << '\n'
<< " shading_pixel_offset: " << session.shading_pixel_offset << '\n'
<< " buffer_size_read: " << session.buffer_size_read << '\n'
<< " enable_ledadd: " << session.enable_ledadd << '\n'
<< " use_host_side_calib: " << session.use_host_side_calib << '\n'

Wyświetl plik

@ -306,6 +306,10 @@ struct ScanSession {
// Currently it's always zero.
unsigned output_segment_start_offset = 0;
// How many pixels the shading data is offset to the right from the acquired data. Calculated
// in shading resolution.
int shading_pixel_offset = 0;
// the size of the read buffer.
size_t buffer_size_read = 0;
@ -362,6 +366,7 @@ void serialize(Stream& str, ScanSession& x)
serialize(str, x.conseq_pixel_dist);
serialize(str, x.output_segment_pixel_group_count);
serialize(str, x.output_segment_start_offset);
serialize(str, x.shading_pixel_offset);
serialize(str, x.buffer_size_read);
serialize(str, x.enable_ledadd);
serialize(str, x.use_host_side_calib);