From 61293a09ff8ec11bd33801859d7d65ac43612e8d Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 7 May 2015 18:18:46 +0300 Subject: [PATCH] Fixed RGB-to-HLS conversion formula in documentation --- modules/imgproc/doc/colors.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/imgproc/doc/colors.markdown b/modules/imgproc/doc/colors.markdown index 7e0b39a71b..c372d280d9 100644 --- a/modules/imgproc/doc/colors.markdown +++ b/modules/imgproc/doc/colors.markdown @@ -78,9 +78,9 @@ scaled to fit the 0 to 1 range. \f[L \leftarrow \frac{V_{max} + V_{min}}{2}\f] \f[S \leftarrow \fork { \frac{V_{max} - V_{min}}{V_{max} + V_{min}} }{if \(L < 0.5\) } { \frac{V_{max} - V_{min}}{2 - (V_{max} + V_{min})} }{if \(L \ge 0.5\) }\f] -\f[H \leftarrow \forkthree {{60(G - B)}/{S}}{if \(V_{max}=R\) } - {{120+60(B - R)}/{S}}{if \(V_{max}=G\) } - {{240+60(R - G)}/{S}}{if \(V_{max}=B\) }\f] +\f[H \leftarrow \forkthree {{60(G - B)}/{(V_{max}-V_{min})}}{if \(V_{max}=R\) } + {{120+60(B - R)}/{(V_{max}-V_{min})}}{if \(V_{max}=G\) } + {{240+60(R - G)}/{(V_{max}-V_{min})}}{if \(V_{max}=B\) }\f] If \f$H<0\f$ then \f$H \leftarrow H+360\f$ . On output \f$0 \leq L \leq 1\f$, \f$0 \leq S \leq 1\f$, \f$0 \leq H \leq 360\f$ .