python opencv图片融合

#!/usr/bin/env python
#-*- coding: utf-8 -*-
#code:myhaspl@qq.com
import cv2
import numpy as np fn1="he1.jpg"
fn2="he2.jpg"
if __name__ == '__main__':
print 'http://blog.csdn.net/myhaspl'
print 'myhaspl@qq.com'
print print 'working',
myimg1 = cv2.imread(fn1)
myimg2 = cv2.imread(fn2)
w=myimg1.shape[1]
h=myimg1.shape[0]
sz1=w
sz0=h #每个像素为2个像素的平均值
for y in xrange(0,sz0):
for x in xrange(0,sz1):
myimg2[y,x,:]=myimg1[y,x,:]*0.5+myimg2[y,x,:]*0.5 print '.', cv2.namedWindow('img2')
cv2.imshow('img2', myimg2)
cv2.waitKey()
cv2.destroyAllWindows()

python手记(41)的更多相关文章

  1. python手记(50)

    #!/usr/bin/env python # -*- coding: utf-8 -*- #http://blog.csdn.net/myhaspl #code:myhaspl@qq.com imp ...

  2. python手记(26)

    #!/usr/bin/env python import cv2 import sys fn="test2.jpg" if __name__ == '__main__': prin ...

  3. python手记(32)

    #!/usr/bin/env python #-*- coding: utf-8 -*- import cv2 import numpy as np fn="test2.jpg" ...

  4. python手记(30)

    #!/usr/bin/env python #-*- coding: utf-8 -*- import cv2 import numpy as np fn="test3.png" ...

  5. python手记(31)

    #!/usr/bin/env python #-*- coding: utf-8 -*- import cv2 import numpy as np fn="test2.jpg" ...

  6. python手记(38)

    runfile(r'K:\testpro\testopencv.py', wdir=r'K:\testpro') http://blog.csdn.net/myhaspl myhaspl@qq.com ...

  7. python手记(39)

    #!/usr/bin/env python #-*- coding: utf-8 -*- #code:myhaspl@qq.com import cv2 import numpy as np fn=& ...

  8. python手记(45)

    python 声音编辑,减少音量 #!/usr/bin/env python # -*- coding: utf-8 -*- #http://blog.csdn.net/myhaspl #code:m ...

  9. python手记(44)

    #!/usr/bin/env python # -*- coding: utf-8 -*- #http://blog.csdn.net/myhaspl #code:myhaspl@qq.com imp ...

随机推荐

  1. UVa1583 Digit Generator

    #include <stdio.h> int main(){    int T, N, i, k, digitsum, generator;    scanf("%d" ...

  2. [Swust OJ 582]--放学了,抢机子了(SPFA)

    题目链接:http://acm.swust.edu.cn/problem/0582/ Time limit(ms): 5000 Memory limit(kb): 65535   Descriptio ...

  3. Win7下安装Apache+PHP+MySQL

    Win 7 下搭建 WAMP 环境本文安装方法适用于 Windows7 下的 Apache + MySQL + PHP(WAMP)安装,同时也适用于 Windows XP 系统下的安装和配置.一.安装 ...

  4. Volley 设置 RetryPolicy 不起作用, 重复提交

    RT, Google后有的说是 将超时时间设置为0, 但是还是会重试提交, 解决方案如下: static HurlStack stack = new HurlStack(){ @Override pr ...

  5. Android 开发笔记 “Sqlite数据库删除”

    1.代码方式 Context.deleteDatabase(String databaseName);//删除某一数据库 2.设置里面 进入应用程序 ,然后清除数据就ok了

  6. java源码解析——Stack类

    在java中,Stack类继承了Vector类.Vector类和我们经常使用的ArrayList是类似的,底层也是使用了数组来实现,只不过Vector是线程安全的.因此可以知道Stack也是线程安全的 ...

  7. HDU 2722 Here We Go(relians) Again

    最短路,建图太麻烦,略过…… #include <cstdio> #include <cstring> #include <queue> const int INF ...

  8. java面试复习 I

    1 多线程 在程序开发中只要是多线程肯定永远以实现Runnable接口为主,因为实现Runnable接口相比继承Thread类有如下好处: 避免点继承的局限,一个类可以继承多个接口. 适合于资源的共享 ...

  9. [转载]Android 知识图谱

    from: http://blog.csdn.net/xyz_lmn/article/details/41411355

  10. 【LeetCode】Path Sum 2 --java 二叉数 深度遍历,保存路径

    在Path SUm 1中(http://www.cnblogs.com/hitkb/p/4242822.html) 我们采用栈的形式保存路径,每当找到符合的叶子节点,就将栈内元素输出.注意存在多条路径 ...