Author Topic: .CR2 RAW files show 2 or 3 rows that are not from sensor data  (Read 6789 times)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Hi,

when I load .CR2 RAW images (from Canon EOS40D) into PI, they always show 2 or 3 lines of data at the bottom that is not from sensor data. This is especially visible in dark images, and independent of the RAW debayer mode (all 4 shown in screenshot). I don't know if this is a dcraw or a PI problem. But those rows dont exist when I load into IrfanView (also uses dcraw http://www.cybercom.net/~dcoffin/dcraw/) or DigitalPhotoProfessional (Canon proprietary).

Georg

PS: Resolution accordining to PI: 3908x2602, according to DPP: 3888x2592, which is also what you can read in other sources, e.g. http://en.wikipedia.org/wiki/Canon_EOS_40D.
« Last Edit: 2010 October 11 13:55:14 by georg.viehoever »
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline pauljv

  • Newcomer
  • Posts: 15
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #1 on: 2010 October 11 12:43:53 »
Try capturing your significant data closer to the centre of the frame, it won't be so noticeable then.

Regards Paul

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #2 on: 2010 October 11 13:48:29 »
Hi Paul,

Try capturing your significant data closer to the centre of the frame, it won't be so noticeable then.
...

the only noticed it because I am currently "debugging" my calibration results. Obviously, such rows distort the statistics of bias/dark/flat/light. And heaven knows what ImageCalibration is doing with this.

A workaround is not difficult, just crop the image. But it is an additional step in the calibration flow consuming time and disk space, so I would prefer if PI did read .CR2 correctly.

Georg

Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #3 on: 2010 October 11 19:51:19 »
Georg,
Iris and MaximDL doing same 3908x2602. But only PixInsight can handle Overscan area during calibration.
Unfortunately, I never seen anything definitive about Canon CMOS sensors.

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #4 on: 2010 October 12 09:45:48 »
Hi Nikolay,

...
Iris and MaximDL doing same 3908x2602. But only PixInsight can handle Overscan area during calibration.
...

Overscan areas are rows/columns of a sensor that are kept dark. So they should show values similar to those of pixels in dark images. But they dont. They are clearly visible as bright lines in my dark frames too. So something else is going wrong here?

If you have MaximDL: Could you compare what you see in the lower couple of rows in PI and MaximDL after loading a CR2 file?

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #5 on: 2010 October 12 20:35:13 »
Could you compare what you see in the lower couple of rows in PI and MaximDL after loading a CR2 file?
I see bright pixels in PixInsight/MaximDL/Iris and Google Picasa.

What you think about Lleft/Top/Right additional row of pixels? It's usable or also only good for garbage collector?
I ask because AIP4WIN read 3944x2622 pixels !!! Look attachment. It's corners (thank's aberration-spotter.js) from Canon40D.cr2 decoded in AIP4Win.

Geord, did you see overscan area now?

I will happy if PI will decode 3944x2622. 3908x2602 not enough for me.

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #6 on: 2010 October 13 10:12:34 »
Hi NKV,

I can see those bright lines in your screenshot both above and below the actual data. In the meantime, I have also been able to produce them Inrfan 4.23, see screenshot below. In Irfan, you have to deselect "Options/Properties+Settings/PlugIns/Load Half Size Image", which by default is on.... Given that Irfan, MaximDL and PI all see those bright lines, it appears that this is not a PI issue, more likely something in dcraw. Lucky Juan... :)

What I definitely dont see in PI or Irfan are those dark areas at the borders of you screenshot. If this is real sensor data, only without light, then these would be overscan areas that would be interesting for image calibration. Does anyone have information on that? NKV: Does it look like real sensor data to you (i.e. with noise, with a few hot pixels, with the same "color" as the main sensor area in dark frames)?

Georg
« Last Edit: 2010 October 13 10:17:46 by georg.viehoever »
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #7 on: 2010 October 13 20:21:32 »
Does it look like real sensor data to you (i.e. with noise, with a few hot pixels, with the same "color" as the main sensor area in dark frames)?
Yes, it's look like real sensor data. More information about .CR2 at Understanding What is stored in a Canon RAW .CR2 file, How and Why

According ExifTool:
Code: [Select]
ExifTool Version Number         : 8.34
File Name                       : _MG_9674.CR2
Camera Model Name               : Canon EOS 40D

Sensor Width                    : 3944
Sensor Height                   : 2622

Sensor Left Border              : 40
Sensor Top Border               : 23
Sensor Right Border             : 3927
Sensor Bottom Border            : 2614

Image Size                      : 3888x2592

And look at AIP4Win PrintsScreen:

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #8 on: 2010 October 16 02:31:06 »
Does it look like real sensor data to you (i.e. with noise, with a few hot pixels, with the same "color" as the main sensor area in dark frames)?
Yes, it's look like real sensor data. More information about .CR2 at Understanding What is stored in a Canon RAW .CR2 file, ...

Wow, this document provides a wealth of information. Apparently, for most Canons the sensor is a bit larger than the effective image. It would be useful to have a detailed look at these sensor areas and see if they can be used as an overscan area. But unfortunately, I seem to be unable to read them with PI.61.

So in effect this bug report now has an two points:
1. Get rid of the 2 lines that are not image data
2. Optionally, allow to read in the whole sensor area (which your screenshots suggest is possible with AIP4WIN).

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #9 on: 2010 October 16 10:47:56 »
1. Get rid of the 2 lines that are not image data
2. Optionally, allow to read in the whole sensor area (which your screenshots suggest is possible with AIP4WIN).
As fast solution for read 3944x2622 pixels:
Look in dcraw.c http://www.cybercom.net/~dcoffin/dcraw/
Code: [Select]
 } else if (is_canon && raw_width == 3944) {
    height = 2602;
    width  = 3908;
    top_margin  = 18;
    left_margin = 30;
Replace:
Code: [Select]
 } else if (is_canon && raw_width == 3944) {
    height = 2622;
    width  = 3944;
    top_margin  = 0;
    left_margin = 0;

 8)
« Last Edit: 2010 October 16 11:12:31 by NKV »

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: .CR2 RAW files show 2 or 3 rows that are not from sensor data
« Reply #10 on: 2010 October 26 07:44:28 »
One more way to access to overscan area:
Download from http://www.libraw.org/download
& use unprocessed_raw executable (which in /bin directory of sources)
See Usage Examples
Code: [Select]
E:\2\unprocessed_raw.exe -N E:\2\_MG_7675.CR2
Processing file E:\2\_MG_7675.CR2
Image size: 3908x2602
Raw size: 3944x2622
Margins: top=18, left=30, right=6, bottom=2
Unpacked....
Writing file E:\2\_MG_7675.CR2.tiff
« Last Edit: 2010 October 26 20:37:50 by NKV »