March 2020
Intermediate to advanced
366 pages
9h 8m
English
Since this chapter is about computational photography, some of you reading it are probably photography enthusiasts and love taking pictures using the RAW formats that your camera supports—be it Nikon Electronic Format (NEF) or Canon Raw Version 2 (CR2).
Raw files usually capture a lot more information (usually more bits per pixel) than JPEG files, and if you are going to do a lot of post-processing, these files are a lot more convenient to work with, since they will produce higher-quality final images.
So let's take a look at how to open a CR2 file using Python and load it into OpenCV. For that, we will use a Python library called rawpy. For convenience, we will write a function called load_image that can handle ...