Siemka, chce zmierzyć czas wykonania funkcji i nie wiem co jest powodem błędu.
Wyskakuje mi:
Severity Code Description Project File Line Suppression State
Error C2276 '&': illegal operation on bound member function expression
a oto fragment kodu:
unsigned long check_time(void(*func)(std::vector<cv::Mat>, std::vector<std::vector<cv::KeyPoint>>&),
const std::vector<cv::Mat>& oryginalImages,
std::vector<std::vector<cv::KeyPoint>>& imagesKeypoints)
{
cTimer timer;
timer.start();
func(oryginalImages, imagesKeypoints);
return timer.getTime(cTimer::timeUnit::Microseconds);
}
std::vector<cv::Mat> findFeaturesFAST(const std::vector<cv::Mat>& oryginalImages)
{
auto FASTfeatureDetector = cv::FastFeatureDetector::create(90, true, cv::FastFeatureDetector::TYPE_9_16);
std::vector<std::vector<cv::KeyPoint>> imagesKeypoints;
std::vector<cv::Mat> scaledImagesWithKeypoints(oryginalImages.size());
cloneImageVector(oryginalImages, scaledImagesWithKeypoints);
std::cout << "FAST: " <<
check_time(FASTfeatureDetector->detect, oryginalImages, imagesKeypoints)
<< std::endl;
drawKeypoints(oryginalImages, imagesKeypoints, scaledImagesWithKeypoints);
return scaledImagesWithKeypoints;
}