Ask Your Question

Bensuperpc's profile - activity

2020-02-24 07:33:12 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

Issues with Opencv 4.2 and Tensorflow 2.0 I tried to follow this tutorial on wiki : https://github.com/opencv/opencv/wik

2020-02-24 07:32:48 -0600 commented question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

I would like to use the latest version as this is recommended by my teacher, I tested with version 2.1 and under linux o

2020-02-24 07:32:40 -0600 commented question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

I would like to use the latest version as this is recommended by my teacher, I tested with version 2.1 and under linux o

2020-02-24 07:22:02 -0600 commented question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

I would like to use the latest version as this is recommended by my teacher, I tested with version 2.1 and under linux o

2020-02-19 11:20:40 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

Issues with Opencv 4.2 and Tensorflow 2.0 I tried to follow this tutorial on wiki : https://github.com/opencv/opencv/wik

2020-02-19 10:59:12 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

Issues with Opencv 4.2 and Tensorflow 2.0 I tried to follow this tutorial on wiki : https://github.com/opencv/opencv/wik

2020-02-19 10:58:27 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

Issues with Opencv 4.2 and Tensorflow 2.0 ? I tried to follow this tutorial on wiki : https://github.com/opencv/opencv/w

2020-02-19 10:58:20 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use with Tensorflow 2.0 with Opencv 4.2 ? I tried to follow this tutorial on wiki : https://github.com/opencv/ope

2020-02-19 10:29:36 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use with Tensorflow 2.0 with Opencv 4.2 ? I tried to follow this tutorial on wiki : https://github.com/opencv/ope

2020-02-19 10:29:17 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use with Tensorflow 2.0 with Opencv 4.2 ? [Solved] I tried to follow this tutorial on wiki : https://github.com/o

2020-02-19 10:26:05 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use with Tensorflow 2.0 with Opencv 4.2 ? [Solved] I tried to follow this tutorial on wiki : https://github.com/o

2020-02-19 10:25:42 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use with Tensorflow 2.0 with Opencv 4.2 ? [Solved] I tried to follow this tutorial on wiki : https://github.com/o

2020-02-19 10:23:56 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use with Tensorflow 2.0 with Opencv 4.2 ? I tried to follow this tutorial on wiki : https://github.com/opencv/ope

2020-02-19 10:17:06 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use Opencv 4.2 with Tensorflow 2.0 ? I tried to follow this tutorial on wiki : https://github.com/opencv/opencv/w

2020-02-19 10:14:20 -0600 edited question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use Opencv 4.2 with Tensorflow 2.0 ? I tried to follow this tutorial on wiki : https://github.com/opencv/opencv/w

2020-02-19 10:11:41 -0600 asked a question Issues with Opencv 4.2 and Tensorflow 2.0 [Solve]

How to use Opencv 4.2 with Tensorflow 2.0 ? I use TensorFlow 2.0 and OpenCV 4.2, i would like to know How to use Opencv

2020-02-05 09:30:13 -0600 commented answer How to create map with pointer to function to cv tracking ?

Thank you very much, it works :)

2020-02-05 09:29:51 -0600 received badge  Supporter (source)
2020-02-05 09:24:59 -0600 marked best answer How to create map with pointer to function to cv tracking ?

Good morning, I would like to create map with pointer function with tracking functions, i tried many solution but aren't working :/

I would like to avoid many if like :

cv::Ptr<cv::Tracker>
TestTrackingVideo::createTrackerByName(std::string &trackerType) {
  cv::Ptr<cv::Tracker> tracker;
  if (trackerType == trackerTypes[0])
    tracker = cv::TrackerBoosting::create();
  else if (trackerType == trackerTypes[1])
    tracker = cv::TrackerMIL::create();
  else if (trackerType == trackerTypes[2])
    tracker = cv::TrackerKCF::create();
  else if (trackerType == trackerTypes[3])
    tracker = cv::TrackerTLD::create();
  else if (trackerType == trackerTypes[4])
    tracker = cv::TrackerMedianFlow::create();
  else if (trackerType == trackerTypes[5])
    tracker = cv::TrackerGOTURN::create();
  else if (trackerType == trackerTypes[6])
    tracker = cv::TrackerMOSSE::create();
  else if (trackerType == trackerTypes[7])
    tracker = cv::TrackerCSRT::create();
  else {
    std::cout << "Incorrect tracker name" << std::endl;
    std::cout << "Available trackers are: " << std::endl;
    for (std::vector<std::string>::iterator it = trackerTypes.begin();
         it != trackerTypes.end(); ++it)
      std::cout << " " << *it << std::endl;
  }
  return tracker;
}

I would like to create map with pointer to function like :

  std::map<std::string, cv::Ptr<cv::Tracker> (*)()> trackerTypes_map =
      {{"BOOSTINGS", &cv::TrackerBoosting::create},
       {"MIL", &cv::TrackerMIL::create}};

And call it :

cv::Ptr<cv::Tracker>
createTrackerByName(std::string &trackerType) {
   auto &iter = this->trackerTypes_map.find(trackerType);
   if (iter == this->trackerTypes_map.end()) {
      throw "tracker type not found !";
   }
   return (this->trackerTypes_map.second)();
}

When i tried to compile, i have this error :

error : could not convert '{{"BOOSTINGS", (& cv::TrackerBoosting::create)}, {"BOOSTING", (& cv::TrackerBoosting::create)}}' from '<brace-enclosed initializer list>' to 'std::map<std::__cxx11::basic_string<char>, cv::Ptr<cv::TrackerBoosting> (*)()>'
                           {"BOOSTING", &cv::TrackerBoosting::create}};
                                                                 ^

I don't know why isn't working, is something missing ? Wrong type ?

2020-02-05 09:24:59 -0600 received badge  Scholar (source)
2020-02-05 08:55:27 -0600 edited question How to create map with pointer to function to cv tracking ?

How to create map with pointer to function to cv tracking ? Good morning, I would like to create map with pointer functi

2020-02-05 08:55:25 -0600 edited question How to create map with pointer to function to cv tracking ?

How to create map with pointer to function to cv tracking ? Good morning, I would like to create map with pointer functi

2020-02-05 08:39:12 -0600 edited question How to create map with pointer to function to cv tracking ?

Error when create map with pointer to function to cv tracking Good morning, I would like to create map with pointer func

2020-02-05 08:04:53 -0600 edited question How to create map with pointer to function to cv tracking ?

Error when create map with pointer to function to cv tracking Good morning, I would like to create map with pointer func

2020-02-05 08:02:49 -0600 commented question How to create map with pointer to function to cv tracking ?

My computer school, do not like that we do several if, It is an error when looking for a solution, I use the "cv::Trac

2020-02-05 07:58:03 -0600 commented question How to create map with pointer to function to cv tracking ?

My computer school, do not like that we do several if, It is an error when looking for a solution, I use the "cv::Track

2020-02-05 07:56:31 -0600 edited question How to create map with pointer to function to cv tracking ?

Error when create map with pointer to function to cv tracking Good morning, I would like to create map with pointer func

2020-02-05 07:51:28 -0600 commented question How to create map with pointer to function to cv tracking ?

My computer school, do not like that we do several if, It is an error when looking for a solution, I use the "cv::Track

2020-02-05 07:44:22 -0600 edited question How to create map with pointer to function to cv tracking ?

Error when create map with pointer to function to cv tracking Good morning, I would like to create map with pointer func

2020-02-05 05:15:57 -0600 edited question How to create map with pointer to function to cv tracking ?

Error when create map with pointer to function to cv tracking Good morning, I would like to create map with pointer func

2020-02-05 05:14:02 -0600 edited question How to create map with pointer to function to cv tracking ?

Error when create map with pointer to function to cv Good morning, I would like to create map with pointer function with

2020-02-05 05:13:36 -0600 received badge  Organizer (source)
2020-02-05 05:06:30 -0600 asked a question How to create map with pointer to function to cv tracking ?

Error when create map with pointer to function to cv Good morning, I would like to create map with pointer function with

2020-01-29 05:51:30 -0600 received badge  Enthusiast
2020-01-26 07:18:02 -0600 commented question How to copy vector of Mat and write video ?

It's only to test and learn how OpenCV works, I have to use it soon in a school project, I can't understand why it doesn

2020-01-22 11:18:04 -0600 received badge  Editor (source)
2020-01-22 11:18:04 -0600 edited question How to copy vector of Mat and write video ?

How to copy vector of Mat and write video ? I would like to duplicate the images of a video via a vector, There are the

2020-01-22 11:13:18 -0600 asked a question How to copy vector of Mat and write video ?

How to copy vector of Mat and write video ? I would like to duplicate the images of a video via a vector, There are the