Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // OpenCVApplication.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include "common.h"
- void testOpenImage()
- {
- char fname[MAX_PATH];
- while (openFileDlg(fname))
- {
- Mat src;
- src = imread(fname);
- imshow("image", src);
- waitKey();
- }
- }
- void testOpenImagesFld()
- {
- char folderName[MAX_PATH];
- if (openFolderDlg(folderName) == 0)
- return;
- char fname[MAX_PATH];
- FileGetter fg(folderName, "bmp");
- while (fg.getNextAbsFile(fname))
- {
- Mat src;
- src = imread(fname);
- imshow(fg.getFoundFileName(), src);
- if (waitKey() == 27) //ESC pressed
- break;
- }
- }
- void testResize()
- {
- char fname[MAX_PATH];
- while (openFileDlg(fname))
- {
- Mat src;
- src = imread(fname);
- Mat dst1, dst2;
- //without interpolation
- resizeImg(src, dst1, 320, false);
- //with interpolation
- resizeImg(src, dst2, 320, true);
- imshow("input image", src);
- imshow("resized image (without interpolation)", dst1);
- imshow("resized image (with interpolation)", dst2);
- waitKey();
- }
- }
- void testVideoSequence()
- {
- VideoCapture cap("Videos/rubic.avi"); // off-line video from file
- //VideoCapture cap(0); // live video from web cam
- if (!cap.isOpened()) {
- printf("Cannot open video capture device.\n");
- waitKey(0);
- return;
- }
- Mat edges;
- Mat frame;
- char c;
- while (cap.read(frame))
- {
- Mat grayFrame;
- cvtColor(frame, grayFrame, CV_BGR2GRAY);
- imshow("source", frame);
- imshow("gray", grayFrame);
- c = cvWaitKey(0); // waits a key press to advance to the next frame
- if (c == 27) {
- // press ESC to exit
- printf("ESC pressed - capture finished\n");
- break; //ESC pressed
- };
- }
- }
- void testSnap()
- {
- VideoCapture cap(0); // open the deafult camera (i.e. the built in web cam)
- if (!cap.isOpened()) // openenig the video device failed
- {
- printf("Cannot open video capture device.\n");
- return;
- }
- Mat frame;
- char numberStr[256];
- char fileName[256];
- // video resolution
- Size capS = Size((int)cap.get(CV_CAP_PROP_FRAME_WIDTH),
- (int)cap.get(CV_CAP_PROP_FRAME_HEIGHT));
- // Display window
- const char* WIN_SRC = "Src"; //window for the source frame
- namedWindow(WIN_SRC, CV_WINDOW_AUTOSIZE);
- cvMoveWindow(WIN_SRC, 0, 0);
- const char* WIN_DST = "Snapped"; //window for showing the snapped frame
- namedWindow(WIN_DST, CV_WINDOW_AUTOSIZE);
- cvMoveWindow(WIN_DST, capS.width + 10, 0);
- char c;
- int frameNum = -1;
- int frameCount = 0;
- for (;;)
- {
- cap >> frame; // get a new frame from camera
- if (frame.empty())
- {
- printf("End of the video file\n");
- break;
- }
- ++frameNum;
- imshow(WIN_SRC, frame);
- Mat H(frame.rows, frame.cols, CV_8UC1);
- Mat HSV;
- cvtColor(frame, HSV, CV_BGR2HSV);
- uchar h;
- for (int i = 0; i < HSV.rows; i++){
- for (int j = 0; j < HSV.cols; j++){
- h = HSV.at<Vec3b>(i, j)[0];
- if (h < 30 && h>4){
- h = 255;
- }
- else {
- h = 0;
- }
- H.at<uchar>(i, j) = h;
- }
- }
- imshow("CanalH", H);
- c = cvWaitKey(10); // waits a key press to advance to the next frame
- if (c == 27) {
- // press ESC to exit
- printf("ESC pressed - capture finished");
- break; //ESC pressed
- }
- if (c == 115){ //'s' pressed - snapp the image to a file
- frameCount++;
- fileName[0] = NULL;
- sprintf(numberStr, "%d", frameCount);
- strcat(fileName, "Images/A");
- strcat(fileName, numberStr);
- strcat(fileName, ".bmp");
- bool bSuccess = imwrite(fileName, frame);
- if (!bSuccess)
- {
- printf("Error writing the snapped image\n");
- }
- else
- imshow(WIN_DST, frame);
- }
- }
- }
- void MyCallBackFunc(int event, int x, int y, int flags, void* param)
- {
- //More examples: http://opencvexamples.blogspot.com/2014/01/detect-mouse-clicks-and-moves-on-image.html
- Mat* src = (Mat*)param;
- if (event == CV_EVENT_LBUTTONDOWN)
- {
- printf("Pos(x,y): %d,%d Color(RGB): %d,%d,%d\n",
- x, y,
- (int)(*src).at<Vec3b>(y, x)[2],
- (int)(*src).at<Vec3b>(y, x)[1],
- (int)(*src).at<Vec3b>(y, x)[0]);
- }
- }
- void testMouseClick()
- {
- Mat src;
- // Read image from file
- char fname[MAX_PATH];
- while (openFileDlg(fname))
- {
- src = imread(fname);
- //Create a window
- namedWindow("My Window", 1);
- //set the callback function for any mouse event
- setMouseCallback("My Window", MyCallBackFunc, &src);
- //show the image
- imshow("My Window", src);
- // Wait until user press some key
- waitKey(0);
- }
- }
- void negative_image(){
- Mat img = imread("Images/cameraman.bmp",
- CV_LOAD_IMAGE_GRAYSCALE);
- for (int i = 0; i<img.rows; i++){
- for (int j = 0; j<img.cols; j++){
- img.at<uchar>(i, j) = 255 - img.at<uchar>(i, j);
- }
- }
- imshow("negative image", img);
- waitKey(0);
- }
- void change_aditiv(){
- Mat img = imread("Images/cameraman.bmp",
- CV_LOAD_IMAGE_GRAYSCALE);
- for (int i = 0; i<img.rows; i++){
- for (int j = 0; j<img.cols; j++){
- if (img.at<uchar>(i, j) < 225){
- img.at<uchar>(i, j) = 30 + img.at<uchar>(i, j);
- }
- }
- }
- imshow("negative image", img);
- waitKey(0);
- }
- void change_multiplicativ(){
- Mat img = imread("Images/cameraman.bmp",
- CV_LOAD_IMAGE_GRAYSCALE);
- for (int i = 0; i < img.rows; i++){
- for (int j = 0; j < img.cols; j++){
- img.at<uchar>(i, j) = 4 * img.at<uchar>(i, j);
- if (img.at<uchar>(i, j) > 255) {
- img.at<uchar>(i, j) = 255;
- }
- }
- }
- imshow("negative image", img);
- imwrite("D:\\Student\\IliesAlinaDenisa30233\\OpenCVApplication-VS2013_2413_basic\\Images\\img1.bmp", img);
- waitKey(0);
- }
- void creare_imagine(){
- Mat img(256, 256, CV_8UC3);
- for (int i = 0; i < img.rows / 2; i++){
- for (int j = 0; j < img.cols / 2; j++){
- img.at<Vec3b>(i, j) = { 255, 255, 255 };
- }
- }
- for (int i = 0; i < img.rows / 2; i++){
- for (int j = img.cols / 2; j < img.rows; j++){
- img.at<Vec3b>(i, j) = { 0, 0, 255 };
- }
- }
- for (int i = img.rows / 2; i < img.rows; i++){
- for (int j = 0; j < img.cols / 2; j++){
- img.at<Vec3b>(i, j) = { 0, 255, 0 };
- }
- }
- for (int i = img.rows / 2; i<img.rows; i++){
- for (int j = img.cols / 2; j < img.cols; j++){
- img.at<Vec3b>(i, j) = { 0, 255, 255 };
- }
- }
- imshow("firstImg", img);
- waitKey(0);
- }
- void matrice(){
- float vals[9] = { -1, 2, 3, 4, -1, 6, 7, 8, -1 };
- Mat M(3, 3, CV_32FC1, vals);
- Mat Minversata = M.inv();
- std::cout << Minversata << std::endl;
- waitKey(0);
- }
- void copiere_canale(){
- Mat img = imread("Images/Lena_24bits.bmp", 1);
- Mat mat1(img.rows, img.cols, CV_8UC1);
- Mat mat2(img.rows, img.cols, CV_8UC1);
- Mat mat3(img.rows, img.cols, CV_8UC1);
- for (int i = 0; i < img.rows; i++){
- for (int j = 0; j < img.cols; j++){
- Vec3b pixel = img.at<Vec3b>(i, j);
- unsigned char B = pixel[0];
- unsigned char G = pixel[1];
- unsigned char R = pixel[2];
- mat1.at<uchar>(i, j) = R;
- mat2.at<uchar>(i, j) = G;
- mat3.at<uchar>(i, j) = B;
- }
- }
- imshow("Red", mat1);
- imshow("Green", mat2);
- imshow("Blue", mat3);
- waitKey(0);
- }
- void conversie() {
- Mat img = imread("Images/Lena_24bits.bmp", 1);
- Mat img1(img.rows, img.cols, CV_8UC1);
- for (int i = 0; i < img.rows; i++){
- for (int j = 0; j < img.cols; j++){
- Vec3b pixel = img.at<Vec3b>(i, j);
- unsigned char B = pixel[0];
- unsigned char G = pixel[1];
- unsigned char R = pixel[2];
- img1.at<uchar>(i, j) = (B + G + R) / 3;
- }
- }
- imshow("ImagineSursa", img);
- imshow("ImagineDestinatie", img1);
- waitKey(0);
- }
- void conversiegray(){
- int prag;
- Mat img = imread("Images/eight.bmp", CV_LOAD_IMAGE_GRAYSCALE);
- Mat img1(img.rows, img.cols, CV_8UC1);
- printf("Dati pragul : ");
- scanf("%d", &prag);
- for (int i = 0; i < img.rows; i++){
- for (int j = 0; j < img.cols; j++){
- uchar pixel = img.at<uchar>(i, j);
- if (pixel < prag) {
- img1.at<uchar>(i, j) = 0;
- }
- else if (pixel >= prag)
- {
- img1.at<uchar>(i, j) = 255;
- }
- }
- }
- imshow("ImagineSursa", img);
- imshow("ImagineDest", img1);
- waitKey(0);
- }
- float max1(float a, float b, float c){
- float z = max(a, b);
- float maxim = max(z, c);
- return maxim;
- }
- float min1(float a, float b, float c){
- float z = min(a, b);
- float minim = min(z, c);
- return minim;
- }
- void convertireCanale(){
- Mat img = imread("Images/Lena_24bits.bmp", 1);
- Mat HN(img.rows, img.cols, CV_8UC1);
- Mat SN(img.rows, img.cols, CV_8UC1);
- Mat VN(img.rows, img.cols, CV_8UC1);
- float H = 0, S, V;
- for (int i = 0; i < img.rows; i++){
- for (int j = 0; j < img.cols; j++){
- Vec3b pixel = img.at<Vec3b>(i, j);
- uchar B = pixel[0];
- uchar G = pixel[1];
- uchar R = pixel[2];
- float b = (float)B / 255;
- float g = (float)G / 255;
- float r = (float)R / 255;
- float M = max1(b, g, r);
- float m = min1(b, g, r);
- float C = M - m;
- float V = M;
- //Saturation
- if (C) {
- S = C / V;
- }
- else {
- S = 0;
- }
- //Hue
- if (C){
- if (M == r) H = 60 * (g - b) / C;
- if (M == g) H = 120 + 60 * (b - r) / C;
- if (M == b) H = 240 + 60 * (r - g) / C;
- }
- else {
- H = 0;
- }
- if (H < 0){
- H = H + 360;
- }
- HN.at<uchar>(i, j) = H * 255 / 360;
- SN.at<uchar>(i, j) = S * 255;
- VN.at<uchar>(i, j) = V * 255;
- }
- }
- imshow("ImagineSursa", img);
- imshow("H", HN);
- imshow("S", SN);
- imshow("v", VN);
- waitKey(0);
- }
- /* Histogram display function - display a histogram using bars (simlilar to L3 / PI)
- Input:
- name - destination (output) window name
- hist - pointer to the vector containing the histogram values
- hist_cols - no. of bins (elements) in the histogram = histogram image width
- hist_height - height of the histogram image
- Call example:
- showHistogram ("MyHist", hist_dir, 255, 200);
- */
- void showHistogram(const string& name, int* hist, const int hist_cols, const int hist_height)
- {
- Mat imgHist(hist_height, hist_cols, CV_8UC3, CV_RGB(255, 255, 255)); // constructs a white image
- //computes histogram maximum
- int max_hist = 0;
- for (int i = 0; i<hist_cols; i++)
- if (hist[i] > max_hist)
- max_hist = hist[i];
- double scale = 1.0;
- scale = (double)hist_height / max_hist;
- int baseline = hist_height - 1;
- for (int x = 0; x < hist_cols; x++) {
- Point p1 = Point(x, baseline);
- Point p2 = Point(x, baseline - cvRound(hist[x] * scale));
- line(imgHist, p1, p2, CV_RGB(255, 0, 255)); // histogram bins colored in magenta
- }
- imshow(name, imgHist);
- }
- void computeHist(Mat img, int* &hist, float* &pdf){
- hist = new int[256]{};
- for (int i = 0; i < img.rows; i++){
- for (int j = 0; j < img.cols; j++){
- hist[img.at<uchar>(i, j)]++;
- }
- }
- pdf = new float[256]{};
- for (int i = 0; i < 256; i++){
- pdf[i] = hist[i] * 1.0 / (img.rows*img.cols);
- }
- }
- void computeHist1(Mat img, int* &hist, float* pdf, int m){
- hist = new int[m]{};
- for (int i = 0; i < img.rows; i++){
- for (int j = 0; j < img.cols; j++){
- hist[(int)(img.at<uchar>(i, j) / (256.0 / m))]++;
- }
- }
- pdf = new float[m]{};
- for (int i = 0; i < m; i++){
- pdf[i] = hist[i] * 1.0 / (img.rows*img.cols);
- }
- }
- Mat multilevel(Mat img)
- {
- img = imread("Images/cameraman.bmp", CV_LOAD_IMAGE_GRAYSCALE);
- int WH = 5;
- int *hist;
- float *pdf = new float[256];
- int s = 0;
- int x = 0;
- float TH = 0.0003;
- float avg;
- computeHist(img, hist, pdf);
- std::vector <int> maxime;
- maxime.push_back(0);
- for (int k = 0 + WH; k < 255 - WH; k++)
- {
- int ok = 1;
- s = 0;
- for (int l = k - WH; l < k + WH; l++)
- {
- s = s + pdf[l];
- x++;
- if (pdf[k] < pdf[l]) ok = 0;
- }
- avg = s / x;
- if (pdf[k] > avg + TH && ok == 1)
- maxime.push_back(k);
- }
- printf("Nr maxime \n");
- std::cout << maxime.size() << "\n";
- int histMax[256]{};
- for (int i = 0; i < maxime.size(); i++)
- histMax[maxime[i]] = hist[maxime[i]];
- showHistogram("Histograma", hist, 256, 256);
- showHistogram("Histograma1", histMax, 256, 256);
- waitKey(0);
- for (int i = 0; i < img.rows; i++){
- for (int j = 0; j < img.cols; j++){
- int min = 1000000;
- int val = 0;
- for (int k = 0; k < maxime.size(); k++)
- {
- if ((abs(maxime[k] - img.at<uchar>(i, j))) < min) {
- min = abs(maxime[k] - img.at<uchar>(i, j));
- val = maxime[k];
- }
- }
- img.at<uchar>(i, j) = val;
- }
- }
- return img;
- }
- Mat calcInd(Mat img){
- Mat binPict(img.rows, img.cols, CV_8UC1);
- for (int i = 0; i < img.rows; i++)
- {
- for (int j = 0; j < img.cols; j++)
- {
- if (img.at<unsigned char>(i, j) == 255)
- {
- binPict.at<unsigned char>(i, j) = 0;
- }
- else
- {
- binPict.at<unsigned char>(i, j) = 1;
- }
- }
- }
- return binPict;
- }
- void probleme(){
- int arie = 0;
- Mat img = imread("Images/oval_obl.bmp", CV_LOAD_IMAGE_GRAYSCALE);
- Mat src = calcInd(img);
- int aria = 0;
- for (int i = 0; i < src.rows; i++)
- {
- for (int j = 0; j < src.cols; j++)
- {
- if (src.at<unsigned char>(i, j) == 1)
- {
- aria++;
- }
- }
- }
- printf("Aria = %d \n", aria);
- ////////////////////////////////////////////////////////////////
- int xGr = 0, yGr = 0;
- for (int i = 0; i < src.rows; i++)
- {
- for (int j = 0; j < src.cols; j++)
- {
- xGr += i*src.at<unsigned char>(i, j);
- yGr += j*src.at<unsigned char>(i, j);
- }
- }
- xGr = xGr / aria;
- yGr = yGr / aria;
- printf("Centru de greutate X=%d Y=%d \n", xGr, yGr);
- img.at<uchar>(xGr, yGr) = 255;
- img.at<uchar>(xGr - 1, yGr) = 255;
- img.at<uchar>(xGr + 1, yGr) = 255;
- img.at<uchar>(xGr, yGr - 1) = 255;
- img.at<uchar>(xGr, yGr + 1) = 255;
- img.at<uchar>(xGr - 2, yGr) = 255;
- img.at<uchar>(xGr + 2, yGr) = 255;
- img.at<uchar>(xGr, yGr - 2) = 255;
- img.at<uchar>(xGr, yGr + 2) = 255;
- imshow("img", img);
- waitKey(0);
- /////////////////////////////////////////////////////////////////////
- double numarator = 0.0;
- double numitor1 = 0.0;
- double numitor2 = 0.0;
- double numitor = 0.0;
- float fi = 0.0;
- for (int i = 0; i < src.rows; i++){
- for (int j = 0; j < src.cols; j++){
- numarator += ((i - xGr)*(j - yGr)*src.at<unsigned char>(i, j));
- }
- }
- numarator *= 2.0;
- for (int i = 0; i < src.rows; i++){
- for (int j = 0; j < src.cols; j++){
- numitor1 += ((j - yGr)*(j - yGr)*src.at<unsigned char>(i, j));
- }
- }
- for (int i = 0; i < src.rows; i++){
- for (int j = 0; j < src.cols; j++){
- numitor2 += ((i - xGr)*(i - xGr)*src.at<unsigned char>(i, j));
- }
- }
- numitor = numitor1 - numitor2;
- float a = atan2(numarator, numitor);
- printf("Axa alungire= %f \n", a);
- fi = 0.5*a;
- Point p2(yGr+ 100 * cos(fi),xGr + 100 * sin(fi));
- Point p1(yGr - 100 * cos(fi), xGr - 100 * sin(fi));
- line(img, p1, p2, 1, 1);
- imshow("img1", img);
- waitKey(0);
- /////////////////////////////////////////////////////////////////////////
- int perimetru = 0;
- for (int i = 0; i < src.rows; i++)
- {
- for (int j = 0; j < src.cols; j++)
- {
- if (src.at<unsigned char>(i, j) == 1)
- {
- if (src.at<unsigned char>(i - 1, j) == 0 ||
- src.at<unsigned char>(i + 1, j) == 0 ||
- src.at<unsigned char>(i, j - 1) == 0 ||
- src.at<unsigned char>(i, j + 1) == 0)
- {
- perimetru = perimetru + 1;
- img.at<uchar>(i, j) = 150;
- }
- }
- }
- }
- printf("Perimetrul este = %d \n", perimetru);
- imshow("Contur perimetru", img);
- waitKey(0);
- /////////////////////////////////////////////////////////////
- float factorSubtiere = 0.0;
- factorSubtiere = 4 * 3.14*aria / (perimetru*perimetru);
- printf("Factorul de subtiere= %f \n", factorSubtiere);
- waitKey(0);
- /////////////////////////////////////////////////////////////
- int cMin = src.cols;
- int cMax = 0;
- int rMin = src.rows;
- int rMax = 0;
- float elongantia = 0.0;
- for (int i = 0; i < src.rows; i++){
- for (int j = 0; j < src.cols; j++){
- if (src.at<unsigned char>(i, j) == 1){
- if (src.at<unsigned char>(i - 1, j) == 0 ||
- src.at<unsigned char>(i + 1, j) == 0 ||
- src.at<unsigned char>(i, j - 1) == 0 ||
- src.at<unsigned char>(i, j + 1) == 0)
- {
- if (i > rMax){ rMax = i;}
- if (i < rMin){ rMin = i;}
- if (j > cMax){ cMax = j;}
- if (j < cMin){ cMin = j;}
- }
- }
- }
- }
- elongantia = ((float)(cMax - cMin + 1) / (rMax - rMin + 1));
- printf("Elongatia este = %f \n", elongantia);
- waitKey(0);
- ////////////////////////////////////////////////////////
- Mat img1 = Mat::zeros(src.rows, src.cols, CV_8UC1);
- //rows
- int sum = 0;
- for (int i = 0; i < src.rows; i++){
- sum = 0;
- for (int j = 0; j < src.cols; j++){
- if (src.at<unsigned char>(i, j) != 0){
- sum += 1;
- }
- }
- for (int j = 0; j < sum; j++){
- img1.at<unsigned char>(i, j) = 255;
- }
- }
- Mat img2 = Mat::zeros(src.rows, src.cols, CV_8UC1);
- //cols
- sum = 0;
- for (int i = 0; i < src.cols; i++){
- sum = 0;
- for (int j = 0; j < src.rows; j++){
- if (src.at<unsigned char>(j, i) != 0){
- sum += 1;
- }
- }
- for (int j = 0; j < sum; j++){
- img2.at<unsigned char>(j, i) = 255;
- }
- }
- imshow("Randuri", img1);
- waitKey(0);
- imshow("Coloane", img2);
- waitKey(0);
- Point rMinim(cMin,rMin);
- Point rMaxim(cMin,rMax);
- Point cMaxim1(cMax,rMax );
- Point cMaxim2(cMax,rMin );
- line(img, rMinim, rMaxim, 1, 1);
- line(img, rMaxim, cMaxim1, 1, 1);
- line(img,cMaxim1 ,cMaxim2 , 1, 1);
- line(img, cMaxim2,rMinim , 1, 1);
- imshow("dreptunghi", img);
- waitKey(0);
- }
- int main()
- {
- Mat img = imread("Images/Cameraman.bmp", CV_LOAD_IMAGE_GRAYSCALE);
- Mat res(img.rows, img.cols, CV_8UC1);
- float* pdf = new float[256];
- int* hist;
- int op;
- int m = 256 / 127;
- do
- {
- // system("cls");
- destroyAllWindows();
- printf("Menu:\n");
- printf(" 1 - Open image\n");
- printf(" 2 - Open BMP images from folder\n");
- printf(" 3 - Resize image\n");
- printf(" 4 - Process video\n");
- printf(" 5 - Snap frame from live video\n");
- printf(" 6 - Mouse callback demo\n");
- printf(" 7 - Negative image\n");
- printf(" 8 - Change-aditiv\n");
- printf(" 9 - Change-multiplicativ\n");
- printf(" 10 - Creare imagine \n");
- printf(" 11 - Matrice \n");
- printf("12 - Copiere canale \n");
- printf("13 - Conversie \n");
- printf("14 - ConversieGrey \n");
- printf("15 -ConvertireCanale \n");
- printf("16 -Histrograma \n");
- printf("17 -Acumulatoare \n");
- printf("18 -Multilevel \n");
- printf("19 -Probleme \n");
- printf(" 0 - Exit\n\n");
- printf("Option: ");
- scanf("%d", &op);
- switch (op)
- {
- case 1:
- testOpenImage();
- break;
- case 2:
- testOpenImagesFld();
- break;
- case 3:
- testResize();
- break;
- case 4:
- testVideoSequence();
- break;
- case 5:
- testSnap();
- break;
- case 6:
- testMouseClick();
- break;
- case 7:
- negative_image();
- break;
- case 8:
- change_aditiv();
- break;
- case 9:
- change_multiplicativ();
- break;
- case 10:
- creare_imagine();
- break;
- case 11:
- matrice();
- break;
- case 12:
- copiere_canale();
- break;
- case 13:
- conversie();
- break;
- case 14:
- conversiegray();
- break;
- case 15:
- convertireCanale();
- break;
- case 16:
- computeHist(img, hist, pdf);
- imshow("imagine", img);
- showHistogram("histogram", hist, img.rows, img.cols);
- waitKey(0);
- break;
- case 17:
- computeHist1(img, hist, pdf, 128);
- imshow("imagine", img);
- showHistogram("histogram", hist, 256, 256);
- waitKey(0);
- break;
- case 18:
- //res = multilevel(img);
- //imshow("Imagine", res);
- //imshow("Imagine1", img);
- waitKey(0);
- break;
- case 19:
- probleme();
- break;
- }
- } while (op != 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement