Hi Alex,
Now I am looking for a way to get the process data where you have subtracted the black level, w/ white balance and demosaic, can you please help to explain the procedure? Thanks!
So, to my knowledge, bayer image would be greyscale (but with 10/12/or 14 bit depending on your camera raw image). Is it correct?
If yes, them if I map those Bayer values into (int)(0 -255), would it be similar to the greyscale.jpg (8 bit) file?
Thanks
Hi Alex,
I use the prebuilt library for win 64 and successfully embedded into visual studio. I would like to share my method as following:
1. Extract the binaries for x64.
2. Go into visual project. Open Project Properties, In Configuration Properties:
a. /Debugging/Enviornment: add the path to LibRaw-xxx\bin
b. /C/C++/General/Additional Include Directories: add the path to LibRaw-xxx\
c. /Linker/General/Additional Library Directories: add the path to LibRaw-xxx\lib
/Linker/Input/Additional Dependencies: add libraw.lib and libraw_static.lib
My testing code is following:
int main() {
// Let us create an image processor
LibRaw iProcessor;
// Open the file and read the metadata
iProcessor.open_file("D:/[01]Luan_van_thac_si/PROJECT/Non_Cuda/SLIC/SLICSuperPixel/DSC01042.ARW");
// The metadata are accessible through data fields of the class
cout << "Image width = " << static_cast(iProcessor.imgdata.sizes.width)
<< ", Image height = " << static_cast(iProcessor.imgdata.sizes.height) << endl;
waitKey();
return 0;
}
Results: Image width = 6024, Image height = 4024
I hope this answer will help other users and thanks for wonderful library!
I think its because of the exiftool. The original IIQ image metadata seems different. Do you know an easy way to tell if its in the exif or xmp ? I will ask my coworker to see if we can create a IIQ with gps and no sensitive info but it may take several days.
Thank you for your reply. I don't have any images with GPS from our company that may not be sensitive to post on a forum but I found one having no gps information. I used the exiftool to copy exif metadata from one image (having gps) to this one. Hope that helps.
Assuming, you're using LibRaw's dcraw_emu sample, not some other app that uses LibRaw:
LibRaw's own TIFF writer routine is very simple, it is used to not depend on additional libraries (e.g. libtiff). So only minimal EXIF data is recorded into output.
LibRaw is opensource, we're open to user contribution. So feel free to implement own TIFF writer (w/ extensive EXIF recording) we will be happy to add it to LibRaw (if you wish so).
I did not understand the question. What values you want to access:
- unaltered raw data (as decoded from RAW file)
- linearized data (black level subtracted)
- processed data (w/ white balance, demosaic, data scaling applied)
we created a new build that exposes the TIFF option as a C API. Not sure when it will be part of the official release but should be part of the Nightlies.
scroll to line 1475 for the imports definitions and 1690 for the actual usage of the methods . You may have to change the calls for C# but i trust it should work just the same.
Note the new build was really to expose the -tiff option which is now avail via this statement:
Did anyone figure out how to do this? I'm another one interested in using libraw, here again in C#, but I cannot figure out how to pass parameters. Would appreciate any help I can get, even if implemented in VB or another language.
Hi Alex,
Now I am looking for a way to get the process data where you have subtracted the black level, w/ white balance and demosaic, can you please help to explain the procedure? Thanks!
So, to my knowledge, bayer image would be greyscale (but with 10/12/or 14 bit depending on your camera raw image). Is it correct?
If yes, them if I map those Bayer values into (int)(0 -255), would it be similar to the greyscale.jpg (8 bit) file?
Thanks
Hi Alex,
I use the prebuilt library for win 64 and successfully embedded into visual studio. I would like to share my method as following:
1. Extract the binaries for x64.
2. Go into visual project. Open Project Properties, In Configuration Properties:
a. /Debugging/Enviornment: add the path to LibRaw-xxx\bin
b. /C/C++/General/Additional Include Directories: add the path to LibRaw-xxx\
c. /Linker/General/Additional Library Directories: add the path to LibRaw-xxx\lib
/Linker/Input/Additional Dependencies: add libraw.lib and libraw_static.lib
My testing code is following:
#include "libraw/libraw.h"
#include "opencv2/highgui/highgui.hpp"
#include "iostream"
#include "stdio.h"
using namespace std;
using namespace cv;
int main() {
// Let us create an image processor
LibRaw iProcessor;
// Open the file and read the metadata
iProcessor.open_file("D:/[01]Luan_van_thac_si/PROJECT/Non_Cuda/SLIC/SLICSuperPixel/DSC01042.ARW");
// The metadata are accessible through data fields of the class
cout << "Image width = " << static_cast(iProcessor.imgdata.sizes.width)
<< ", Image height = " << static_cast(iProcessor.imgdata.sizes.height) << endl;
waitKey();
return 0;
}
Results: Image width = 6024, Image height = 4024
I hope this answer will help other users and thanks for wonderful library!
You may send link (to dropbox/mediafire/wetransfer) to info@libraw.org to avoid public file exposure.
I think its because of the exiftool. The original IIQ image metadata seems different. Do you know an easy way to tell if its in the exif or xmp ? I will ask my coworker to see if we can create a IIQ with gps and no sensitive info but it may take several days.
Thank you for the file. In this file
- GPS coordinates are recorded in XMP block, not in GPSDirectory EXIF block
- GPSDirectory does not contains coordinates, only references:
| + [GPS directory with 3 entries]
| | 0) GPSVersionID = 2 3 0 0
| | - Tag 0x0000 (4 bytes, int8u[4]):
| | 6218624: 02 03 00 00 [....]
| | 1) GPSLatitudeRef = S
| | - Tag 0x0001 (2 bytes, string[2]):
| | 6218630: 53 00 [S.]
| | 2) GPSLongitudeRef = E
| | - Tag 0x0003 (2 bytes, string[2]):
| | 621863c: 45 00 [E.]
LibRaw does not parse XMP blocks (and no plans for that), so it is unable to extract GPS data from such file.
Thank you for your reply. I don't have any images with GPS from our company that may not be sensitive to post on a forum but I found one having no gps information. I used the exiftool to copy exif metadata from one image (having gps) to this one. Hope that helps.
http://www.mediafire.com/view/i9we9h6jkt9kfum/C0079_3508_238162.IIQ
Followup: we do not have any IIQ files w/ embedded GPS data. Could you please share some samples with us?
Assuming, you're using LibRaw's dcraw_emu sample, not some other app that uses LibRaw:
LibRaw's own TIFF writer routine is very simple, it is used to not depend on additional libraries (e.g. libtiff). So only minimal EXIF data is recorded into output.
LibRaw is opensource, we're open to user contribution. So feel free to implement own TIFF writer (w/ extensive EXIF recording) we will be happy to add it to LibRaw (if you wish so).
LibRaw 0.19 Win32 binary distribution (downloadable from this site /download page) is built using
nmake -f Makefile.msvc
I do not know what is wrong on your system.
Thanks Alex
Use imgdata.rawdata.* pointers to access data after unpack()
Hi Alex,
Thank you for the quick support.
For now, I think unaltered raw data would be enough for my purpose.
I did not understand the question. What values you want to access:
- unaltered raw data (as decoded from RAW file)
- linearized data (black level subtracted)
- processed data (w/ white balance, demosaic, data scaling applied)
?
yes, raw colorspace is 'as is'
I will look into the code and follow up if I have any questions. Also, what does the RAW colorspace mean? Does it mean the Camera's RGB space?
Dinesh
Use latest public beta.
when will it be compatible with the canon eos T7i camera? :((((((
Yes, it is still valid.
I am trying to activate rawspeed support in libraw, I am following the instruction here:
https://github.com/LibRaw/LibRaw/blob/master/README.RawSpeed.txt
this doc is not updated since 2018, is it still valid?
I check the raw speed:
https://github.com/darktable-org/rawspeed.git
master branch is not updated since 2014.
XYZ output is performed by applying color conversion matrix in convert_to_rgb() function
With default dcraw_emu settings output is scaled to saturate 1% of pixels, so result may differ for dcraw_emu -o 5 (than converted to sRGB)
Hi Robert,
Much appreciated. Where would I find the Nightlies, though? I looked here and on Github and didn't see anything that recent.
Thanks, Lothar
Hi,
we created a new build that exposes the TIFF option as a C API. Not sure when it will be part of the official release but should be part of the Nightlies.
You can see how i have used it in my VB.NET program: avail here: https://github.com/totoantibes/LumixCameraAscomDriver/blob/master/LumixC...
scroll to line 1475 for the imports definitions and 1690 for the actual usage of the methods . You may have to change the calls for C# but i trust it should work just the same.
Note the new build was really to expose the -tiff option which is now avail via this statement:
Hope this helps
Robert
Did anyone figure out how to do this? I'm another one interested in using libraw, here again in C#, but I cannot figure out how to pass parameters. Would appreciate any help I can get, even if implemented in VB or another language.
Nikon D3500 is supported by current snapshot and listed in supported camera list for it: https://www.libraw.org/supported-cameras-snapshot-201910
This camera is also supported by (coming) LibRaw 0.20
Pages