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

rawspeed: SONY ILCE-7C support #250

Merged
merged 1 commit into from Nov 22, 2020
Merged

rawspeed: SONY ILCE-7C support #250

merged 1 commit into from Nov 22, 2020

Conversation

frantic1048
Copy link
Contributor

@frantic1048 frantic1048 commented Nov 7, 2020

Part [2/2] of darktable-org/darktable#6669

Camera info was extracted with dngmeta.sh and Adobe DNG Converter 13.0 (Macintosh)


Update at Sun, 08 Nov 2020 02:35:01 +0800:

output from dngmeta.sh
/mnt/waifuh1t/repo/darktable/tools> ./dngmeta.sh  /tmp/raws/_DSC0021.dng
DNG created by : Adobe DNG Converter 13.0 (Macintosh)
DNG Illuminant : 21 (should be 21)

$ nano -w src/external/adobe_coeff.c

{ "Sony ILCE-7C", { 7374,-2389,-551,-5435,13162,2519,-1006,1795,6552 } },

$ git commit -a -m "adobe_coeff: SONY ILCE-7C support" --author " chino@amausaan"

$ nano -w src/external/rawspeed/data/cameras.xml (mind the tabs)

<Camera make="SONY" model="ILCE-7C">
	<ID make="Sony" model="ILCE-7C">Sony ILCE-7C</ID>
	<CFA width="2" height="2">
		<Color x="0" y="0">RED</Color>
		<Color x="1" y="0">GREEN</Color>
		<Color x="0" y="1">GREEN</Color>
		<Color x="1" y="1">BLUE</Color>
	</CFA>
	<Crop x="0" y="0" width="0" height="0"/>
	<Sensor black="512" white="16383"/>
</Camera>

NOTE: The default crop exposes the full sensor including garbage pixels, which need to be visually inspected. (negative width/height values are right/bottom crops, which are preferred)

NOTE: Sensor black and white levels sometimes vary based on ISO, please run this tool on raws for each of the camera's supported ISOs

$ git commit -a -m "rawspeed: SONY ILCE-7C support" --author " chino@amausaan"

Part [2/2] of darktable-org/darktable#6669

Camera info was extracted with dngmeta.sh and Adobe DNG Converter 13.0 (Macintosh)
@LebedevRI LebedevRI self-assigned this Nov 7, 2020
@codecov
Copy link

codecov bot commented Nov 7, 2020

Codecov Report

Merging #250 (084255a) into develop (1c58d20) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #250   +/-   ##
========================================
  Coverage    60.71%   60.71%           
========================================
  Files          234      234           
  Lines        12594    12594           
========================================
  Hits          7646     7646           
  Misses        4948     4948           
Flag Coverage Δ
integration 47.91% <ø> (ø)
rpu_u 47.91% <ø> (ø)
unittests 23.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c58d20...084255a. Read the comment docs.

@LebedevRI LebedevRI added this to Untriaged in New Camera Support via automation Nov 22, 2020
@LebedevRI LebedevRI moved this from Untriaged to Todo in New Camera Support Nov 22, 2020
@LebedevRI LebedevRI merged commit 39682a8 into darktable-org:develop Nov 22, 2020
New Camera Support automation moved this from Todo to Resolved Nov 22, 2020
@trougnouf
Copy link

The cam_xyz info seems to differ from libraw's (whereas it is consistent on another camera). I don't know how either is generated. This results in a different "camera reference" white balance on darktable.

libraw's cam_xyz = [[ 0.5271, -0.0712, -0.0347], [-0.6153, 1.3653, 0.2763],[-0.1601, 0.2366, 0.7242]] (obtained with rawpy 0.17, libraw 0.20.2)

darktable's adobe_xyz_to_cam (from rawspeed) = [[0.737399995, -0.238900006, -0.0551000014], [-0.543500006, 1.31620002, 0.251899987], [-0.100599997, 0.179499999, 0.655200005]]

@kmilos
Copy link
Contributor

kmilos commented Mar 25, 2022

The basic matrix comes form the ColorMatrix2 of the DNG produced by the Adobe converter, and is the same for both libraries.

https://github.com/LibRaw/LibRaw/blob/master/src/tables/colordata.cpp
https://github.com/darktable-org/rawspeed/blob/develop/data/cameras.xml

libraw could be additionally multiplying this by the equivalent of the DNG CameraCalibration2 matrix and/or the AnalogBalance matrix (no idea how it gets these from the ARW) which can also differ per camera unit and per shot (this is outlined in the DNG spec as XYZtoCamera = AB * CC * CM), while rawspeed does not (i.e. I guess it assumes AB and CC are identity).

@lclevy
Copy link

lclevy commented Mar 25, 2022

@kmilos
Copy link
Contributor

kmilos commented Mar 25, 2022

Et voilà ! Again, no idea if ab and cc are really not identity in this case and where to get them in Sony MakerNotes...

@kmilos
Copy link
Contributor

kmilos commented Mar 25, 2022

Hang on, being too smart here - this matrix returned by libraw looks suspiciously like the ILCE-7 one, so this could be just a loose matching bug/fall-though? ILCE-7C matrix was added after 0.20.2 it seems (202101 snapshot)...

@trougnouf
Copy link

Hang on, being too smart here - this matrix returned by libraw looks suspiciously like the ILCE-7 one, so this could be just a matching bug/fall-though? ILCE-7C matrix was added after 0.20.2 it seems (202101 snapshot)...

Indeed you are right! I get the same value as rawspeed / exiv2 after upgrading libraw to 0.20.2.r81.gadcb898a (current git master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Resolved
New Camera Support
  
Resolved
Development

Successfully merging this pull request may close these issues.

None yet

5 participants