Advertisement
visoft

Laborator 1, exemplu.

Feb 23rd, 2021
1,244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1.  
  2. void test_Laborator_1() {
  3.     char fname[MAX_PATH];
  4.  
  5.     while (openFileDlg(fname))
  6.     {
  7.         Mat_<uchar> src;
  8.         src = imread(fname, IMREAD_GRAYSCALE);
  9.         Mat_<Vec3b> dst = Mat_<Vec3b>(src.rows, src.cols);
  10.         for(int i = 0; i < src.rows; i++)
  11.             for (int j = 0; j < src.cols; j++) {
  12.                 dst(i, j)[0] = 255 - src(i, j);
  13.                 dst(i, j)[1] = 0;
  14.                 dst(i, j)[2] = 0;
  15.             }
  16.         imshow("image", dst);
  17.         waitKey();
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement