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

Wrong image geometries reported by LibRaw 201910 snapshot? #252

Closed
jconejero opened this issue Nov 14, 2019 · 4 comments
Closed

Wrong image geometries reported by LibRaw 201910 snapshot? #252

jconejero opened this issue Nov 14, 2019 · 4 comments

Comments

@jconejero
Copy link

We are receiving bug reports like the following one after updating our RAW support module to LibRaw 201910 snapshot:

https://pixinsight.com/forum/index.php?topic=14206.0

It seems that some reported coordinates of the visible image region (the height, width, top_margin and left_margin members of libraw_image_sizes_t) are wrong. Currently we have several reports of users with Canon EOS 600D cameras, as the above bug report; I cannot confirm if the same happens with other cameras. Raw dimensions (raw_height, raw_width) are correct.

If this is a confirmed bug, can we have it fixed soon, please?

At any rate, thank you so much for your great work on LibRaw.

Juan Conejero
PixInsight Development Team
https://pixinsight.com/

@LibRaw
Copy link
Owner

LibRaw commented Nov 14, 2019

This is not bug, but intentional (so won't be fixed).
The problem:
LibRaw::COLOR(row,col) operates in active area coordinates, (0,0) relates to (left_margin,top_margin) of entire sensor.
To make this call valid for both active area and entire sensor area, left_margin/top_margin are always made even for bayer images (and multiple of 6 for X-Trans images)

@LibRaw LibRaw closed this as completed Nov 14, 2019
@jconejero
Copy link
Author

Of course, that makes perfect sense. So we'll stick to the 201910 snapshot, and will recommend our users to repeat their image preprocessing tasks with the new version. Thank you.

@LibRaw
Copy link
Owner

LibRaw commented Nov 14, 2019

BTW, crop area may change for any camera because of several causes:

  • change in LibRaw for cameras w/ hardcoded crops
  • change in LibRaw for specific vendor or model: switch from hardcoded crop to crop specified in metadata
  • change (update) in camera firmware that results in metadata-recorded crop change.

So, for processing like 'dark fields', 'bias', 'flat fields', etc it always safer to save entire sensor area, not cropped area (and do crop on final stage)

@jconejero
Copy link
Author

Thank you for the information. I didn't know that raw cropping areas can be subject to these variations.

We have an option to disable cropping in our RAW support module. However, it's true that most of our users don't enable it and prefer to crop the visible region automatically at the image calibration stage. I'll consider implementing a slightly more 'persuasive' option to invite them to work on the entire raw frames.

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