-
Notifications
You must be signed in to change notification settings - Fork 4
New Gray Scale Types
There is currently no UI to add configuration for a new grayscale type / manufacturer.
It is however possible to add a new section in the config file that sets the parameters for grayscale detection.
The installed copy is located in ~/.scan-o-matic/data/config
and will not be overwritten unless you say 'Y' to this question during installation. However, keep a copy of your settings elsewhere just in case.
To start this, you need to have scanned an image of your fixture in the scanner at the target dpi (600 dpi is currently used).
Start by copying the section for one of the included.
[Kodak]
default = True
lower_than_half_width = 350
width = 55
length = 28.3
higher_than_half_width = 150
min_width = 30
sections = 23
targets = [0, 2, 4, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82]
Start by giving the section a new unique name. Use only upper and lower case ascii letters and numbers.
- Make sure only one of all grayscales is set to default.
- Measure the exact width in terms of pixels and update
width
setting. - Count the number of segments, starting with the fully transparent going up to the last smaller non-segment and update
section
. Image to be included - Measure the entire length of the grayscale in pixels and divide by number of sections.
- If the manufacturer supplied opacity (my assumption is that Kodak had it on a range from 0 - 100) you could use these values to set
targets
, else I would recommend that you calculate them from the mean or IQR mean of each segment on a 0 - 100 scale. Note: You may loose some accuracy in the measurements since you loose direct comparison to how the calibration experiment was originally done, but precision should be maintained. We are building the interface for adding new "CCC":s -- calibration functions for going from transparencies to cell counts, and once that is done you could do your own calibration with your grayscale variant and the potentially lowered accuracy should be resolved. -
min_width
should be lower thanwidth
and allows for slight rotations of the grayscale at the cost of some precision. You should not allow it much smaller than 30. Our suggestion is keeping the same ratio as above (30 / 55) but if you get a lower value than 30, bias it towards 30. -
lower_than_half_width
andhigher_than_half_width
help localizing the grayscale and could probably be left as is. If robustness of grayscale detection seems low, consider changing them first maintianing their ratio to the total length of the grayscale (23 * 28.3 above). If this doesn't work, you would be recommended to attempt understanding the relevant part of the code or simply experiment around.
The red marks the length of the grayscale.
A note about the above image
Care should be taken to avoid that the grayscale curves up/bends like in the image above. However for minor such issues, the detection will manage to compensate.
If you've successfully made a grayscale configuration and you are happy with how it performs, please consider opening an issue on the repository about including your settings.