To use COLOR_COLORCVT_MAX constant is not a good idea. I can be changed for future in imgproc module and we'll get problems with compatibility.