CubePlusPlus icon indicating copy to clipboard operation
CubePlusPlus copied to clipboard

The CubePlusPlus\challenge\make_preview.py make the photo a little white

Open RebornForPower opened this issue 2 years ago • 9 comments

Thanks for sharing your work~ I am the freshman and want to learn the color constancy. But now I don't know how to generate the original photo by the gt.csv and *.png. I have tried to restore it but get the wrong result. My result is a little white than the original photo. (The photo is from the simplecube++ and the code is reference from the CubePlusPlus\challenge\make_preview.py

This is my result:

image

but the original photo is:

image

Thanks~

RebornForPower avatar Feb 04 '23 14:02 RebornForPower

Hi!

We rendered the JPG images in the Cube++ dataset with the open-source program, called dcraw. The SimpleCube++ images are just the downscaled and cropped versions of the Cube++ ones. See the detailed dataset description and dataset generating code.

The function in challenge/make_preview.py was provided for IEC#2 (2020) challenge as a pure python script, which can be easily reproduced. Therefore, the results from dcraw processing may appear better. The baseline pipeline from the NIR#3 (2022) challenge is also available.

Beware, the JPG images are included to the dataset for visualization purposes only. As there is no physically accurate way to render RAW image as a JPG one, the result heavily relies on the processing algorithm used.

savfod avatar Feb 04 '23 22:02 savfod

你好!

我们使用开源程序dcraw渲染了 Cube++ 数据集中的 JPG 图像。SimpleCube++ 图像只是 Cube++ 图像的缩小和裁剪版本。请参阅详细的数据集描述和数据集生成代码

challenge/make_preview.py 中的函数是为IEC#2 (2020)挑战提供的纯 Python 脚本,可以轻松重现。因此,dcraw 处理的结果可能看起来更好。NIR #3 (2022)挑战的基线流程也可用。

请注意,JPG 图像仅用于可视化目的。由于没有物理上准确的方法将 RAW 图像渲染为 JPG 图像,因此结果很大程度上取决于所使用的处理算法。

Hello, may I ask, what does it mean that the jpg images in the file are only used for visualization? Can I regard all jpg images in the file as real images of the corresponding images?

xiaosanxiao13 avatar Oct 31 '24 03:10 xiaosanxiao13

Hi,

the fact that the jpg images are only for visualization means that they are not supposed to be used in algorithm training and/or testing since training and testing should be performed on raw images. However, the problem with raw images is that they cannot be rendered directly in the same way as images usually are. Because of that, to give the users a glimpse of what the image content is without them having to process the images as well, jpg images are given for the sake of visualization.

In short, raw images are the real deal here, while jpg images are given only for auxiliary purposes.

nbanic avatar Oct 31 '24 07:10 nbanic

Hello, what I mean is, the real image corresponding to each picture. Since jpg only plays a visualization role, how can I get the real image corresponding to each picture? For example, the images of simplecube++, they are For a single light source, do you use the known rgb combined with the diagonal matrix for conversion?

xiaosanxiao13 avatar Oct 31 '24 08:10 xiaosanxiao13

Each jpg image corresponds to a raw image with the same base name, i.e., disregarding the extension. Did you mean that?

As for what kind of process is used, what would you need the converted image for?

nbanic avatar Oct 31 '24 08:10 nbanic

Not the original image, what I need is the standard image of the corresponding image, that is, what it looks like under normal circumstances without any color cast. I plan to use it and its non-standard image with color cast to make a paired data set, and then come Do training instead of relying on light source estimation

xiaosanxiao13 avatar Nov 01 '24 02:11 xiaosanxiao13

To create a standard image (assuming that this is supposed to me the ground-truth image), you need to perform chromatic, i.e., to adjust the colors on the original image by applying the known ground-truth illumination. The simplest way to do this is to apply the diagonal matrix. Now, here comes the question whether this is what you need. Namely, such an image is still not displayable directly due to its high intensities that go well beyond the [0, 255] range used on most of the display devices. You would also need to perform tone mapping, which is another (mostly) non-linear operation. Along with that, you would also probably want to enhance the colors and other things - basically, do everything a digital camera does. Or maybe you would be satisfied already with the raw image without the color cast? It is not entirely clear to me from your question. Could you give some more detail?

nbanic avatar Nov 01 '24 05:11 nbanic

Thank you very much for your patient answer. What I mean is that I need the real image of the corresponding image. For example, you can see the simplecube++ file. It has train and test. Most of the images inside are black and greenish. I want to get their corresponding real images for my model training. My original intention is whether there is a real image directly, rather than a so-called real image corrected by using a diagonal matrix or the like. If not, how can I achieve this goal? Can it be processed by knowing the chromaticity of the light source?

xiaosanxiao13 avatar Nov 01 '24 08:11 xiaosanxiao13

No, there is no way of telling what a real image is regarding your description.

The really real image is the one in the raw file - it contains the sensor readings and this is the real deal - the pipeline all the way to the writing a raw image file is the instrument for the real images.

Everything else, i.e., the whole camera pipeline that gives you a final jpg image - this is not for real images, but for beautiful images, i.e., it is a beautification instrument, not only a measurement instrument.

For example, if you have a same camera model sold in Hungary or in South Korea, one of them will maybe tend to make the green colors somewhat more vivid since they are culturally preferred in that way on average in one of those countries (here I'm paraphrasing a well known professor with good ties to the industry).

What you may be interested here is not just color constancy, for which the dataset was created in first place (that is, it was created for illumination estimation) - it seems that you are interested in an end-to-end solution that gets a raw image and produces out a jpg image that removes the color cast, but also does all the other steps.

To train a model for this, you would need some final jpg images, i.e., real images as you call them. This dataset does not provide these images since this was not the goal. To get this images, you would have to use some other solution.

Which other solution? This depends on what kind of images you are interested in. For example, it even depends whether these images are intended to be viewed in one country or some other one due to their subjective preferences.

Since there is no objective metric for this, the question that you need to answer is who would be your target audience?

nbanic avatar Nov 01 '24 11:11 nbanic