Ask Your Question

Kitnos's profile - activity

2020-08-28 12:31:34 -0500 edited question BackgroundSubtractorMOG2 returns a gray image

BackgroundSubtractorMOG2 returns a gray image Hello, I need your help, I am trying to apply BackgroundSubtractorMOG2 t

2020-08-28 12:30:59 -0500 asked a question BackgroundSubtractorMOG2 returns a gray image

BackgroundSubtractorMOG2 returns a gray image Hello, I need your help, I am trying to apply BackgroundSubtractorMOG2 t

2020-04-15 14:44:28 -0500 received badge  Notable Question (source)
2020-03-02 08:37:42 -0500 commented question Fewer, larger features with ORB?

Hi, sorry if I am late, I have tried your image with different feature detectors (ORB, SIFT,...) and I am getting the sa

2020-02-28 08:53:06 -0500 commented question Fewer, larger features with ORB?

Did you find a solution for your problem? If not, can you add pls the original image to do some tests and see if I can f

2020-02-18 01:39:11 -0500 received badge  Popular Question (source)
2020-01-28 10:57:06 -0500 asked a question Read all jpg images from a folder with glob except 2 images

Read all jpg images from a folder with glob except 2 images Hello, I am using glob that exist in the file utility.hpp of

2020-01-20 11:08:24 -0500 edited question The meaning of minHessian in SIFT

The meaning of minHessian in SIFT Hello, I have a question about minhessian in SIFT that i can't find an answer. I rea

2020-01-19 20:06:24 -0500 received badge  Teacher (source)
2020-01-18 09:07:47 -0500 edited question The meaning of minHessian in SIFT

The meaning of minHessian in SIFT Hello, I have a question about minhessian in SIFT that i can't find an answer. I rea

2020-01-17 11:43:08 -0500 asked a question The meaning of minHessian in SIFT

The meaning of minHessian in SIFT Hello, I have a question about minhessian in SIFT that i can't find an answer. I rea

2019-12-04 02:44:09 -0500 commented answer Detect valve position without colors on a video

@Greydel Yes, that's the last solution that I have. I will add some "marking colors", for example a red small rectangle

2019-12-02 08:18:43 -0500 commented question Problem displaying rectangle in a callBack function

Thank you, I fixed my problem, but there is still a weird behavior of the code that I do not understand(Edit 1).

2019-12-02 08:18:43 -0500 received badge  Commentator
2019-12-02 08:16:50 -0500 edited question Problem displaying rectangle in a callBack function

Problem displaying rectangle in a callBack function Hello, I am trying to create a window with Opencv that display a vi

2019-12-02 04:32:17 -0500 asked a question Problem displaying rectangle in a callBack function

Problem displaying rectangle in a callBack function Hello, I am trying to create a window with Opencv that display a vi

2019-11-30 11:20:24 -0500 commented question Knn for keypoints and descriptors of SIFT

@berak Thank you for your response, what do you think about edit 1?

2019-11-30 11:19:34 -0500 edited question Knn for keypoints and descriptors of SIFT

Knn for keypoints and descriptors of SIFT Hello, I have a lot of images, let's say for example 3 images who I extract K

2019-11-29 10:40:49 -0500 edited question Knn for keypoints and descriptors of SIFT

Knn for keypoints and descriptors of SIFT Hello, I have a lot of images, let's say for example 3 images who I extract K

2019-11-29 10:40:33 -0500 edited question Knn for keypoints and descriptors of SIFT

Knn for keypoints and descriptors of SIFT Hello, I have a lot of images, let's say for example 3 images who I extract K

2019-11-29 10:40:05 -0500 edited question Knn for keypoints and descriptors of SIFT

Knn for keypoints and descriptors of SIFT Hello, I have a lot of images, let's say for example 3 images who I extract K

2019-11-29 10:39:25 -0500 edited question Knn for keypoints and descriptors of SIFT

Knn for keypoints and descriptors of SIFT Hello, I have a lot of images, let's say for example 3 images who I extract K

2019-11-29 10:38:41 -0500 asked a question Knn for keypoints and descriptors of SIFT

Knn for keypoints and descriptors of SIFT Hello, I have a lot of images, let's say for example 3 images who I extract K

2019-11-29 02:54:40 -0500 marked best answer Save image using callBack Function

Hello,

I am trying to create a window with Opencv that display a video stream and above a rectangle (gray rectangle), my goal is to save the image of the current video stream when the user click on the gray rectangle, but I can't figure out how to pass the Mat "img" to the callback function to save it:

image description

image description

 #include <opencv2\opencv.hpp>
 #include <iostream>
 using namespace cv;
 using namespace std;
Mat3b canvas;
string buttonText("Save an  image!");
string winName = "My cool GUI v0.1";    
Rect button;   

void callBackFunc(int event, int x, int y, int flags, void* userdata)
{
    if (event == EVENT_LBUTTONDOWN)
    {
        if (button.contains(Point(x, y)))
        {
            cout << "Clicked!" << endl;
            rectangle(canvas(button), button, Scalar(0, 0, 255), 2);
        }
    }
    if (event == EVENT_LBUTTONUP)
    {
        rectangle(canvas, button, Scalar(200, 200, 200), 2);
    }

    imshow(winName, canvas);
    waitKey(1);
}

int main()
{
    Mat img;
    VideoCapture cap(0); //caméra par défault
    for (;;)
    {
        cap >> img; // get a new frame from camera      
        while (img.empty()) {
            std::cout << "Frame empty" << std::endl;
            continue;
        }
        //cout << "Resolution" << img.size() << endl;        

        // Your button
        button = Rect(0, 0, img.cols, 50);

        // The canvas
        canvas = Mat3b(img.rows + button.height, img.cols, Vec3b(0, 0, 0));

        // Draw the button
        canvas(button) = Vec3b(200, 200, 200);
        putText(canvas(button), buttonText, Point(button.width*0.35, button.height*0.7), FONT_HERSHEY_PLAIN, 1, Scalar(0, 0, 0));

        // Draw the image
        img.copyTo(canvas(Rect(0, button.height, img.cols, img.rows)));

        // Setup callback function
        namedWindow(winName);
        setMouseCallback(winName, callBackFunc);

        imshow(winName, canvas);
            waitKey(1);
    }

    return 0;
}

I need your help and thank you

2019-11-28 10:54:45 -0500 edited question Save image using callBack Function

Save image using callBack Function Hello, I am trying to create a window with Opencv that display a video stream and a

2019-11-28 10:54:08 -0500 asked a question Save image using callBack Function

Save image using callBack Function Hello, I am trying to create a window with Opencv that display a video stream and a

2019-11-27 11:04:05 -0500 commented question Camera pose estimation with QR code by Opencv

@berak I have tested it, and according to my tests Zbar (version 0.10) is more stable than cv::QRCodeDetector (4.1.0 ver

2019-11-27 10:44:59 -0500 asked a question Camera pose estimation with QR code by Opencv

Camera pose estimation with QR code by Opencv Hello, I am detecting a QR code with ZBAR library, and I have as informat

2019-11-27 03:16:25 -0500 commented answer Detect valve position without colors on a video

I will try "generalize hough for edge based template matching". I already tested SIFT and SURF and ORB and they do not w

2019-11-27 02:15:49 -0500 commented answer Detect valve position without colors on a video

Thank you for your answer, unfortunately my camera is not fixed

2019-11-26 05:08:46 -0500 edited question Detect valve position without colors on a video

Detect valve position without colors on a video Hello, I can't find a solution for my problem and I need your help. I h

2019-11-26 05:04:01 -0500 received badge  Associate Editor (source)
2019-11-26 05:04:01 -0500 edited question Detect valve position without colors on a video

Detect valve position without colors on a video Hello, I can't find a solution for my problem and I need your help. I h

2019-11-26 04:49:00 -0500 asked a question Real time video problem

Real time video problem I need some help if you can help me. I have to create a real-time application (video stream) tha

2019-10-31 06:07:52 -0500 edited question SIFT between 1 image and dataset (2 images)

SIFT between 1 image and dataset (2 images) Hello, I use SIFT, and I want to find the angle of inclination of an image

2019-10-31 06:01:13 -0500 commented question SIFT between 1 image and dataset (2 images)

Sorry my diagram was not very clear i edit it now

2019-10-31 06:00:36 -0500 edited question SIFT between 1 image and dataset (2 images)

SIFT between 1 image and dataset (2 images) Hello, I use SIFT, and I want to find the angle of inclination of an image

2019-10-31 05:48:33 -0500 commented question SIFT between 1 image and dataset (2 images)

Image 1 and 2 are the same image, with a difference in scale or angle, I want to extract keypoint and descriptor from th

2019-10-31 05:47:12 -0500 commented question SIFT between 1 image and dataset (2 images)

Image 1 and 2 are the same image, with a difference in scale or angle, I want to extract keypoint and descriptor from th

2019-10-31 05:10:35 -0500 edited question SIFT between 1 image and dataset (2 images)

SIFT between 1 image and dataset (2 images) Hello, I use SIFT, and I want to find the angle of inclination of an image

2019-10-31 05:10:03 -0500 received badge  Organizer (source)
2019-10-31 04:38:49 -0500 edited question SIFT between 1 image and dataset (2 images)

sift between 1 image and dataset (2 images) Hello, I use SIFT, and I want to find the angle of inclination of an image

2019-10-31 04:37:29 -0500 asked a question SIFT between 1 image and dataset (2 images)

sift between 1 image and dataset (2 images) Hello, I use SIFT, and I want to find the angle of inclination of an image

2019-10-30 14:35:21 -0500 commented answer Bounding boxes around certain colors

Yes it will work in real time video, but this method (color filtering ), will detect only one long rectangle that englob

2019-10-30 06:10:16 -0500 edited answer Bounding boxes around certain colors

If you add an image it'll be more clear. I have only a C++ code to detect colors and draw bounding box search in the in

2019-10-30 06:09:51 -0500 edited answer Bounding boxes around certain colors

If you add an image it'll be more clear. I have only a C++ code to detect colors and draw bounding box search in the in

2019-10-30 06:08:41 -0500 edited answer Bounding boxes around certain colors

If you add an image it'll be more clear. I have only a C++ code to detect colors and draw bounding box search in the in

2019-10-30 06:07:29 -0500 edited answer Bounding boxes around certain colors

If you add an image it'll be more clear. I have only a C++ code to detect colors and draw bounding box search in the in