python手记(38)
runfile(r'K:\testpro\testopencv.py', wdir=r'K:\testpro')
http://blog.csdn.net/myhaspl
myhaspl@qq.com
loading test.png ...
working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#code:myhaspl@qq.com
import cv2
import numpy as np fn="test.png"
if __name__ == '__main__':
print 'http://blog.csdn.net/myhaspl'
print 'myhaspl@qq.com'
print 'loading %s ...' % fn
print 'working',
img = cv2.imread(fn)
w=img.shape[1]
h=img.shape[0]
sz1=w*2
sz0=h*2
#创建空白图像
myimg1=np.zeros((sz0,sz1,3), np.uint8)
#放大图像,每2个像素取1个像素的值
temp_x=0
temp_y=0
for now_y in xrange(0,sz0):
temp_x=0
for now_x in xrange(0,sz1):
myimg1[now_y,now_x,:]=img[int(temp_y),int(temp_x),:]
temp_x+=0.5
print '.',
temp_y+=0.5 cv2.namedWindow('img1')
cv2.imshow('img1', myimg1)
cv2.waitKey()
cv2.destroyAllWindows()
python opencv 放大图像
python手记(38)的更多相关文章
- python手记(50)
#!/usr/bin/env python # -*- coding: utf-8 -*- #http://blog.csdn.net/myhaspl #code:myhaspl@qq.com imp ...
- python手记(26)
#!/usr/bin/env python import cv2 import sys fn="test2.jpg" if __name__ == '__main__': prin ...
- python手记(32)
#!/usr/bin/env python #-*- coding: utf-8 -*- import cv2 import numpy as np fn="test2.jpg" ...
- python手记(30)
#!/usr/bin/env python #-*- coding: utf-8 -*- import cv2 import numpy as np fn="test3.png" ...
- python手记(31)
#!/usr/bin/env python #-*- coding: utf-8 -*- import cv2 import numpy as np fn="test2.jpg" ...
- python手记(39)
#!/usr/bin/env python #-*- coding: utf-8 -*- #code:myhaspl@qq.com import cv2 import numpy as np fn=& ...
- python手记(45)
python 声音编辑,减少音量 #!/usr/bin/env python # -*- coding: utf-8 -*- #http://blog.csdn.net/myhaspl #code:m ...
- python手记(44)
#!/usr/bin/env python # -*- coding: utf-8 -*- #http://blog.csdn.net/myhaspl #code:myhaspl@qq.com imp ...
- python手记(51)
python通过声音将文件内容隐藏,实现原理是将文件的内容分别插入到声音文件的不同位置中做为当次采样的数据,目前是对英文文本文档加解密 #!/usr/bin/env python # -*- codi ...
随机推荐
- LA 3485 Bridge
自适应辛普森公式模板. #include<algorithm> #include<iostream> #include<cstring> #include<c ...
- LeetCode Maximum Product Subarray 解题报告
LeetCode 新题又更新了.求:最大子数组乘积. https://oj.leetcode.com/problems/maximum-product-subarray/ 题目分析:求一个数组,连续子 ...
- Com原理及應用——Com對象和接口
1.COM对象的理解 COM对象类似于C++语言中类的概念,类的每个实例代表一个COM对象,它也包括属性(即状态)和方法(即操作),状态反映对象的存在,方法就是接口. 2.COM对象的标识-CLSID ...
- DORIS-软件网址
DORIS下载网址:http://doris.tudelft.nl/ Doris软件最新的信息总可以在这个网址上查到:http://enterprise.tudelft.nl/doris/
- 一个Nodejs的简单计算測试程序
測试目的: 1 測试二维数组的使用 2 输出函数的使用 代码: var util = require('util'); a = 3; b = 4; c = a + b; a = []; for(i = ...
- [转] .bss段和.data段的区别
PS:http://stackoverflow.com/questions/16557677/difference-between-data-section-and-the-bss-section-i ...
- redis 本机链接服务端命令
在windows 本机链接服务端redis,需要下载windows 端的redis: 1,运行redis-server.exe程序:2,打开cmd 控制台3,执行命令 D:\redis64\redis ...
- 【网络流#4】UVA 753 最大流
最近开始刷网络流的题目了,先从紫书上的开始,这道题是P374上的,嘛,总之这道题最终还是参考了一下紫书. 中间是用了STL中map将字符串映射成编号,使用编号总比是用字符串简单的多. 超级源点S与各个 ...
- 获取web路径的几种方式
1.string str1 = Request.ApplicationPath.ToString(); 返回路径为:\HolterClientWeb 2.HttpServerUti ...
- shell 数组(in_array)
if [[ ! "${array[@]}" =~ $val ]] ; then fi