- 博客(43)
- 资源 (36)
- 收藏
- 关注
原创 文件操作实践(一)
简介利用Python的文件操作命令和函数功能,实现 : 1、获取ha记录 2、增加ha记录 3、删除ha记录文件内容global log 127.0.0.1 local2 daemon maxconn 256 log 127.0.0.1 local2 infodefaults log global
2017-08-30 20:45:52 307
原创 函数式编程
简介函数式编程与函数调用完全不是一回事,函数式编程中的函数这个术语不是指计算机中的函数(实际上是Subroutine),而是指数学中的函数,即自变量的映射。也就是说一个函数的值仅决定于函数参数的值,不依赖其他状态。比如sqrt(x)函数计算x的平方根,只要x不变,不论什么时候调用,调用几次,值都是不变的。函数式简单说,”函数式编程”是一种”编程范式”(programming paradigm),也就
2017-08-26 21:18:16 237
原创 函数基础(二)
局部变量在def函数里生效,这个函数内部即为这个变量的作用域,其在外部无法实现调用。def test_dict(name,age = 18,**kwargs): print('name',name) name = 'Angel' print('name', name) print('age',age) print(kwargs)name = 'Angela'
2017-08-26 20:37:17 436
原创 函数基础(一)
简介函数有利于将重复代码替换,同时,函数修改方便,可扩展性强。导入时间函数import timedef print_time_current(): time_format = '%Y-%m-%d %X' time_current = time.strftime(time_format) print(time_current)print_time_current()默认位置调
2017-08-25 22:19:43 204
原创 字符编码与转码
简介编码方式:ASCII码、GB2312、GB18030、万国码Unicode。其中 Unicode》1字符=2字节=16位; ASCII》1字符=1字节=8位; 为解决提升后的英文字符的多空间占用问题,将Unicode扩展集为utf-8,是一种可变长的字符编码,默认所有英文字符按ASCII的1字节形式存储,所有的中文字符按3字节处理。为什么utf8占用3个字节?Python3.5中的转换s
2017-08-25 21:17:38 352
原创 Python 文件操作(二)
简介文件的读写刷新操作,基本的命令总结如下表: 命令 说明 r 只读(默认) r+ 读写 w 写入 先删除原文件,再重新创建,如果文件不存在则创建 w+ 读写 先删除原文件,再重新创建,如果文件不存在则创建,可以写入输出 a 写入 在文件末尾追加新的内容,文件不存在,则创建 a+ 读写 在文件末尾追加新的内容,文件不存在,则创建 b
2017-08-25 11:38:16 282
原创 Python 文件操作(一)
简单读取f = open(" ",'r',encoding='utf-8')data1 = f.read()data2 = f.read()print("####data1####\n",data1)print("----data2----",data2)只有data1数据,因为光标读取到最后。不能同时写f.write(),‘w’是写,很危险,如果open已存在的文件,就覆盖了新的,原来内容
2017-08-22 22:12:05 284
转载 安装Google Object Detection API
前提条件已安装Python,建议采用VirtualEnv或者Anaconda安装TensorFlow 1.xpython和tensorflow的安装见相关文档 https://www.tensorflow.org/install/安装pillow, jupyter, matplotlib, lxml,通过pip完成安装下载源代码Git clone https://github.com/t
2017-08-22 16:10:30 605
转载 在Python中使用protocol buffers参考指南
一、前言windows 7 & protobuf 3.0 & python 3.5 其实看这篇文章就可以把整个安装和测试过程做的七七八八了。 虽然对于露珠这样的新手来说,过程中可能遇到的很多小问题没有提到,但是这篇文章给了一个不错的指引方向,所以还是很值得阅读的。 转至:http://blog.csdn.net/losophy/article/details/17006573 windows
2017-08-22 10:31:33 1278
原创 module 'cv2' has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'
简介使用cv2.CV_LOAD_IMAGE_GRAYSCALE时报错:module ‘cv2’ has no attribute ‘CV_LOAD_IMAGE_GRAYSCALE’。Traceback (most recent call last): File “/Users/n1/Desktop/FaceDetection/face.py”, line 8, in gray = imrea
2017-08-21 19:58:03 13130
原创 字典循环训练
基础篇# -*- coding:utf-8 -*-data = { '浙江':{ '杭州':{ "西湖":['tea','silk'], "上城区":['链家','我爱我家'] }, '宁波':{ "慈溪":['奔驰','默默'], "宁海":['
2017-08-21 17:11:29 257
原创 图片的透视变换perspective transform——旋转矫正
简介一幅倾斜了的图片如何进行矫正,这也许比较有用,比如,传统的车牌中有将倾斜了的车牌文字,用 Radon变换进行矫正。如果我们知道了四个点的坐标,是否也可以进行矫正处理?代码'''Created on 2017年8月20日@author: XuTing'''# import the necessary packagesimport matplotlib.pyplot as pltimpor
2017-08-20 19:34:52 4529
原创 Detecting Skin in Images & Video Using Python and OpenCV皮肤检测
简介使用video或者摄像头,检测皮肤区域,我们可以获得区域内的皮肤图像。skindetector.py# import the necessary packagesfrom pyimagesearch import imutilsimport numpy as npimport argparseimport cv2# construct the argument parse and par
2017-08-20 18:58:53 483
原创 HSV、RGB颜色空间范围取值的确定
简介这里提供了工具,一种随时调整HSV颜色空间取值范围的界限,可以实时摄像头捕捉,也可以用图片读取颜色空间范围。代码#!/usr/bin/env python# -*- coding: utf-8 -*-# USAGE: You need to specify a filter and "only one" image source##Run cmd (python) range_detect
2017-08-20 17:09:51 3902
原创 Color Detection 颜色定位
简介使用Python、cv2的颜色定位,mask图像,需要取定颜色取值范围。代码'''Created on 2017年8月20日@author: XT'''# import the necessary packagesimport numpy as npimport argparseimport cv2# construct the argument parse and parse th
2017-08-20 16:47:21 2301
原创 matplotlib.pyplot与cv2、Image.open 读取图片显示的差异
简介 In the Python bindings of OpenCV, images are represented as NumPy arrays in BGR order. This works fine when using the cv2.imshow function. However, if you intend on using Matplotlib, the plt.imsho
2017-08-20 15:48:32 7882
原创 Python imutils 填充图片周边为黑色
代码import imutilsimport cv2image = cv2.imread('') # translate the image x=25 pixels to the right and y=75 pixels uptranslated = imutils.translate(image, -75, 75)cv2.imshow('original image',image)
2017-08-20 15:31:41 3023 1
原创 多尺度图片滑动窗口输出裁剪
简介上一篇介绍了多尺度图片滑动窗口输出,如果要在新win窗口下显示当前的滑动窗口图片,那么怎么设置呢?或者将滑动窗口的图片裁剪下来,发现使用 region = (10,0,300,100)#box = (left, top, left+width, top+height),(x0,y0,x1,y1),from W,H cropImg = img.crop(region)这样的命令,不成功
2017-08-20 15:09:58 5005
原创 imutils Rotation
代码import imutilsimport cv2image = cv2.imread('') # loop over the angles to rotate the imagefor angle in range(0, 360, 90): # rotate the image and display it rotated = imutils.rotate(image,
2017-08-19 21:46:36 940
原创 imutils with Canny Edge Detection
简介使用imutils对图像进行Canny边缘检测,与网页LOGO获取。代码import imutilsimport cv2url = "http://pyimagesearch.com/static/pyimagesearch_logo_github.png"logo = imutils.url_to_image(url)cv2.imshow("URL to Image", logo)gr
2017-08-19 21:30:07 418
原创 多尺度图片滑动窗口输出
简介上一篇我们介绍了图片Gaussian pyramid(一、二)图片不压缩的情况下,重新resize到不同大小,这样做的目的是为这一节做准备,即利用滑动窗口圈住图片的文字信息内容等,例如车牌的获取。'''Created on 2017年8月19日@author: XT'''# import the necessary packagesimport helpersimport argpar
2017-08-19 20:47:17 5795 5
原创 图片Gaussian pyramid(二)
METHOD #1: No smooth, just scaling.def pyramid(image, scale=1.5, minSize=(30, 30)): # yield the original image yield image # keep looping over the pyramid while True: # compute t
2017-08-19 19:49:24 1297
原创 图片Gaussian pyramid(一)
简介偶然在一个网页上发现一个Python图像处理的方法,能够进行图片的缩放。首先进行了高斯滤波,当缩放到小于30×30时break。# import the necessary packagesfrom skimage.transform import pyramid_gaussianimport cv2from PIL import Imageimage = Image.open('./im
2017-08-19 19:25:47 5262 2
原创 Python Sting 练习实践(二)
字典增删改查Student_Info = { '1220610001':'Alex', '1220610002':'Bob', '1220610003':'Cindy', '1220610004':'David'}print("info:",Student_Info)pr
2017-08-19 16:13:50 411
转载 Win7+VS2013+OpenCV3.0.0详细配置
当配置过程中,打开了VS2013,同时发现系统变量配错了,回头改了系统变量,那么切记要重启VS2013,因为VS2013在启动时就加载了系统变量,所以如果打开着VS2013回头更改了系统变量,此时VS2013已经加载了系统变量,更改的系统变量没有立即生效。如果不行重启试试也行,我就是最后重启后,配置完全没动,错误就消失了,经分析才知道是系统变量没有立即生效的原因。这么白痴的错误写在这里,是写给当时犯
2017-08-19 14:01:35 466
转载 【OpenCV入门教程之一】 安装OpenCV:OpenCV 3.0、OpenCV 2.4.8、OpenCV 2.4.9 +VS 开发环境配置
本系列文章由@浅墨_毛星云 出品,转载请注明出处。 文章链接: http://blog.csdn.net/poem_qianmo/article/details/19809337 作者:毛星云(浅墨) 微博:http://weibo.com/u/1723155442 邮箱: [email protected] 知乎:http://www.zhihu.com/people/m
2017-08-19 13:57:37 898
原创 Python Sting 练习实践(一)
字符串切片name = "Alex_XT"print(name[name.find("e"):]) ex_XT列表Tab对齐name = "\tAlex_XT"print(name.expandtabs(tabsize=8))字符居中对齐name = "Alex_XT"print(name.center(50,"-"))字符左补齐Name = "Alex_XT"print(Name.l
2017-08-19 13:49:53 823
转载 自定义CSDN博客中图片上的水印内容
最近用markdown写博客的时候,发现我上传的一张图片被强制打上了水印,打上水印也就算了,还那么丑!(见下图1)实在不能忍!下面我们来解决这个问题。图1: 我们可能会想要的效果:没有水印: 自定义水印内容,颜色 我们来看一下如何实现上述效果下面是插入图片的时候csdn-markdown编辑器中生成的代码:![图1](http://img.blog.csdn.net/20170212205452
2017-08-17 16:02:40 325
原创 tensorflow之MNIST手写字符集训练可视化
简介很多人认为卷积神经是一个黑箱子,把图片输入,输出结果为有监督式的学习(supervised learning),贴标签的形式,即可达到分类的效果。那么计算机到底做了什么事情呢?训练过程结果如何可视化?下面进行简单的介绍。模型的搭建@author XT#第1层convolutionalW1 = tf.Variable(tf.truncated_normal([5,5,1,K],stddev=0
2017-08-17 15:55:13 1232
原创 tensorflow裁剪填充指定大小图片(二)
简介上一节,介绍了处理一张图片,在不进行压缩的情况下对其进行裁剪或者填充背景颜色为黑色。这节介绍批量读取和保存裁剪、填充的图片。 1、需要在要进行处理的图片,新建InitImages文件夹,把图片放进去,命名格式不需要管; 2、新建文件夹crop_or_pad用于保存处理后的图片,命名规则为“crop_or_pad000”到“crop_or_padxxx”;示例代码'''Created on
2017-08-16 15:02:19 3008 1
原创 tensorflow裁剪填充指定大小图片(一)
简介对于不同规则大小的图片,想要在不进行压缩的情况下对其进行裁剪或者填充背景颜色为黑色,在Python图像处理中找了半天,没找到相应的函数。。。后来发现可利用tensorflow中的: tf.image.resize_image_with_crop_or_pad示例代码'''Created on 2017-8-16@author: XT'''import tensorflow as tf
2017-08-16 11:21:24 4209 2
原创 tensorflow 设置图片大小与翻转
简介读图的时候是用 tensorflow 的函数,存图像用的save,发现报错,tensor对象不能进行直接保存操作,得用 scipy.misc 的 imsave 函数。实例代码import tensorflow as tf import numpy as np import scipy.misc #读取图像可任意大小 filenames = ['E://Parking186//Img
2017-08-16 10:47:23 2102
原创 生成验证码图片(四)
生成带字母数字类型'''Created on 2017年8月4日@author: XTing'''from captcha.image import ImageCaptcha # pip install captchaimport numpy as npimport matplotlib.pyplot as pltfrom PIL import Imageimport random#
2017-08-13 14:19:26 420
原创 生成验证码图片(三)
利用第三方库'''Created on 2017-7-19@author: XTing'''from io import BytesIOfrom captcha.audio import AudioCaptchafrom captcha.image import ImageCaptchafrom PIL import Imageimport numpy as npimport mat
2017-08-13 14:13:27 432
原创 生成验证码图片(二)
带图片颜色'''@author: XTing'''from PIL import Image, ImageDraw, ImageFont, ImageFilterimport random# 随机字母:def rndChar(): return chr(random.randint(65, 90))# 随机颜色1:def rndColor(): return (rando
2017-08-13 14:09:48 303
原创 生成验证码图片(一)
代码#_*_coding:utf-8_*_from PIL import Image,ImageDraw,ImageFont,ImageFilterimport randomimport math, string#字体的位置,不同版本的系统会有不同font_path = 'C:\Windows\winsxs\amd64_microsoft-windows-font-truetype-arial
2017-08-13 14:05:41 478
原创 Python List 练习实践(二)
List 存取数字代码Product_List = [("Apple", 5800), ("Bike", 800), ("Python", 80), ("Mac", 12000), ("NoteBook", 10)] # 使用了元组Current_List = []salary = input("Your salary: ")if salary.isdigit(): salary =
2017-08-11 22:45:01 380
原创 Python List 练习实践(一)
List 存取数字代码:# 最好使用元组tuple,不能改变信息Product_List = [["Iphone", 5800], ["Bike", 800], ["Python", 80], ["Mac", 12000], ["Starbucks", 10]]tmp_list = []current_pro = []cost = 0salary = int(input("Your sala
2017-08-11 22:40:33 601
原创 PyCharm快捷键
1、编辑(Editing)Ctrl + Space 基本的代码完成(类、方法、属性) Ctrl + Alt + Space 类名完成 Ctrl + Shift + Enter 语句完成 Ctrl + P 参数信息(在方法中调用参数) Ctrl + Q 快速查看文档 Shift + F1 外部文档 Ctrl + 鼠标 简介 Ctrl + F1 显示错误描述或警告信息 Alt + Ins
2017-08-11 12:56:51 1563
原创 Loaded runtime CuDNN library: 5005和 Check failed: stream->parent()->GetConvolveAlgorithms问题
系统环境win10系统Cuda8.0cudnn5.0Tensorflow1.0.1 问题运行GPU版本的tensorflow时老是报错: Loaded runtime CuDNN library: 5005 (compatibility version 5000) but source wascompiled with 5110 (compatibility version 51
2017-08-10 17:18:17 641
Qt qt-opensource-windows-x86-5.11.0安装包
2022-05-04
Qt拖动图像坐标点的Demo
2019-04-29
Adaboost训练轴叉缺陷检测
2019-04-11
级联训练车牌-part5
2019-04-11
级联训练车牌-part4
2019-04-11
级联训练车牌-part3
2019-04-11
级联训练车牌-part2
2019-04-11
级联训练车牌-part1
2019-04-11
深度学习图像标注工具安装版
2019-03-17
Qt C++版深度学习图像标注工具发布包,支持目标定位、图像分割,四点、多点标注
2019-03-17
新的手写AndroidTensorFlowMNISTExample-master.rar
2017-10-20
TensorFlowMnist-master.zip
2017-10-20
c#Aforge录像的Lib
2017-10-14
Python购物流程ATM
2017-09-24
cudnn-8.0-windows7-x64-v5.1.zip
2017-08-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人