Nikon D3100 camera image dimensions are 4608x3072 (according to vendor specification).
Image processing (.nef->.jpg, default parameters) in ufraw 0.18.
Output image dimensions are 4644x3084.
Image processing (.nef->.jpg, default parameters) in ufraw 0.19, 0.20.
Output image dimensions are variable for various images (from the same camera) and depend on focal length used when the image was created. For example:
Output image dimensions are 4723x3136 in case of focal length 18.0 mm (35 mm equivalent: 27.0 mm).
Output image dimensions are 4640x3125 in case of focal length 38.0 mm (35 mm equivalent: 57.0 mm).
Since the image dimensions are larger (than expected), there are clearly visible lens deformations and black areas on the edges of images.
According to ufraw documentation, lens distortion corrections using lensfun was implemented in ufraw 0.17 and enabled by default ('--lensfun=auto').
When ufraw 0.20 is executed with '--lensfun=none' option:
Output image dimensions are 4644x3084, regardless of focal length used.
My expectation is that output image dimensions should be the same for all images from the specific camera model (unless optional crop or resize parameters are used).
I understand that lensfun feature of ufraw can be disabled but since it is enabled by default, it seems strange that the output image dimensions are variable.
It is somewhat awkward that manual crop has to be used to get the same dimensions for all images.
Perhaps it would make sense to modify 'auto-crop' option so that the image dimensions would be always the same, according to camera specification.
I am not quite sure if it would mean to hardcode camera image dimensions for each camera model in ufraw or if image dimensions from dcraw could be used for this purpose:
$dcraw -i -v img.nef
Thumb size: 4608 x 3072
Full size: 4672 x 3084
Image size: 4644 x 3084
Output size: 4644 x 3084
Any feedback on this topic will be appreciated.
Last edit: Stanislav Kozina 2015-01-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, it is still there, even with those two sample images. To confirm you just have to go to the lensfun tab and set the distortion model to 'None' (or change the focal length with the second image) and the image size changes.
The question is if it is a bug or a feature?
Regards,
Niels Kristian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, it took a while but I can now reproduce it, Lensfun autocorrection needs to be active, by default it is, on my machine it wasn't. When autocorrection is turned on, setting the model to none removes the correction and everything is as expected, no black borders, when you then change any of the lens parameters in the combo boxes, autocorrection kicks in again, the model changes to whatever autocorrection set it to and the image geometry is modified, those modifications are correct. If you do not want this behaviour you can turn autocorrection off. Point is though that UFRaw's behaviour is not consistent and perhaps counter intuitive, changing any parameter (sliders) under the model will turn off autocorrection but, changing the model itself does not, it probably should but, should changing the lensparameters also turn off autocorrection or do we leave that as is and should autocrop be on by default?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This behaviour is not specific to the Nikon D3100. It is the same for all camera models.
I think it should work like this:
Turn on autocorrection and autocrop if the camera and lens model is in the lensfun database.
Turn off autocorrection if any changes are made to the various parameters. Use the changed parameters for corrections. Keep autocrop enabled.
Turn off autocorrection and autocrop if a correction model is chosen that is not found in the lensfun database or if model == 'None'. This is also the setting if the camera and/or lens model is not in the lensfun database.
I think the change in image dimensions is the correct behaviour. We would need some sort of interpolation after cropping to keep constant image dimensions through corrections at the cost of image noise or other artifacts.
What do you think?
Regards,
Niels Kristian
Last edit: Niels Kristian Bech Jensen 2015-02-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
1 & 2: Agree
3: Can there be more then one model in the database? If so, is there any indication to the user that that is the case? If both are true then turning autocorrection off only when the model is not found would make sense, else simply changing the model should turn it off, I think.
Turning autocrop off with autocorrection would be consistent but, I find autocrop doesn't get in the way, if it is not needed it does not appear to do anything, I would say leave it on.
4: I noticed that autocrop does not further crop the image when CA correction is applied, this has not been implemented, do we want that? I do.
Regards, Frank.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
1 & 2: Agree.
3: I think autocorrection should be turned off when anything is changed, it is then no longer the automatically chosen setting and the user can click the autocorrection button whenever they want. Also turning off autocrop would be consistent but, I find it does not get in the way, when it is not needed it does not appear to do anything, I would leave it on.
4: When CA correction is applied autocrop does not crop the image further, that has not been implemented, do we want that?
Bye, Frank.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
1 & 2: Agree.
3: I think autocorrection should be turned off when anything is changed, it is then no longer the automatically chosen setting and the user can click the autocorrection button whenever they want. Also turning off autocrop would be consistent but, I find it does not get in the way, when it is not needed it does not appear to do anything, I would leave it on.
4: When CA correction is applied autocrop does not crop the image further, that has not been implemented, do we want that?
Bye, Frank.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
In the lens geometry tab, the upper menubutton already turns of the auto stuff, so I copied the function that does that, OriginalValueChangedEvent() in the LensGeometry namespace in ufraw_lensfun.cc to the other three namespaces, Distorsion, CFA an Vignetting and that does the trick. Is this how we wan't it to be?
Bye Frank.
Hi,
without the patch, when you set the model to none, in the distorsion tab (or any other) and then change something in the lensparameter comboboxes UFRaw will set the model back to whatever is in the database and apply a transformation to the image. With the patch, after setting the model to none, modifying the lensparameters will do nothing, which is what I would expect after turning off distortion correction.
Bye.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, how will the patch change image processing if ufraw is executed from command line or in case of ufraw-batch?
Is it correct that lensfun autocorrection is applied even when the camera and/or lens model is not in the lensfun database? Is it possible to check this before lensfun autocorrection is applied and disable it in such case (although it is enabled by default)?
Please correct me if I am wrong. I am not sure if I understand it in detail. Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nikon D3100 camera image dimensions are 4608x3072 (according to vendor specification).
Image processing (.nef->.jpg, default parameters) in ufraw 0.18.
Output image dimensions are 4644x3084.
Image processing (.nef->.jpg, default parameters) in ufraw 0.19, 0.20.
Output image dimensions are variable for various images (from the same camera) and depend on focal length used when the image was created. For example:
Output image dimensions are 4723x3136 in case of focal length 18.0 mm (35 mm equivalent: 27.0 mm).
Output image dimensions are 4640x3125 in case of focal length 38.0 mm (35 mm equivalent: 57.0 mm).
Since the image dimensions are larger (than expected), there are clearly visible lens deformations and black areas on the edges of images.
According to ufraw documentation, lens distortion corrections using lensfun was implemented in ufraw 0.17 and enabled by default ('--lensfun=auto').
When ufraw 0.20 is executed with '--lensfun=none' option:
Output image dimensions are 4644x3084, regardless of focal length used.
My expectation is that output image dimensions should be the same for all images from the specific camera model (unless optional crop or resize parameters are used).
I understand that lensfun feature of ufraw can be disabled but since it is enabled by default, it seems strange that the output image dimensions are variable.
It is somewhat awkward that manual crop has to be used to get the same dimensions for all images.
Perhaps it would make sense to modify 'auto-crop' option so that the image dimensions would be always the same, according to camera specification.
I am not quite sure if it would mean to hardcode camera image dimensions for each camera model in ufraw or if image dimensions from dcraw could be used for this purpose:
$dcraw -i -v img.nef
Thumb size: 4608 x 3072
Full size: 4672 x 3084
Image size: 4644 x 3084
Output size: 4644 x 3084
Any feedback on this topic will be appreciated.
Last edit: Stanislav Kozina 2015-01-18
Hello Stanislav,
I can't confirm your observations, I tried 0.22 with this image:
http://movies.dpreview.com.s3.amazonaws.com/nikon_d3100/DSC_0002.NEF.zip
Found on this page:
http://www.dpreview.com/reviews/nikond3100/18
and this one:
http://img.photographyblog.com/reviews/nikon_d3100/sample_images/nikon_d3100_09.nef
found here:
http://www.photographyblog.com/reviews/nikon_d3100_review/sample_images/
everything is fine with these.
Please try UFRaw 0.22, If the problem persists please make one or more images available for download.
Frank.
No, it is still there, even with those two sample images. To confirm you just have to go to the lensfun tab and set the distortion model to 'None' (or change the focal length with the second image) and the image size changes.
The question is if it is a bug or a feature?
Regards,
Niels Kristian
Okay, it took a while but I can now reproduce it, Lensfun autocorrection needs to be active, by default it is, on my machine it wasn't. When autocorrection is turned on, setting the model to none removes the correction and everything is as expected, no black borders, when you then change any of the lens parameters in the combo boxes, autocorrection kicks in again, the model changes to whatever autocorrection set it to and the image geometry is modified, those modifications are correct. If you do not want this behaviour you can turn autocorrection off. Point is though that UFRaw's behaviour is not consistent and perhaps counter intuitive, changing any parameter (sliders) under the model will turn off autocorrection but, changing the model itself does not, it probably should but, should changing the lensparameters also turn off autocorrection or do we leave that as is and should autocrop be on by default?
This behaviour is not specific to the Nikon D3100. It is the same for all camera models.
I think it should work like this:
I think the change in image dimensions is the correct behaviour. We would need some sort of interpolation after cropping to keep constant image dimensions through corrections at the cost of image noise or other artifacts.
What do you think?
Regards,
Niels Kristian
Last edit: Niels Kristian Bech Jensen 2015-02-12
Hi,
1 & 2: Agree
3: Can there be more then one model in the database? If so, is there any indication to the user that that is the case? If both are true then turning autocorrection off only when the model is not found would make sense, else simply changing the model should turn it off, I think.
Turning autocrop off with autocorrection would be consistent but, I find autocrop doesn't get in the way, if it is not needed it does not appear to do anything, I would say leave it on.
4: I noticed that autocrop does not further crop the image when CA correction is applied, this has not been implemented, do we want that? I do.
Regards, Frank.
Hi,
1 & 2: Agree.
3: I think autocorrection should be turned off when anything is changed, it is then no longer the automatically chosen setting and the user can click the autocorrection button whenever they want. Also turning off autocrop would be consistent but, I find it does not get in the way, when it is not needed it does not appear to do anything, I would leave it on.
4: When CA correction is applied autocrop does not crop the image further, that has not been implemented, do we want that?
Bye, Frank.
Hi,
1 & 2: Agree.
3: I think autocorrection should be turned off when anything is changed, it is then no longer the automatically chosen setting and the user can click the autocorrection button whenever they want. Also turning off autocrop would be consistent but, I find it does not get in the way, when it is not needed it does not appear to do anything, I would leave it on.
4: When CA correction is applied autocrop does not crop the image further, that has not been implemented, do we want that?
Bye, Frank.
CA does not contribute to the black corners removed by autocrop AFAIK. That is why it is not applied for that correction. I agree with your point 1-3.
Regards,
Niels Kristian
Hello,
In the lens geometry tab, the upper menubutton already turns of the auto stuff, so I copied the function that does that, OriginalValueChangedEvent() in the LensGeometry namespace in ufraw_lensfun.cc to the other three namespaces, Distorsion, CFA an Vignetting and that does the trick. Is this how we wan't it to be?
Bye Frank.
I am not sure what this patch does. I do not see any differences on my system - the reset button seems to work in all tabs even without the patch.
Please describe how to reproduce the changes. What happens step-by-step before and after?
Regards,
Niels Kristian
Hi,
without the patch, when you set the model to none, in the distorsion tab (or any other) and then change something in the lensparameter comboboxes UFRaw will set the model back to whatever is in the database and apply a transformation to the image. With the patch, after setting the model to none, modifying the lensparameters will do nothing, which is what I would expect after turning off distortion correction.
Bye.
Hi, how will the patch change image processing if ufraw is executed from command line or in case of ufraw-batch?
Is it correct that lensfun autocorrection is applied even when the camera and/or lens model is not in the lensfun database? Is it possible to check this before lensfun autocorrection is applied and disable it in such case (although it is enabled by default)?
Please correct me if I am wrong. I am not sure if I understand it in detail. Thank you.