various bug fixes around free trigger mode, display strings and image pipe robustness
This commit is contained in:
parent
86ec50575b
commit
d5af9adec9
12 changed files with 85 additions and 25 deletions
|
|
@ -1,10 +1,11 @@
|
|||
#include "imagepipeline.h"
|
||||
#include "imagepipeline.h"
|
||||
#include <uvosunwrap/unwrap.h>
|
||||
#include <uvosunwrap/normalize.h>
|
||||
#include <uvosunwrap/curve.h>
|
||||
#include <QtConcurrent/QtConcurrentRun>
|
||||
#include <QFuture>
|
||||
#include <QDebug>
|
||||
#include <algorithm>
|
||||
|
||||
ImagePipeline::ImagePipeline(Cameras* cameras, QObject *parent): QObject(parent), cameras_(cameras)
|
||||
{
|
||||
|
|
@ -46,6 +47,8 @@ cv::Mat ImagePipeline::process(const Profile profile, std::vector<Camera::Image>
|
|||
{
|
||||
if(camera.id == image.cameraId)
|
||||
{
|
||||
if(!camera.remapMap.xMat.data || !camera.remapMap.yMat.data)
|
||||
return cv::Mat();
|
||||
if(camera.darkmap.data)
|
||||
{
|
||||
cv::Mat subtracted;
|
||||
|
|
@ -67,7 +70,7 @@ cv::Mat ImagePipeline::process(const Profile profile, std::vector<Camera::Image>
|
|||
}
|
||||
}
|
||||
}
|
||||
catch(cv::Exception ex)
|
||||
catch(cv::Exception& ex)
|
||||
{
|
||||
qDebug()<<ex.err.c_str();
|
||||
qDebug()<<"Image pipe failure";
|
||||
|
|
@ -76,11 +79,25 @@ cv::Mat ImagePipeline::process(const Profile profile, std::vector<Camera::Image>
|
|||
|
||||
if(remapedImages.size() > 0)
|
||||
{
|
||||
std::sort(remapedImages.begin(), remapedImages.end(), [](const RemapedImage& imgA, const RemapedImage& imgB) -> bool {return imgA.origin.x < imgB.origin.x;});
|
||||
cv::Mat output = simpleStich(remapedImages);
|
||||
output.convertTo(output, CV_32FC1, 1.0/255.0, 0);
|
||||
|
||||
if(profile.lightmap.data)
|
||||
normalize(output, profile.lightmap);
|
||||
{
|
||||
qDebug()<<"output"<<output.type()<<output.cols<<output.rows;
|
||||
qDebug()<<"profile.lightmap"<<profile.lightmap.type()<<profile.lightmap.cols<<profile.lightmap.rows;
|
||||
try
|
||||
{
|
||||
output = output.mul(profile.lightmap);
|
||||
}
|
||||
catch(cv::Exception& ex)
|
||||
{
|
||||
qDebug()<<ex.err.c_str();
|
||||
qDebug()<<"Image pipe failure";
|
||||
return cv::Mat();
|
||||
}
|
||||
}
|
||||
|
||||
if(profile.calcurve.data)
|
||||
applyCurve(output, profile.calcurve);
|
||||
|
|
@ -116,7 +133,7 @@ void ImagePipeline::setProfile(const Profile& profile)
|
|||
{
|
||||
qDebug()<<setup.id;
|
||||
//TODO: dehardcode this
|
||||
setup.remapMap.outputCellSize=200;
|
||||
setup.remapMap.outputCellSize=150;
|
||||
}
|
||||
invalid_ = false;
|
||||
if(!profile_.camerasSufficant(cameras_->getCameras()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue