我有一系列的图像,并从中提取一张卡片。在此过程之后,卡将正确地对齐并投影回平面(warpPerspective)。然而,它的质量太低,无法从卡片上读取文本。因此,我试图使用superres模块来提高分辨率,但是文档非常肤浅,我还没有找到如何将多幅图像传递给算法。
我尝试实现一个定制的FrameSource,它基本上是一个std::vector的适配器,但出于某种原因,我得到了一个分段错误。
class InterFrameSource : public superres::FrameSource {
std::vector<cv::Mat> frames;
std::vector<cv::Mat>::iterator iter;
public:
InterFrameSource(std::vector<cv::Mat> _frames) : frames(_frames)
{
reset();
}
virtual void nextFrame(OutputArray _frame)
{
_frame.getMatRef().setTo(*iter);
++iter;
}
virtual void reset() {
iter = frames.begin();
}
};编辑 cv::Mat都是纯CPU的.
发布于 2014-12-17 20:37:30
好吧,两天后我终于拿到了。我需要反向复制逻辑:
virtual void nextFrame(OutputArray _frame)
{
if (iter == frames.end()) return;
iter->copyTo(_frame);
++iter;
}https://stackoverflow.com/questions/27533993
复制相似问题