c++ - Is there a quicker way to apply brightness in OpenCV? -


in application have following code changes brightness of pixel 20.

    for( int y = 0; y < src.rows; y++ )     {          for( int x = 0; x < src.cols; x++ )         {              for( int c = 0; c < 3; c++ )             {                 src.at<cv::vec3b>(y,x)[c] = cv::saturate_cast<uchar>( ( src.at<cv::vec3b>(y,x)[c] ) + 20 );             }         }     } 

is there more efficient way of applying effect?

i not understand why cannot/do not use:

src = src + cv::scalar(20,20,20); 

would not job?


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -