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. Netty(7)-传对象

    改造timer,即客户端与服务端建立连接后,服务端主动向客户端发送当前时间. server: ch.pipeline().addLast(new TimeEncoder()); ch.pipeline ...

  2. spring boot 事务

    spring事务:默认自动提交只读:@Transactional(readOnly = true)读写:@Transactional(),因为等同于@Transactional(readOnly = ...

  3. mysql 启动停止脚本 and mysql 迁移 导入和导出

    ####监控脚本 [root@pdb~]# more /opt/VRTS/scripts/mysql_monitor.sh#!/bin/shn=`ps -ef |grep mysql|grep &qu ...

  4. Java基于springMVC的验证码案例

    ``` Java验证码案例(基于springMVC方式) 验证码工具类 package com.ekyb.common.util; import java.awt.Color; import java ...

  5. springMVC数据校验与单文件上传

    spring表单标签:    <fr:from/> 渲染表单元素    <fr:input/>输入框组件    <fr:password/>密码框组件标签    & ...

  6. 关闭mysql validate-password插件

    mysql5.7 的validate-password对密码策略有限制,比如长度大小写,太麻烦,我习惯开发环境下为root,所以在开发环境关闭这个插件的话只需在/etc/my.cnf中添加valida ...

  7. I/O————对象流

    对象流指的是可以直接把一个对象以流的形式传输给其他的介质,比如硬盘 一个对象以流的形式进行传输,叫做序列化. 该对象所对应的类,必须是实现Serializable接口 对象的序列化与反序列化就是从文件 ...

  8. datatables添加长按事件

    长按事件 $.fn.longPress = function (fn) { var timeout = undefined; var $this = this; for (var i = 0; i & ...

  9. Web端 session cookies Application viewstate

    URL传值/QueryString1.不占用服务器内存2.保密性差,传递值的长度有限 因为  上篇文章 保密性差,长度有限   传值有限只能传string类型的值 这篇文章学的知识是 session ...

  10. Vue.js-this详解

    this this 指向并不是在函数定义的时候确定的,而是在调用的时候确定的.换句话说,函数的调用方式(直接调用.方法调用.new调用.bind.call.apply.箭头函数)决定了 this 指向 ...