Skip to content

Commit cc547e8

Browse files
savuorvpisarev
authored andcommitted
Bit-exact version of Luv2RGB_b (opencv#9470)
* lab_tetra squashed * initial version is almost written * unfinished work * compilation fixed, to be debugged * Lab test removed * more fixes * Luv2RGBinteger: channels order fixed * Lab structs removed * good trilinear interpolation added * several fixes * removed Luv2RGB interpolations, XYZ tables; 8-cell LUT added * no_interpolate made 8-cell * interpolations rewritten to 8-cell, minor fixes * packed interpolation added for RGB2Luv * tetra implemented * removing unnecessary code * LUT building merged * changes ported to color.cpp * minor fixes; try to suppress warnings * fixed v range of Luv * fixed incorrect src channel number * minor fixes * preliminary version of Luv2RGBinteger is done * Luv2RGB_b is in progress * XYZ color constants converted to softfloat * Luv test: precision fixed * Luv bit-exactness test added * warnings fixed * compilation fixed, error message fixed * Luv check is limited to [0-2,0-2,0-2] by XYZ * L->Y generation moved to LUT * LUTs added for up and vp of Luv2RGB_b * still works * fixed-point is done, works at maxerr 2 * vectorized code is done, 2x slower than original * perf improved by 10% * extra comments removed * code moved to color.cpp * test_lab.cpp updated * minor refactoring * test added for Luv2RGB * OCL Luv2RGB_b: XYZ are limited to [0, 2]; docs updated * Luv2RGB_b rewritten to universal intrinsics * test_lab.cpp moved to luv_tetra branch
1 parent bb679f9 commit cc547e8

File tree

4 files changed

+459
-198
lines changed

4 files changed

+459
-198
lines changed

modules/imgproc/doc/colors.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ The values are then converted to the destination data type:
136136
- 16-bit images: (currently not supported)
137137
- 32-bit images: L, u, and v are left as is
138138

139+
Note that when converting integer Luv images to RGB the intermediate X, Y and Z values are truncated to \f$ [0, 2] \f$ range to fit white point limitations. It may lead to incorrect representation of colors with odd XYZ values.
140+
139141
The above formulae for converting RGB to/from various color spaces have been taken from multiple
140142
sources on the web, primarily from the Charles Poynton site <http://www.poynton.com/ColorFAQ.html>
141143

0 commit comments

Comments
 (0)