Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which script is used to get the correct GT? #6

Open
0Error0Warning opened this issue Nov 2, 2022 · 1 comment
Open

Which script is used to get the correct GT? #6

0Error0Warning opened this issue Nov 2, 2022 · 1 comment

Comments

@0Error0Warning
Copy link

To obtain sRGB images of ground truth,I processed the images in two ways with your scripts. For detail:
1st: run '1_make_mixture_map.py' with 'VISUALIZE=True'. And I got GT sRGB image, e.g. 'Placexxx_wb12.png'.
2nd: run '2_preprocess_data.py' with full resolution(i.e. SQUARE_CROP = False, SIZE = None, TEST_SIZE = None), and got GT tiff image, e.g. 'Placexxx_12_gt.tiff'. Then processed it with 'visualize.py' and got GT sRGB image, e.g. 'Placexxx_12_gt.png'.
HOWEVER, I compared these two sRGB images, and they are different.
What causes this and what should I do to fix it?
Looking forward to your reply.

@DY112
Copy link
Owner

DY112 commented Nov 11, 2022

Hi, @0Error0Warning, thank you for your interest about my work.
I saw that issue in my repo, but I’ve been quite busy these days to have time to answer the issue.
I am sorry about that :(

I think that there is a slight difference between two visualization process.

In 1_make_mixture_map.py, the white balance process is done by following steps.

  1. Open raw image using rawpy (Directly open RAW file, not using DCRAW or Tiff)
  2. Apply WB using illumination map, directly accessing to raw_image_array in RawPy instance (apply_wb_raw function, line 194)
  3. Visualize sRGB image using postprocess function
    So [open RAW → direct WB application → postprocess]

In visualize.py,

  1. GT tiff file is generated through [ Tiff conversion using DCRAW → WB application → saved as Tiff ]
  2. To visualize tiff file into sRGB, we utilize fake raw file and copy pixels into RAW instance
  3. Visualize sRGB image using postprocess function
    So [Tiff conversion using DCRAW → WB application in Tiff → overwrite pixels into fake RAW instance → postprocess]

You can compare the differences in these processes and explore where the differences in values occur.
You can compare the value of raw_image after opening the RAW image with Rawpy with the value saved as a TIFF file using DCRAW.
However, sRGB images are images that have undergone a lot of post-processing, so if you use images that are visualized according to one criterion, there should be no problem.
For white balance research, the sRGB image is for reference only. If you want to compare the correct values, please use the values in the RAW domain.
The pixel values in the dataset I provide are all provided in TIFF format using DCRAW, so they will have consistent values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants