The condition `cn <= 4 && cn != 3` looks simpler if written as `(cn==1 || cn==2 || cn==4)`.
The overall `if ( !(depth == CV_8U && cn <= 4 && cn != 3) )` looks simpler if written as `if( depth != CV_8U || cn != 1 && cn != 2 && cn != 4 )`.
Agree?