chimcla.stage_1a_preprocessing

This module contains several preprocessing steps which were distributed over multiple scripts in earlier versions.

Contains class Stage1Preprocessor with method pipeline(self, fpath):

  • self.step01_mogrify_1000jpg(iic)

  • self.step02_empty_slot_detection(iic)

  • self.step03_cropping(iic)

  • self.step04_shading_correction(iic)

Module Contents

Classes

Stage1Preprocessor

Functions

main

Data

pjoin

CHIMCLA_DATA_INDICATOR_FNAME

_EMPTY_SLOT_REF_IMG_PATH

_EMPTY_SLOT_REF_IMG_ROI

API

chimcla.stage_1a_preprocessing.pjoin

None

chimcla.stage_1a_preprocessing.CHIMCLA_DATA_INDICATOR_FNAME

chimcla_data.txt’

chimcla.stage_1a_preprocessing._EMPTY_SLOT_REF_IMG_PATH

‘pjoin(…)’

chimcla.stage_1a_preprocessing._EMPTY_SLOT_REF_IMG_ROI

(30, 930, 85, 600)

class chimcla.stage_1a_preprocessing.Stage1Preprocessor(args)[source]

Initialization

main()[source]
pipeline(fpath)[source]
step01_mogrify_1000jpg(iic: chimcla.util.ImageInfoContainer)[source]
debug_step02_async_experiments(iic: chimcla.util.ImageInfoContainer)[source]

This method serves to experiment with the async execution. Results: - instance variables might be changed from outside - local variables remain unchanged - self.async_res.append(…) works (ordering is like it is)

step02_empty_slot_detection(iic: chimcla.util.ImageInfoContainer)[source]
step03_cropping(iic: chimcla.util.ImageInfoContainer)[source]
step04_shading_correction(iic: chimcla.util.ImageInfoContainer)[source]

Apply a predefined correction matrix to the lightness channel

get_img_for_empty_slot_comp(img_fpath)[source]
_resize_for_comparison(img)[source]
_get_correlation(img, img_ref)[source]
static _lightness_curve_of_y(img: numpy.ndarray)[source]

:param img: ndarray with shape[2] = 3 (BGR color convention)

static _get_lower_edge(LL)[source]

:param LL: 1d lightness arrow (averaged of x direction) in dependence of y

get_error_report()[source]

return a dict which maps from error messages to iic used for testing

get_data_base_dir(start: str)[source]
chimcla.stage_1a_preprocessing.main(args=None)[source]