1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

Merge pull request #29509 from asmorkalov:as/ubuntu_26.04_warn_fix

Samples build warning fix on Ubuntu 26.04
This commit is contained in:
Alexander Smorkalov
2026-07-14 08:19:57 +03:00
committed by GitHub
@@ -30,6 +30,12 @@ int main( int argc, char** argv )
cout << "Usage: " << argv[0] << " <Input image>" << endl;
return -1;
}
if (image.channels() != 3)
{
cout << "The tutorial expects 3 channel image as input!\n" << endl;
cout << "Usage: " << argv[0] << " <Input image>" << endl;
return -1;
}
//! [basic-linear-transform-load]
//! [basic-linear-transform-output]
@@ -54,7 +60,7 @@ int main( int argc, char** argv )
//! [basic-linear-transform-operation]
for( int y = 0; y < image.rows; y++ ) {
for( int x = 0; x < image.cols; x++ ) {
for( int c = 0; c < image.channels(); c++ ) {
for( int c = 0; c < 3; c++ ) {
new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>( alpha*image.at<Vec3b>(y,x)[c] + beta );
}