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
This commit is part of merge request !196. Comments created here will be created in the context of that merge request.
......@@ -49,7 +49,7 @@ enum struct definition_t : uint8_t {
Invalid
};
definition_t findClosestDefinition(int width, int height);
definition_t findDefinition(int width, int height);
/**
* Get width in pixels of definition.
......
......@@ -50,10 +50,12 @@ int ftl::codecs::getHeight(definition_t d) {
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;
bool smaller = true;
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);
}
best++;
......
......@@ -72,7 +72,7 @@ Encoder::~Encoder() {
bool Encoder::encode(const cv::cuda::GpuMat &in, preset_t preset,
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;
return encode(in, definition, bitrate, cb);
......
......@@ -92,7 +92,7 @@ void StereoVideoSource::init(const string &file) {
pipeline_depth_->append<ftl::operators::DiscontinuityMask>("discontinuity_mask");
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!";
// 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