While browsing the self-o-mat code and where I may want to place changes, I've developed some diagrams which describe the software architecture (or my understanding of it) as well as the image processing chain. This is what I came up with for a combination of
|
ImageProcessor::frameImageForPrint(void *inputImageJpeg, size_t jpegBufferSize, FILTER filter, double filterGain) { |
and
|
ImageProcessor::decodeImageForPrint(void *inputImageJpeg, size_t jpegBufferSize, FILTER filter, double filterGain) { |

I have some remarks/questions which I'd be happy if someone commented on (most likely you, @ClemensElflein ):
- When using templates. Does the
applyFilter function call really work as expected?
|
applyFilter(decodedImage, filter, filterGain); |
-- Shouldn't variables result or decodedImageROI be used to apply the filter? In my understanding decodedImage won't be used anymore. Can you confirm? (Maybe it just did not pop up because the default filter is not very prominent.)
- Why did you call it "compression" here? I think it's "just" applying the alpha channel of the template... or blending template and resized image together... - nothing is really "compressed" here, right?
|
LOG_D(TAG, "Compression Took", std::to_string(((double) tend.tv_sec + 1.0e-9 * tend.tv_nsec) - |
- When no template is applied, the target size is 1773 pixels x 1182 pixels (hard-coded) -- that's a perfect aspect ratio of 1.5 (or 3:2). Assuming 300 dpi printers, this yields 5.91" x 3.94"print size. However, we've documented that the "Hagaki" format ("postcard") has 148 mm x 100 mm or 5.83" x 3.94". Do you see a problem in the .2mm difference? Not too many pixels lost probably.. but do you think this will cause the printer to re-scale unnecessarily?
- I've never used templates before, but I'd like to give them a try. In https://github.com/xtech/self-o-mat/wiki/Configuration#templates we started documenting them in the wiki. How are the other hard-coded values related?
|
float widthFactor = 1864.0f / image.cols; |
|
float heightFactor = 1228.0f / image.rows; |
-- Yet another slightly different aspect ratio (approx. 1.518). 1864 pixels x 1228 pixels seems to be "the perfect size" and would match the template file you provided once, but why this size?
I'd be happy if we could make sense out of these numbers.
While browsing the self-o-mat code and where I may want to place changes, I've developed some diagrams which describe the software architecture (or my understanding of it) as well as the image processing chain. This is what I came up with for a combination of
self-o-mat/src/logic/ImageProcessor.cpp
Line 66 in af62ea5
self-o-mat/src/logic/ImageProcessor.cpp
Line 164 in af62ea5
I have some remarks/questions which I'd be happy if someone commented on (most likely you, @ClemensElflein ):
applyFilterfunction call really work as expected?self-o-mat/src/logic/ImageProcessor.cpp
Line 129 in af62ea5
resultordecodedImageROIbe used to apply the filter? In my understandingdecodedImagewon't be used anymore. Can you confirm? (Maybe it just did not pop up because the default filter is not very prominent.)self-o-mat/src/logic/ImageProcessor.cpp
Line 153 in af62ea5
self-o-mat/src/logic/ImageProcessor.cpp
Lines 273 to 274 in af62ea5
I'd be happy if we could make sense out of these numbers.