[IPOL discuss] IPOL format conversion
Miguel Colom
Miguel.Colom at cmla.ens-cachan.fr
Mon Dec 26 20:43:08 CET 2011
Dear all,
I have a suggestion to change the way IPOL changes the format of the input
files.
In method "process_input" of the base class base_app.py (lib), the format
of the input image is changed to the format specified in the app.py
subclass of each demo, using the "convert" method of the "image" object.
This conversion is done to ensure that the image that the algorithm will
process is in the expected format. This format is specified in the member
"input_dtype" in the "app" subclass. For example "3x8i" for color images
and "1x8i" for grayscale images.
In my opinion, is the C/C++ code that should take into account how many
channels (and other information) there are in the image and process them,
and not IPOL changing this to force a format.
For example, the noise estimation algorithm can process grayscale and
color images as well, but with the current IPOL implementation, grayscale
images are treated as color images. And even worse, the results for each
channel are different for a grayscale input, because PIL considers that
each channel has a different weight.
The solution I suggest is to change the method "process_input" of
base_app.py, drop member "input_dtype" and get this information from the
input image.
Best,
Miguel
More information about the discuss
mailing list