OPENCV 第一课 纹理合成

本文介绍了OPENCV中的纹理合成功能,特别适合初学者。讲解了纹理合成的基本算法,包括GetUnfilledNeighbors、GetNeighborhoodWindow、FindMatches等关键步骤,并指出在实现过程中常见的错误,如数组越界、矩阵类型问题等。建议优化方法包括使用多线程、内联函数,以及调整高斯权重矩阵参数。同时提醒读者,尽管此算法较慢,但作为练习非常有价值。
摘要由CSDN通过智能技术生成

文理合成像素算法可以说是非常古老而经典的算法,对于刚学习opencv的萌新再适合不过来。

原始资料相信大家都知道,不知道看下面链接:http://graphics.cs.cmu.edu/people/efros/research/EfrosLeung.html

伪代码在下:

Let SampleImage contain the image we aresampling from and let Image be the mostly empty image that we want to fill in(if synthesizing from scratch, it should contain a 3-by-3 seed in the centerrandomly taken from SampleImage, for constrainedsynthesisit should contain all the known pixels). WindowSize, the size of theneighborhood window, is the only user-settable parameter. The main portion ofthe algorithm is presented below:

//从一个样本图得到元素填充:比如以一个潦草的乱图为样本合成图片来填充image,应该有一个3*3的样本源

//constrainedadj.   不舒服的,被强迫的,拘泥的      v.   约束;限制;强迫( constrain的过去式和过去分词 );强使)

Pixels:像素

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值