Python: simple drawings
import cv2; # OpenCV Python
import numbers;
import numpy as np;
import math;
import matplotlib;
import matplotlib.pyplot as plt;
import matplotlib.image as mpimg;
from IPython.display import display, Image img = cv2.imread('9012.JPG');
img=np.zeros((512,512,3),np.uint8); img=cv2.line(img,(0,0),(511,511),(255,0,0),5); img=cv2.rectangle(img,(384,0),(510,128),(0,255,0),3); img=cv2.circle(img,(447,63),63,(0,0,255),-1); img=cv2.ellipse(img,(256,256),(100,50),0,0,180,255,-1); font=cv2.FONT_HERSHEY_SIMPLEX;
cv2.putText(img,'OpenCv',(10,500),font,4,(255,255,255),2,cv2.LINE_AA); pts=np.array([[10,5],[20,30],[70,20],[50,10]],np.int32);
pts=pts.reshape((-1,1,2));
img=cv2.polylines(img,[pts],True,(0,255,255)); cv2.imshow('image',img);
cv2.waitKey(0);
cv2.destroyAllWindows(); print('geovindu'); # print(img);
# display
# imgshow=mpimg.imread('9012.JPG');
# imgplot = plt.imshow(imgshow);
# plt.show(); # display image
im = cv2.imread('9012.JPG');
im_resized = cv2.resize(im, (224, 224), interpolation=cv2.INTER_LINEAR);
plt.imshow(cv2.cvtColor(im_resized, cv2.COLOR_BGR2RGB));
plt.show();
Python: simple drawings的更多相关文章
- python simple factory mode example
Two python simple factory mode examples shown in this section. One is for base operation and another ...
- Python: simple code
# !/usr/bin/env python3.6 # -*- coding: utf-8 -*- # visual studio 2017 # 2019 10 12 Geovin Du print ...
- [译]如何使用Python构建指数平滑模型:Simple Exponential Smoothing, Holt, and Holt-Winters
原文连接:How to Build Exponential Smoothing Models Using Python: Simple Exponential Smoothing, Holt, and ...
- Data manipulation primitives in R and Python
Data manipulation primitives in R and Python Both R and Python are incredibly good tools to manipula ...
- [译]PyUnit—Python单元测试框架(1)
1. 原文及参考资料 原文链接:http://docs.python.org/2/library/unittest.html# 参考文档: http://pyunit.sourceforge.net/ ...
- 实验一个最小的PYTHON服务器编程
没事,玩玩儿~~~:) 按书上的例子来作.. #!/usr/bin/env python #Simple Server - Chapter 1 -server.py import socket hos ...
- python - StringIO文本缓冲
参考:http://pymotwcn.readthedocs.org/en/latest/documents/StringIO.html 类StringIO提供了一个在内存中方便处理文本的类文件(读, ...
- Python in minute
Python 性能优化相关专题: https://www.ibm.com/developerworks/cn/linux/l-cn-python-optim/ Python wikipedi ...
- 我的第一个python web开发框架(6)——第一个Hello World
小白中午听完老菜讲的那些话后一直在思考,可想来想去还是一头雾水,晕晕呼呼的一知半解,到最后还是想不明白,心想:老大讲的太高深了,只能听懂一半半,看来只能先记下来,将明白的先做,不明白的等以后遇到再学. ...
随机推荐
- dot watch
dot watch+vs code提升asp.net core开发效率 在园子中,已经又前辈介绍过dotnet watch的用法,但是是基于asp.net core 1.0的较老版本来讲解的,在asp ...
- Webstorm 激活
注册时,在打开的License Activation窗口中选择“License server”,在输入框输入下面的网址: http://idea.iteblog.com/key.php 点击:Acti ...
- MVC 知识点总结
[此篇文章收录于其他博客,作为笔记使用] 一· MVC MVC设计模式->MVC框架(前端开发框架),asp.net(webform) aspx M:Model (模型,负责业务逻辑处理,比如 ...
- .net core 的跨域
.net core 的跨域问题花了 我很长时间 接下来我简单的描述下解决过程 首先我在前端用jquery的ajax去调用自己的本地接口大致如下 $.ajax({ type:"POST&quo ...
- html5 02 随记
HTML 02 全局通用属性 id name class style 一. 图像标签 标签名:<img /> 常用属性: Alt -- 代表图像的替代文字 作用: 当图片不显示的 ...
- ArcGIS for Server内置JS Viewer的离线部署和配置
很多情况下,在地图服务发布完毕后,我们往往利用 ArcGIS for Server内置的 JS Viewer来查看和检测所发布的地图服务是否满足我们的要求.具体操作如下: 点击开始 -> 所有程 ...
- Unity3d通过脚本生成apk
参考链接:http://www.jianshu.com/p/a9261113b4ac 照着链接的方法并没有正确生成APK,IPA没有测试过,不过大致的方法是正确的,修改如下: Environment. ...
- github的pull Request使用
场景: teamA要一起做一个项目,选择用github管理自己的代码仓库,这时userA在github上新建了一个远程仓库,其他人需要通过pull request来实现提交.那么,问题来了,pull ...
- jsp之数据提交与获取(传统方法)
package com.java.model; public class Student { private String name; private int age; public String g ...
- HTTP协议初探
HTTP协议初探 HTTP协议初探 什么是http协议? 遵守协议的双方 再来回答什么是http协议 抓到这两段文本 可以总结出以下规律 HTTP 请求命令(动作,谓词 ,METHOD) GET 和 ...