|
|
@@ -21,8 +21,8 @@ int main(void) |
|
|
|
}); |
|
|
|
|
|
|
|
//To calculate the frame rate |
|
|
|
std::chrono::milliseconds last = duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()); |
|
|
|
std::chrono::milliseconds now = duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()); |
|
|
|
std::chrono::milliseconds last = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()); |
|
|
|
std::chrono::milliseconds now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()); |
|
|
|
|
|
|
|
cv::Mat img; |
|
|
|
lfr.addListener([&](LFR_Result result) |
|
|
@@ -33,12 +33,12 @@ int main(void) |
|
|
|
cv::resize(result.rawImage, img, cv::Size(128, 64+32)); |
|
|
|
|
|
|
|
//Calculate frame rate |
|
|
|
now = duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()); |
|
|
|
unsigned int deltaMs = (now-last).count(); |
|
|
|
float delta = static_cast<float>(deltaMs) / 1000.0; |
|
|
|
float frameRate = 1.0 / static_cast<float>(delta); |
|
|
|
now = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()); |
|
|
|
unsigned int deltaMs = static_cast<unsigned int>((now-last).count()); |
|
|
|
double delta = static_cast<double>(deltaMs) / 1000.0; |
|
|
|
double frameRate = 1.0 / static_cast<double>(delta); |
|
|
|
|
|
|
|
//std::cout << "Frame rate: " << frameRate << std::endl; |
|
|
|
std::cout << "Frame rate: " << frameRate << std::endl; |
|
|
|
last = now; |
|
|
|
} |
|
|
|
}, &mutex); |