Skip to content
Snippets Groups Projects
Commit 86524a77 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

fix scaling

parent e4255a1d
No related branches found
No related tags found
1 merge request!196High resolution colour
Pipeline #16891 passed
...@@ -49,7 +49,7 @@ enum struct definition_t : uint8_t { ...@@ -49,7 +49,7 @@ enum struct definition_t : uint8_t {
Invalid Invalid
}; };
definition_t findClosestDefinition(int width, int height); definition_t findDefinition(int width, int height);
/** /**
* Get width in pixels of definition. * Get width in pixels of definition.
......
...@@ -50,10 +50,12 @@ int ftl::codecs::getHeight(definition_t d) { ...@@ -50,10 +50,12 @@ int ftl::codecs::getHeight(definition_t d) {
return resolutions[static_cast<int>(d)].height; return resolutions[static_cast<int>(d)].height;
} }
definition_t ftl::codecs::findClosestDefinition(int width, int height) { definition_t ftl::codecs::findDefinition(int width, int height) {
int best = 0; int best = 0;
bool smaller = true;
for(const Resolution res : resolutions) { for(const Resolution res : resolutions) {
if ((res.width >= width) && (res.height >= height)) { if ((res.width == width) && (res.height == height)) {
return static_cast<definition_t>(best); return static_cast<definition_t>(best);
} }
best++; best++;
......
...@@ -72,7 +72,7 @@ Encoder::~Encoder() { ...@@ -72,7 +72,7 @@ Encoder::~Encoder() {
bool Encoder::encode(const cv::cuda::GpuMat &in, preset_t preset, bool Encoder::encode(const cv::cuda::GpuMat &in, preset_t preset,
const std::function<void(const ftl::codecs::Packet&)> &cb) { const std::function<void(const ftl::codecs::Packet&)> &cb) {
const definition_t definition = ftl::codecs::findClosestDefinition(in.size().width, in.size().height); const definition_t definition = ftl::codecs::findDefinition(in.size().width, in.size().height);
const bitrate_t bitrate = bitrate_t::High; const bitrate_t bitrate = bitrate_t::High;
return encode(in, definition, bitrate, cb); return encode(in, definition, bitrate, cb);
......
...@@ -92,7 +92,7 @@ void StereoVideoSource::init(const string &file) { ...@@ -92,7 +92,7 @@ void StereoVideoSource::init(const string &file) {
pipeline_depth_->append<ftl::operators::DiscontinuityMask>("discontinuity_mask"); pipeline_depth_->append<ftl::operators::DiscontinuityMask>("discontinuity_mask");
pipeline_depth_->append<ftl::operators::AggreMLS>("mls"); // Perform MLS (using smoothing channel) pipeline_depth_->append<ftl::operators::AggreMLS>("mls"); // Perform MLS (using smoothing channel)
calib_ = ftl::create<Calibrate>(host_, "calibration", depth_size_, stream_); calib_ = ftl::create<Calibrate>(host_, "calibration", color_size_, stream_);
if (!calib_->isCalibrated()) LOG(WARNING) << "Cameras are not calibrated!"; if (!calib_->isCalibrated()) LOG(WARNING) << "Cameras are not calibrated!";
// Generate camera parameters from camera matrix // Generate camera parameters from camera matrix
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment