img1.at<uchar>(i,j)=255;
Mat img1(200,500,CV_8U,cv::Scalar(0)); for(int k=0;k<3000;k++) { int i=rand() % img1.rows; int j=rand() % img1.cols; img1.at<uchar>(i,j)=255; } // drawing the results namedWindow("img", 1); imshow("img", img1); waitKey(0);
Mat img1(200,500,CV_8U,cv::Scalar(0)); for(int k=0;k<3000;k++) { int i=rand() % img1.rows; int j=rand() % img1.cols; img1.at<uchar>(i,j)=255; } // drawing the results namedWindow("img", 1); imshow("img", img1); waitKey(0);