Results 1 to 15 of 15

Thread: Cropping of RAW images during processing

  1. #1

    Join Date
    Jun 2015
    Location
    Australia
    Posts
    26
    Real Name
    David

    Cropping of RAW images during processing

    A comparison between RAW processing (CR2) using different software yields these different resolutions:

    ACR = 5760x3840
    dcraw = 5796 x 3870
    Rawdigger (option to show masked pixels. Note these are on the LHS and Top of the image) = 5920 x 3950

    And in the Canon 5D3 specs it says sensor size is: '35mm (36.0mm x 24.0mm)'

    I'm wondering which of the processing methods represents the 'Full' Frame? And whether this is 35mm or 36mm wide? And whether the principle point of my photographs is offset from the centre of my processed photographs.

    I'm asking because I sometimes need to create virtual cameras inside of 3D packages - I need to match that of a photographed scene as accurately as possible so I use the sensor size, and lens info from the metadata and plug these into my 3D software. It wasn't until recently that I discovered that images tend to be cropped slightly so I'm thinking that perhaps I'm loosing accuracy straight away so I'm hoping to tighten up my workflow.

    Any ideas?

  2. #2

    Join Date
    May 2014
    Location
    amsterdam, netherlands
    Posts
    3,182
    Real Name
    George

    Re: Cropping of RAW images during processing

    Quote Originally Posted by spittle View Post
    A comparison between RAW processing (CR2) using different software yields these different resolutions:

    ACR = 5760x3840
    dcraw = 5796 x 3870
    Rawdigger (option to show masked pixels. Note these are on the LHS and Top of the image) = 5920 x 3950

    And in the Canon 5D3 specs it says sensor size is: '35mm (36.0mm x 24.0mm)'

    I'm wondering which of the processing methods represents the 'Full' Frame? And whether this is 35mm or 36mm wide? And whether the principle point of my photographs is offset from the centre of my processed photographs.

    I'm asking because I sometimes need to create virtual cameras inside of 3D packages - I need to match that of a photographed scene as accurately as possible so I use the sensor size, and lens info from the metadata and plug these into my 3D software. It wasn't until recently that I discovered that images tend to be cropped slightly so I'm thinking that perhaps I'm loosing accuracy straight away so I'm hoping to tighten up my workflow.

    Any ideas?
    Stay to 1 converter as you should always do. Then there will be no problem.
    The sensor size is a string in memory or program, it's not measured. The analogue films where 35mm width, and the frames where 36x24. When I'm right.

    George

  3. #3
    Moderator Dave Humphries's Avatar
    Join Date
    May 2008
    Location
    Windsor, Berks, UK
    Posts
    16,737
    Real Name
    Dave Humphries :)

    Re: Cropping of RAW images during processing

    Hi David,

    Welcome to CiC.

    I think you're getting far too hung up in numerical measurements rather than just using what the vast majority of people will see - which I'd guess would be the Adobe size, since many more people will use that application compared to the others. Or you might want to check the camera manual to see what Canon say it is and use those figures. (which may be the same as Adobe)

    Particularly; why get bogged down in masked pixels?
    99.99999999999999% of users don't even know they're there, far less will ever see them.

    The physical size of 'full frame' should be 36 x 24mm as George has noted. The '35mm' refers to the width of the roll of film; i.e. the 24mm dimension plus a bit each side for sprocket holes, since the 36mm dimension of frame was along the length of the film.

    Wikipedia article: https://en.wikipedia.org/wiki/35mm_format

    Hope that's helpful, if only for the background info. to remove any confusion, I appreciate that for 3D modelling you do need absolute figures and being a coder myself, although not at your level, I do appreciate your desire to get it right.

    Cheers, Dave
    Last edited by Dave Humphries; 28th June 2015 at 10:50 AM.

  4. #4

    Join Date
    Jun 2015
    Location
    Australia
    Posts
    26
    Real Name
    David

    Re: Cropping of RAW images during processing

    Quote Originally Posted by Dave Humphries View Post
    Hi David,

    Welcome to CiC.

    I think you're getting far too hung up in numerical measurements rather than just using what the vast majority of people will see - which I'd guess would be the Adobe size, since many more people will use that application compared to the others. Or you might want to check the camera manual to see what Canon say it is and use those figures. (which may be the same as Adobe)

    Particularly; why get bogged down in masked pixels?
    99.99999999999999% of users don't even know they're there, far less will ever see them.

    The physical size of 'full frame' should be 36 x 24mm as George has noted. The '35mm' refers to the width of the roll of film; i.e. the 24mm dimension plus a bit each side for sprocket holes, since the 36mm dimension of frame was along the length of the film.

    Wikipedia article: https://en.wikipedia.org/wiki/35mm_format

    Hope that's helpful, if only for the background info. to remove any confusion, I appreciate that for 3D modelling you do need absolute figures and being a coder myself, although not at your level, I do appreciate your desire to get it right.

    Cheers, Dave
    Hi

    I guess it may seem a bit finicky - I find it interesting though and if I can keep things accurate where I have the available information then it helps to diagnose/rule out this from other problems when they arise. It's surprising how small errors can cause a headache when figuring out why I can't get my geometry to line up with the photograph. Then I'm scratching my head wondering, was the camera level, have I calculated the right amount of lens shift, and now, do I have the correct focal length.

    This process happens on most jobs, sometimes it's easy, sometimes not, depending on the data:

    https://www.google.com.au/search?q=c...w=1600&bih=933


    Thanks for the reminder of the sensor size - I had forgot where the 35 had come from.

  5. #5

    Join Date
    May 2014
    Location
    amsterdam, netherlands
    Posts
    3,182
    Real Name
    George

    Re: Cropping of RAW images during processing

    Quote Originally Posted by spittle View Post
    Hi

    I guess it may seem a bit finicky - I find it interesting though and if I can keep things accurate where I have the available information then it helps to diagnose/rule out this from other problems when they arise. It's surprising how small errors can cause a headache when figuring out why I can't get my geometry to line up with the photograph. Then I'm scratching my head wondering, was the camera level, have I calculated the right amount of lens shift, and now, do I have the correct focal length.

    This process happens on most jobs, sometimes it's easy, sometimes not, depending on the data:

    https://www.google.com.au/search?q=c...w=1600&bih=933


    Thanks for the reminder of the sensor size - I had forgot where the 35 had come from.
    Keep in mind a RAW-file is NOT an image. It's a collection of data where a rasterimage is made of which can be saved as a JPG or a TIFF or something else. Where you're working with are rasterimages. And any RAW-converter works different.

    George

  6. #6
    DanK's Avatar
    Join Date
    Dec 2011
    Location
    New England
    Posts
    8,631
    Real Name
    Dan

    Re: Cropping of RAW images during processing

    David,

    I think what you are finding is that software differs in its handling of masked pixels. Canon gives the total number of pixels for the 5D3 as 23.4 MP and the "effective" number as 22.3 MP. The manual (p. 209) gives figures for effective pixels that matche the ACR count, 5760 x 3840.

    Dan

  7. #7

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: Cropping of RAW images during processing

    Quote Originally Posted by spittle View Post
    A comparison between RAW processing (CR2) using different software yields these different resolutions:

    ACR = 5760x3840
    dcraw = 5796 x 3870
    Rawdigger (option to show masked pixels. Note these are on the LHS and Top of the image) = 5920 x 3950

    And in the Canon 5D3 specs it says sensor size is: '35mm (36.0mm x 24.0mm)'

    I'm wondering which of the processing methods represents the 'Full' Frame? And whether this is 35mm or 36mm wide? And whether the principle point of my photographs is offset from the centre of my processed photographs.

    I'm asking because I sometimes need to create virtual cameras inside of 3D packages - I need to match that of a photographed scene as accurately as possible so I use the sensor size, and lens info from the metadata and plug these into my 3D software. It wasn't until recently that I discovered that images tend to be cropped slightly so I'm thinking that perhaps I'm loosing accuracy straight away so I'm hoping to tighten up my workflow.

    Any ideas?
    Just give you some real data about the subject at hand from a Sigma SD14 raw file:

    CMbM:EPSEmuPrevDims Type=2 (long), Dimensions=1 (D0) (2)
    M[0]=2640 (A50)
    M[1]=1760 (6E0)

    CMbM:KeepImageArea Type=1 (long), Dimensions=1 (D0) (4)
    M[0]=0 (0)
    M[1]=0 (0)
    M[2]=2687 (A7F)
    M[3]=1791 (6FF)

    CMbM:ActiveImageArea Type=1 (long), Dimensions=1 (D0) (4)
    M[0]=24 (18)
    M[1]=16 (10)
    M[2]=2663 (A67)
    M[3]=1775 (6EF)

    CMbM: DarkShieldTop Type=1 (long), Dimensions=1 (D0) (4)
    M[0]=24 (18)
    M[1]=4 (4)
    M[2]=2663 (A67)
    M[3]=8 (8)

    CMbM: DarkShieldBottom Type=1 (long), Dimensions=1 (D0) (4)
    M[0]=24 (18)
    M[1]=1783 (6F7)
    M[2]=2663 (A67)
    M[3]=1787 (6FB)

    CMbM: DarkShieldColRange Type=2 (long), Dimensions=2 (D0, D1) (2x2)
    M[0,0]=8 (8)
    M[0,1]=9 (9)
    M[1,0]=2673 (A71)
    M[1,1]=2674 (A72)

    These are from actual raw file meta-data for a Sigma SD14 DSLR; I'll leave you to puzzle out what is what but the proprietary converter saves hi-res (not binned) images as 2640x1760px (EPSEmuPrevDims tag above).

    The sensor data sheet gives:

    Size 20.67x13-79mm
    Total pixels 2688x1792
    Effective 2652x1768

    Different converters can pick different meta-data tags from the raw file, some show the dark mask, some show parts of it, some don't show any of it. So, it is a question of knowing your sensor and choosing what you want to use.

    "Will the real Canon review image please stand up?"
    Last edited by xpatUSA; 28th June 2015 at 10:18 PM.

  8. #8
    dje's Avatar
    Join Date
    May 2011
    Location
    Brisbane Australia
    Posts
    4,636
    Real Name
    Dave Ellis

    Re: Cropping of RAW images during processing

    Hi David

    The sensor size of 36x24 mm will be a nominal size. I think you will be struggling to find the exact size and location of the rectangle of used pixels within the sensor chip. The quoted pixel dimensions would correspond to the size of the jpeg produced by the camera. ACR and the raw software from the camera manufacturers would produce the same sized image from the raw file I would think.

    The masked pixels are often used for determining black level in the in-camera or external raw converter I believe.

    Dave

  9. #9

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: Cropping of RAW images during processing

    I just posted exact data for my SD14's sensor. Then I read:

    I think you will be struggling to find the exact size and location of the rectangle of used pixels within the sensor chip.
    Is the 5D Mk III sensor data not available anywhere on the web?
    Last edited by xpatUSA; 28th June 2015 at 10:47 PM.

  10. #10

    Join Date
    Nov 2009
    Location
    Provence, France
    Posts
    988
    Real Name
    Remco

    Re: Cropping of RAW images during processing

    Quote Originally Posted by spittle View Post
    Hi

    I guess it may seem a bit finicky - I find it interesting though and if I can keep things accurate where I have the available information then it helps to diagnose/rule out this from other problems when they arise. It's surprising how small errors can cause a headache when figuring out why I can't get my geometry to line up with the photograph. Then I'm scratching my head wondering, was the camera level, have I calculated the right amount of lens shift, and now, do I have the correct focal length.

    This process happens on most jobs, sometimes it's easy, sometimes not, depending on the data:

    Thanks for the reminder of the sensor size - I had forgot where the 35 had come from.
    Wouldn't lens distortions cause you a lot more trouble than a few pixels more or less ?

    Simplified, an error in "sensor size" or focal length would mean you'd have to scale your simulated image wrt the photograph, differences in aspect ratio's would give rise to bands where you have no image (either photo or simulated).
    Distortions otoh would be a lot more difficult to correct.

    If I had to check for something like that, I'd use a program like Hugin to align the simulated image with the photographed image, and see where and how the images don't align perfectly. Hugin is a program suite to generate pano's from several images, but it works in clearly defined stages. one of which is alignment. The alignment allows you to select the parameters to use, and you can inspect the values of these parameters after an optimal alignment is found.

  11. #11
    DanK's Avatar
    Join Date
    Dec 2011
    Location
    New England
    Posts
    8,631
    Real Name
    Dan

    Re: Cropping of RAW images during processing

    Is the 5D Mk III sensor data not available anywhere on the web?
    It's in the manual, but I had a typo in my earlier post: it's page 206. The count is 5760 x 3840. It also lists 22.1 effective MP, not the 22.3 I posted earlier. Bob Atkins, who is a good source for technical things Canon, posted the same number: http://www.bobatkins.com/photography...l_matters.html.

  12. #12

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: Cropping of RAW images during processing

    Quote Originally Posted by DanK View Post
    Is the 5D Mk III sensor data not available anywhere on the web?
    It's in the manual, but I had a typo in my earlier post: it's page 206. The count is 5760 x 3840. It also lists 22.1 effective MP, not the 22.3 I posted earlier. Bob Atkins, who is a good source for technical things Canon, posted the same number: http://www.bobatkins.com/photography...l_matters.html.
    Yes, Atkins knows his stuff - his article on lens MTF is particularly good. Still, the OP seems to be seeking more than just the nominal size or "the count" given by the standard converter. So, by "data" in my question, I did mean more than just the nominal size, more similar in fact to what I posted for the Sigma earlier.

    In the world of Sigma, various converters produce different size images - which may cause furrowed brows in the world of CaNikon. For example, here is a selection for the SD14:

    Sigma Photo Pro: 2640x1760
    FastStone Viewer: 2639x1757
    RawTherapee: 2688x1792
    RawDigger RGB export: 2651x1761

    It is those kind of discrepancies that seem to be bothering the OP, in my opinion.

  13. #13

    Join Date
    Jun 2015
    Location
    Australia
    Posts
    26
    Real Name
    David

    Re: Cropping of RAW images during processing

    Hi guys

    A slight misalignment from where the sensor is fixed to the camera wouldn't be worth worry about. It just seemed that potentially the image could be cropped as much as 160 pixels (if say 17mm was including the masked pixels as the 'whole' sensor) which would be worth accounting for in the software I'm using. And if I was to remove distortion from images, it would be useful to know whether the principle point is offset.

    Revi that's a good point - you're right that image distortions play a big problem but again it all adds up to the final solution.

    Interesting use of using Hugin to align two images (CG and photo) to calculate distortions/principle point, I use PTGui but I've not thought of using it like that before.

  14. #14

    Re: Cropping of RAW images during processing

    Quote Originally Posted by george013 View Post
    Keep in mind a RAW-file is NOT an image.
    I wonder how "not an image" is converted to an image by simple arithmetics.

  15. #15

    Re: Cropping of RAW images during processing

    Dear David,

    Thank you for using our RawDigger.

    > different resolutions

    Those are dimensions in pixels, or pixel counts, not resolution.
    If you look into makernotes in the camera raw files, you will see what Canon themselves have to say:
    Sensor Width: 5920
    Sensor Height: 3950
    Sensor Left Border: 140
    Sensor Top Border: 96
    Sensor Right Border: 5899
    Sensor Bottom Border: 3935
    Image Width: 5760
    Image Height: 3840

    > I use the sensor size

    I would be using pixel pitch to calculate the geometry of the image knowing the dimensions in pixels.
    You can calculate pixel pitch from EXIF data as supplied by Canon themselves:
    Focal Plane X Resolution: 3942.505133
    Focal Plane Y Resolution: 3950.617284
    Focal Plane Resolution Unit: inches

    > whether the principle point of my photographs is offset from the centre of my processed photographs

    The sensor active area is centered, masked pixels do not through the centering off, but minor misalignments might be present; mostly between the viewfinder and sensor. Sensor misalignments were no more than 3 pixels on all the cameras I worked with. A converter may add to some displacement if it does not take equal numbers of pixels counting from the centre. But it should be rather small, less than 8 - you can check with overlaying over export from RawDigger.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •