python手记(38)
2013-08-23 15:23
197 查看
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
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 放大图像
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手记(21)
- python手记(32)
- python 手记11 『笨方法学python 习题32』
- python手记(53)
- Python学习手记 pt4 函数
- python手记(42)
- python手记(48)
- python手记(51)
- 针对python机器学习与实战代码在python3上运行出现的错误分析和warning的修改代码34—38
- python手记(53)
- 菜鸟python入门爬虫手记(2)
- Python multiprocessing 使用手记[1] – 进程模型
- python手记(25)
- python手记(34)
- python(38):sys.argv,sys.argv.pop(),获取用户的外部输入,非指定
- python手记(36)
- python桌面端开发手记(序列化、压缩包、加密、图形界面GUI)
- python手记(45)
- python线程与进程手记