Menu

How can enlarge OpenCV's webcam image?

2018-07-14
2018-07-15
  • John Puskin

    John Puskin - 2018-07-14

    pyramid_up cannot work with opencv image format. Any suggestion?
    //// Sample Code....
    cv::VideoCapture cap(0);
    if (!cap.isOpened())
    {
    cerr << "Unable to connect to camera" << endl;
    return 1;
    }
    image_window win;
    while(!win.is_closed())
    {
    cv::Mat temp;
    cv_image<bgr_pixel> cimg(temp);
    //// Below does not work...
    /// Any suggestion
    while(cimg.size() < 1800*1800)
    pyramid_up(cimg);
    ////
    std::vector<rectangle> faces = detector(cimg);
    .....
    ..
    }

     
  • John Puskin

    John Puskin - 2018-07-14

    I found this method. However, I am not sure, if it is the correct way of doing it in terms of computational cost.

    /////////
    cv_image<bgr_pixel> cimg(temp);
    matrix<rgb_pixel> img;
    assign_image(img, cimg);
    pyramid_up(img);
    /////////

     
    • Davis

      Davis - 2018-07-15

      You either need to use opencv's method for doing it if you want to use
      cv::Mat or use the two argument version of pyramid_up().

       
  • John Puskin

    John Puskin - 2018-07-15

    Thanx.

     
  • John Puskin

    John Puskin - 2018-07-15

    I tried this one, but still get compile error.

    cv::Mat temp;
    if (!cap.read(temp))
    {
    break;
    }
    cv_image<bgr_pixel> cimg(temp);
    pyramid_down<2> pyr;
    pyramid_up(cimg,pyr); // <======

     
    • Davis

      Davis - 2018-07-15

      I mean use one that takes 2 images and give something other than an opencv image as output.

       

Log in to post a comment.