LibRaw | reading RAW files from digital cameras | Camera library
kandi X-RAY | LibRaw Summary
kandi X-RAY | LibRaw Summary
LibRaw is a library for reading RAW files from digital cameras
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of LibRaw
LibRaw Key Features
LibRaw Examples and Code Snippets
Community Discussions
Trending Discussions on LibRaw
QUESTION
I want to perform the color calibration of my camera. That's why I search demosaic algorithm, which can provide the closest color to color of a real object. That's why I want:
- create synthetic images in OpenCV with known colors
- mosaic it
- pass it in an algorithm for estimation of efficiency
I use libraw for unpacking raw images and OpenCV for processing and storing them.
So, the question is, is there a library that can provide me different demosaic algorithms(i am ready to convert my synthetic image from Mat to C-style array) where I can pass my mosaic image and receive demosaic image. I think that it is possible to convert my image from tiff to dng and use RawTherapee for demosaicing, but it looks more complicated.
...ANSWER
Answered 2021-May-23 at 13:32I solved that problem by using dng sdk.
Pipeline for using class from link in the end of answer is here:
QUESTION
I am working at an app where I need to take many pictures (possibly tens of thousands) and they have to be RAW, which I process in native code. Right now I am converting the RAWs to DNGs, and in the native code I unpack them using libraw. I get the white balance color multipliers, and the color matrix from the dng.
However, converting the raw to dng and then processing the dng takes quite a bit of time, and I would like to skip this step, and process the raw info directly, without the DNG intermediary. But for that I need to get the color matrix and WB values. I did look at the docs, but I didn't find any way on how to do that. Any help would be appreciated.
...ANSWER
Answered 2020-Apr-30 at 20:04That information is available in the CameraCharacteristics and CaptureResult objects that you pass to DngCreator, specifically fields like:
https://developer.android.com/reference/kotlin/android/hardware/camera2/CameraCharacteristics#sensor_calibration_transform1 https://developer.android.com/reference/kotlin/android/hardware/camera2/CameraCharacteristics#sensor_color_transform1 https://developer.android.com/reference/kotlin/android/hardware/camera2/CameraCharacteristics#sensor_forward_matrix1 https://developer.android.com/reference/kotlin/android/hardware/camera2/CameraCharacteristics#sensor_reference_illuminant1 https://developer.android.com/reference/android/hardware/camera2/CaptureResult#SENSOR_NEUTRAL_COLOR_POINT
Most of those fields map basically directly to the DNG spec, but you can try to look at the DngCreator implementation to see how to go from the camera2 API to the DNG fields: https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/jni/android_hardware_camera2_DngCreator.cpp;l=1217
While there's no official sample for using this information to process a raw buffer, the Android compliance tests include a simple RAW converter in Java, used to confirm that the resulting image reasonably matches the JPEG image provided by the device (to double-check that the various metadata fields are reasonably correct): https://cs.android.com/android/platform/superproject/+/master:cts/tests/camera/src/android/hardware/camera2/cts/rs/RawConverter.java;l=279
QUESTION
Unfortunately, unless I am mistaken, it seems that there is a bug in the StorageFile
Query api which makes it unreliable.
The following example is simple. The steps to reproduce it are:
-Take a folder and put in only one image, because the sample below assumes you will have only one file.
-This image should be in PEF format, taken from a Pentax 645Z. You can find the entire project as well as a PEF image here. https://github.com/Ponant/StorageFileQueryResultBug . Put the sample image in one folder, in an indexed location, e.g the Desktop.
-Install the Raw Image Extension
from the Microsoft Store, https://www.microsoft.com/en-us/p/raw-image-extension/9nctdw2w1bh8?activetab=pivot:overviewtab . This extension is based on https://www.libraw.org/
and they support this camera https://www.libraw.org/supported-cameras
Run the app, you will see two buttons:
1) Button 1 launches a folder picker, creates a StorageFileQueryResult
which allows one to fetch the only file in the folder. Then it calls the Api for the Image properties
ANSWER
Answered 2020-Jan-29 at 01:45I took the time install the extension and try out your code. Everything you said is correct. The StorageFile when acquired from a StorageFileQueryResult results in default (wrong) image properties for the PEF file, but works fine with jpg files. This is clearly a bug. Whether the bug is in the framework or in the RAW image extension I do not know. Note that the extension has a lot of negative feedback on the Windows Store.
There is a reasonable workaround. You don't have to do one file at a time. Instead of using the query you can do this:
QUESTION
So, what i'm actually trying to is to build a shared object, that contains a python-includable-module, generated by pybind11. I got it as far as to have no syntax-errors in CLion, but when i try to compile it, it gives the following error:
...ANSWER
Answered 2019-Nov-22 at 12:55When compiling a shared library on Linux and Macos (and probably other Unixy OSes) all code used in the library needs to be compiled in "position independent mode", this is because the compiler doesn't know where and executable will load your code so has to generate code which can be run from any address.
To generate PIC code you need to pass the -fPIC
flag to GCC.
Note that all the code you want to compile into your shared library needs to be compiled in PIC mode, this includes code in static libraries. In your case you need to recompile libraw.a
with -fPIC
enabled.
Position independent code might be slightly slower but the difference is small so you can probably just compile all your code with -fPIC
even if its being used directly in an executable. Apple recommends that all code including executables is position independent. See How much overhead can the -fPIC flag add? for more details about performance.
QUESTION
I have a vector with file names. Several of the files in the vector are repeated with different versions. For example
"ConsoleKit2-1.0.0-x86_64-3"
"ConsoleKit2-1.0.0-x86_64-4"
"Cython-0.23.4-x86_64-1"
"Cython-0.29.12-x86_64-1"
"GConf-3.2.6-x86_64-3"
"GConf-3.2.6-x86_64-4"
"LibRaw-0.17.2-x86_64-1"
"LibRaw-0.18.12-x86_64-1"
"M2Crypto-0.23.0-x86_64-1"
"M2Crypto-0.35.2-x86_64-1"
"MPlayer-1.2_20160125-x86_64-3"
"MPlayer-20190418-x86_64-1"
"Mako-1.0.13-x86_64-1"
"ModemManager-1.10.4-x86_64-1"
"ModemManager-1.4.14-x86_64-1"
"NetworkManager-1.18.1-x86_64-1"
"NetworkManager-1.2.2-x86_64-2"
"PyQt-4.11.4-x86_64-1"
"PyQt-4.12.1-x86_64-3"
"QScintilla-2.10.8-x86_64-2"
...ANSWER
Answered 2019-Sep-03 at 02:03Your code doesn't fail in the same way for me. If I run:
QUESTION
I want to read RAW files on Python, and it seems that the Rawpy package is well suited for this. However when trying to install it using the Windows CMD
...ANSWER
Answered 2018-Oct-24 at 22:40The version available at the time of the post (0.12.0) didn't offer Python 3.7 wheels, therefore pip downloaded the source distribution and tried to compile the package manually. This failed since it requires a more involved development setup.
A new rawpy version 0.13.0 is released now and offers wheels for Python 3.7 as well. A simple pip install rawpy
should then work and download the wheel instead of the source distribution.
QUESTION
Consider the following loop:
...ANSWER
Answered 2018-Nov-09 at 16:22my guess would be that this is due to the Python code being evicted from various caches in the CPU/memory system
the perflib
package can be used to extract more detailed CPU level stats about the state of the cache — i.e. the number of hits/misses.
I get ~5 times the LIBPERF_COUNT_HW_CACHE_MISSES
counter after the Popen()
call:
QUESTION
There was such a problem. Requires conversion of *.RAW
files received the camera 4K NDVI CAMERA
for GitUp G3
.
I use libraw.h
,
which contains dcraw.c
. She works with the GitUp Git2
camera format.
My file she does not recognize it and deduces
Unsupported file format or not RAW file
I also tried the raw2dng
utility, but also there is an
Unsupported file format
Help please find a way to convert this *.RAW
file.
I attach the file (https://yadi.sk/d/sdHHY4jw3aj4Ga).
Thank you in advance!
...ANSWER
Answered 2018-Sep-08 at 08:38The problem is solved. For this, I added support for the camera in classes libraw library:
libraw_cxx.cpp
dcraw_common.cpp
dcraw.c
Here are the parameters:
QUESTION
I started to learn Qt and I wanted to make simple list of images in folder with thumbnail. I managed to get it kind of working, but it seems to randomly load only about 1 image in 500 and 1 image in 50 is black (screenshot below). Once scrolled away the thumbnail will probably not load again and some other might load this time. For the raw images I use libraw.
Few observations:
7.7.2017 - I tried to check if issue wasn't caused by broken files. Although libraw says thumbnails are jpg, they don't seem to be, because normal browsers are unable to browser neither success nor failed attemps, but better editors can open both the same. So it seems issue isn't with corrupted data being given to QImage
When I hardcoded few photos to load, when there were fewer photos they almost always loaded properly. With increasing amounts they suddenly could all go black or not load at all. Maybe a multithreading issue?
Libraw seems to always load files properly. I tested it by printing enough bytes in the middle of the file when it loaded and when it didn't
When image is black, it thinks everything is fine, when image doesn't load at all it is because QImage has null content.
When I add one image many times, all copies share the same fate (They all load or they all fail)
...ANSWER
Answered 2017-Jul-07 at 13:02The issue was very simple. Libraw's jpg thumbnail is actually the original image only as jpg (I was not aware of this, my bad) and QtQuick could not handle the size of images it was supplied. That's why it worked just fine with fewer images but failed terribly with more. The solution than was returning resized thumbnails to much smaller size, ideally exactly the size of the Image in qml.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install LibRaw
These versions contain support for new cameras that was added after the previous major release. The API/ABI of public snapshots is not frozen, and may change.
Public snapshots are always tested on a fairly large user base, and may be considered suitable for use in programs that work with files with known origins (that is, recorded directly by users’ digital cameras). However, public snapshots should not be considered sufficiently reliable for processing files that are specially constructed for vulnerability testing; that is, they should not be used in public services that allow for anonymous processing of files of unknown provenance
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page