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的更多相关文章

  1. python simple factory mode example

    Two python simple factory mode examples shown in this section. One is for base operation and another ...

  2. Python: simple code

    # !/usr/bin/env python3.6 # -*- coding: utf-8 -*- # visual studio 2017 # 2019 10 12 Geovin Du print ...

  3. [译]如何使用Python构建指数平滑模型:Simple Exponential Smoothing, Holt, and Holt-Winters

    原文连接:How to Build Exponential Smoothing Models Using Python: Simple Exponential Smoothing, Holt, and ...

  4. Data manipulation primitives in R and Python

    Data manipulation primitives in R and Python Both R and Python are incredibly good tools to manipula ...

  5. [译]PyUnit—Python单元测试框架(1)

    1. 原文及参考资料 原文链接:http://docs.python.org/2/library/unittest.html# 参考文档: http://pyunit.sourceforge.net/ ...

  6. 实验一个最小的PYTHON服务器编程

    没事,玩玩儿~~~:) 按书上的例子来作.. #!/usr/bin/env python #Simple Server - Chapter 1 -server.py import socket hos ...

  7. python - StringIO文本缓冲

    参考:http://pymotwcn.readthedocs.org/en/latest/documents/StringIO.html 类StringIO提供了一个在内存中方便处理文本的类文件(读, ...

  8. Python in minute

    Python 性能优化相关专题:    https://www.ibm.com/developerworks/cn/linux/l-cn-python-optim/   Python wikipedi ...

  9. 我的第一个python web开发框架(6)——第一个Hello World

    小白中午听完老菜讲的那些话后一直在思考,可想来想去还是一头雾水,晕晕呼呼的一知半解,到最后还是想不明白,心想:老大讲的太高深了,只能听懂一半半,看来只能先记下来,将明白的先做,不明白的等以后遇到再学. ...

随机推荐

  1. [TCP/IP]IP协议

    IP数据报 IP是TCP/IP协议族中最核心的协议,所有的TCP.UDP.ICMP.IGMP数据都以IP数据报的格式传输.IP仅提供尽力而为的传输服务,如果发生某种错误,IP会丢失该数据,然后发送IC ...

  2. 手动配置 FreeBSD 网络

    设置 IP 地址和网关 编辑 /etc/rc.conf $ sudo vim /etc/rc.conf # 设置ip地址和子网掩码 ifconfig_em0="inet 192.168.0. ...

  3. RL_RTX函数

    1 延时:os_itv_set(usFrequency) //设置延时周期,配合os_itv_wait使用:os_itv_wait() 是绝对延迟是包含调用前的时间, os_dly_wait() 是相 ...

  4. (转)企业配置sudo命令用户行为日志审计

    原文:https://www.cnblogs.com/Csir/p/6403830.html?utm_source=itdadao&utm_medium=referral 第15章 企业配置s ...

  5. ruby 正则表达式 匹配所有符合规则的信息

    假设一个字符串当中有很多符合规则的信息,下面的例子可以把所有匹配到的结果打印出来: message="afhadhffkdf414j9tr3j43i3433094jwoert223jwew1 ...

  6. 一、Postgresql的基本操作

    ---------------------------------------------------------------------------------------------------- ...

  7. 中介者模式和php实现

    中介者模式: 中介者模式(Mediator Pattern)定义:用一个中介对象来封装一系列的对象交互,中介者使各对象不需要显式地相互引用,从而使其耦合松散,而且可以独立地改变它们之间的交互.中介者模 ...

  8. 微信开发 config:invalid url domain

    当遇到config:invalid url domain 有2种可能 1.没有配置url. 2.url配置错误.配置url如http://write.blog.csdn.NET/,就要这样配置writ ...

  9. hadoop完全分布式模式搭建和hive安装

    简介 Hadoop是用来处理大数据集合的分布式存储计算基础架构.可以使用一种简单的编程模式,通过多台计算机构成的集群,分布式处理大数据集.hadoop作为底层,其生态环境很丰富. hadoop基础包括 ...

  10. Linux下常用的数据恢复工具

    一.数据删除 命令:rm -rf,将任何数据直接从硬盘删除,且没有任何提示 建议做法: 把命令参数放到后面:rm -rfi 将删除的东西通过mv命令移动到系统下的/temp目录下,然后写个脚 本定期执 ...