Program Listing for File ImageDisplay.h¶
↰ Return to documentation for file (lib/IOWrapper/ImageDisplay.h)
#pragma once
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
namespace lsd_slam
{
namespace Util
{
struct DisplayImageObect
{
cv::Mat img;
std::string name;
bool autoSize;
};
void displayImage(const char* windowName, const cv::Mat& image, bool autoSize = true);
inline void displayImage(const char* windowName, const float* image, int width, int height)
{
cv::Mat floatWrapper(height, width, CV_32F, const_cast<float*>(image));
cv::Mat tempImage(height, width, CV_8UC1);
floatWrapper.convertTo(tempImage, CV_8UC1);
cv::cvtColor(tempImage, tempImage, CV_GRAY2RGB);
displayImage(windowName, tempImage);
}
int waitKey(int milliseconds);
int waitKeyNoConsume(int milliseconds);
void closeAllWindows();
}
}