Skip to Content
OpenCV 4 with Python Blueprints - Second Edition
book

OpenCV 4 with Python Blueprints - Second Edition

by Dr. Menua Gevorgyan, Michael Beyeler (USD), Arsen Mamikonyan, Michael Beyeler
March 2020
Intermediate to advanced
366 pages
9h 8m
English
Packt Publishing
Content preview from OpenCV 4 with Python Blueprints - Second Edition

Using gamma correction

Why is everybody still using JPEG files if they can only distinguish between 255 different levels? Does it mean it can only capture a dynamic range of 1:255? It turns out there are clever tricks that people use.

As we mentioned before, the camera sensors capture values that are linear, that is, 4 means that it has 4 times more light than 1, and 80 has 8 times more light than 10. But does the JPEG file format have to use a linear scale? It turns out that it doesn't. So, if we are willing to sacrifice the difference between two values, for example, 100 and 101, we can fit another value there.

To understand this better, let's look at the histogram of gray pixel values of a RAW image. Here is the code to generate that—just ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

OpenCV with Python Blueprints

OpenCV with Python Blueprints

Michael Beyeler, Michael Beyeler (USD)
OpenCV 3 Computer Vision with Python Cookbook

OpenCV 3 Computer Vision with Python Cookbook

Aleksei Spizhevoi, Aleksandr Rybnikov
Mastering OpenCV 4 with Python

Mastering OpenCV 4 with Python

Alberto Fernández Villán

Publisher Resources

ISBN: 9781789801811Supplemental Content