Closed brotherofken closed 5 years ago
Thanks! I will look into this!
Actually, if input file has DNG format, then the following should be enough:
Obtain libexiv2:
apt install libexiv2-dev
Somewhere in CMakeLists.txt add:
find_package(Exiv2 REQUIRED)
Then read image dimensions as follows:
const Exiv2::Image exiv_image = Exiv2::ImageFactory::open(path);
exiv_image->readMetadata();
const Exiv2::ExifData exiv_data = image->exifData();
// Now read dimensions of Exif.Image
// Also there are chance that you have to choose another IFD, like "Exif.SubImage1.ImageWidth".
// That may happen if DNG contains a JPEG thumbnail
const int width = exiv_data["Exif.Image.ImageWidth"].toLong();
const int height = exiv_data["Exif.Image.ImageHeight"].toLong();
// Also you have to read and use and consider during processing:
// * WhiteLevel and BlackLevel
// * CFAPattern
// * AsShotNeutral, ColorIlluminant1/ColorIlluminant2
// * Exif.Image.Orientation
// * and many more
Thus topic of this issue is wider than just reading of image dimensions.
Thank you!
I am creating a prototype! Thanks for the info, very useful!
Hi! Any progress on this? Can I help you somehow?
Also, if you are looking for more bursts, I would recommend to use HDR+ dataset: https://hdrplusdata.org/
Images there have different bayer patterns, so you have to support them in demosaicing. White balance differs too.
Sorry I have been really busy lately; I am sorry I have not provided updates as I have not had time to work on it. I might possibly be able to work on it later this week!
I have been trying to implement it; no success though. Sorry for the lack of response. Any help would be appreciated!
Could you please publish a branch with your current progress? Any progress and even if the code not clean. Unfortunately I'm very limited in time :-( but hopefully will find time to look at the code on weekend.
It fails to build currently; but I will post it later today!
Sorry for not posting the code I think I know what is wrong with it!!
Ok I uploaded the code at: https://github.com/Titaniumtown/hdr-plus
Ok I uploaded the code at: https://github.com/Titaniumtown/hdr-plus
Thank you for fast merge, @Titaniumtown !
Also, there are imperfection in my implementation. I do not crop 'masked pixels' from RAW, and now they appear in the output. :-(
The problem is located here: https://github.com/timothybrooks/hdr-plus/blob/master/src/InputSource.cpp#L34
I'll fix that and make another PR shortly.
Bump! Are you going to make a pull request?
Oh, sorry for that. :-(
I'll try to look at this on a weekend.
The thing is to copy pixels according to ActiveArea
Raw tag.
Hi!
Regarding the following question in readme.md
I found several alternatives, that may help:
+
supports writing DNG+
supports reading DNG OpCodes (e.g. GainMap for lens shading correction, WarpRectilinear for lens aberration correction, etc)-
DNG only, but there are a lot of RAW2DNG converters-
Has no official support for linux, but there are CMakeLists builds available on githubI have some experience with DNG SDK and can say that it does work well.
Also, there are
LibExiv2
which allows to read metadata from DNG image format (which essentialy is TIFF), such as:finish.cpp
. You could add libexiv2 in CMakeLists using the following command:But anyway, if you want to do lens shading correction, then you have to read GainMap from DNG or other raw format somehow
P.S. please feel free to edit header or issue text.