Some more fixes to better support 16 bit.

This commit is contained in:
Tadas Baltrusaitis 2017-12-15 20:01:28 +00:00
parent 7d58b86020
commit d0279d2224
3 changed files with 1 additions and 37 deletions

View File

@ -43,39 +43,6 @@ namespace Utilities
// Converting between color spaces and bit depths
//===========================================================================
// Perform the conversion inplace
static void ConvertToRGB_8bit(cv::Mat& in_out)
{
if (in_out.channels() == 3 && in_out.depth() == CV_16U)
{
in_out = in_out / 256;
}
else if (in_out.channels() == 4)
{
if (in_out.depth() == CV_16U)
{
in_out = in_out / 256;
cv::cvtColor(in_out, in_out, CV_BGRA2BGR);
}
else
{
cv::cvtColor(in_out, in_out, CV_BGRA2BGR);
}
}
else if (in_out.channels() == 1)
{
if (in_out.depth() == CV_16U)
{
in_out = in_out / 256;
cv::cvtColor(in_out, in_out, CV_GRAY2BGR);
}
else
{
cv::cvtColor(in_out, in_out, CV_GRAY2BGR);
}
}
}
static void ConvertToGrayscale_8bit(const cv::Mat& in, cv::Mat& out)
{
if (in.channels() == 3)

View File

@ -364,9 +364,6 @@ cv::Mat ImageCapture::GetNextImage()
exit(1);
}
// Convert the latest frame to 3 channel 8 bit format if it is not in it already
//ConvertToRGB_8bit(latest_frame); TODO check
image_height = latest_frame.size().height;
image_width = latest_frame.size().width;

View File

@ -187,7 +187,7 @@ RecorderOpenFace::RecorderOpenFace(const std::string in_filename, RecorderOpenFa
}
else
{
this->media_filename = path(filename).concat(".bmp").string(); // TODO change back to jpg
this->media_filename = path(filename).concat(".jpg").string();
metadata_file << "Output image:" << this->media_filename << endl;
this->media_filename = (path(record_root) / this->media_filename).string();
}