Menu

#394 Nikon D3100 image dimensions - ufraw 0.20

open
nobody
None
5
2015-02-15
2015-01-15
No

I have Nikon D3100 camera, supported by ufraw since version 0.18.
Camera image dimensions are 4644x3084. This is correct.

After the installation of ufraw 0.20:
Camera image dimensions are 4723x3136. This is wrong.

Discussion

  • Stanislav Kozina

    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
  • Niels Kristian Bech Jensen

    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

     
  • Frank Markesteijn

    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?

     
  • Niels Kristian Bech Jensen

    This behaviour is not specific to the Nikon D3100. It is the same for all camera models.

    I think it should work like this:

    1. Turn on autocorrection and autocrop if the camera and lens model is in the lensfun database.
    2. Turn off autocorrection if any changes are made to the various parameters. Use the changed parameters for corrections. Keep autocrop enabled.
    3. 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
  • Frank Markesteijn

    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.

     
  • Frank Markesteijn

    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.

     
  • Frank Markesteijn

    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.

     
  • Niels Kristian Bech Jensen

    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

     
  • Frank Markesteijn

    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.

     
  • Niels Kristian Bech Jensen

    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

     
  • Frank Markesteijn

    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.

     
  • Stanislav Kozina

    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.

     

Log in to post a comment.

MongoDB Logo MongoDB