![](https://img-blog.csdnimg.cn/2019101915531254.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Python
文章平均质量分 54
机器视觉001
熟悉Visual C++、HALCON、机器视觉;10 年开发经验!
展开
-
“unzip”不是内部或外部命令,也不是可运行的程序或批处理文件
“unzip”不是内部或外部命令,也不是可运行的程序或批处理文件1. 错误描述'unzip '不是内部或外部命令,也不是可运行的程序或批处理文件。2. 错误分析在jupyter notebook使用!unzip遇到了这个问题,查到发现unzip是linux系统下,windows不自带。3. 解决方法去unzip官网(Info-ZIP's UnZip;UnZip for Windows)下载:先选择Binaries; 再下载ZIP; 最后将下载下来的unzip.ex原创 2022-04-07 22:10:52 · 59801 阅读 · 1 评论 -
“wget”不是内部或外部命令,也不是可运行的程序或批处理文件
“wget”不是内部或外部命令,也不是可运行的程序或批处理文件1. 错误描述'wget'不是内部或外部命令,也不是可运行的程序或批处理文件。2. 错误分析在jupyter notebook使用!wget遇到了这个问题,查到发现wget是linux系统下,windows不自带。3. 解决方法去wget官网(GNU Wget 1.21.3 for Windows)下载:先选择32位/64位; 再下载ZIP/EXE; 最后将下载下来的EXE文件放到C:\Windows\Sy原创 2022-04-07 22:09:46 · 14493 阅读 · 0 评论 -
pip 安装GDAL
1. pip 安装GDAL1.1 错误描述在cmd窗口中直接使用pip安装gdal会报错。pip install gdal错误原因:GDAL不是纯净的python库,无法使用pip install requests这样的方法安装库文件。1.2 解决办法根据python版本,下载对应的GDAL安装文件。GDAL官网:https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal。下载完毕后,使用下述命令即可完成安装。pip i.原创 2022-04-06 21:40:25 · 3536 阅读 · 1 评论 -
Python: 如何将py文件转成exe文件?
Python: 如何将py文件转成exe文件?1.安装PyInstaller模块pip install PyInstaller2.将py文件打包成exe执行文件找到需要打包的py文件所在路径,在地址栏键入cmd,打开命令窗口后输入pyinstaller -F 文件名.py回车执行,等待执行完毕后会创建三个文件夹,其中都一个为 dist 文件夹,exe文件就在此文件夹中。双击exe文件就可正常执行~~~...原创 2021-11-18 21:31:54 · 3836 阅读 · 0 评论 -
Python:PDF文件转图像
Python:PDF文件转图像什么是PyMuPDF?Python环境下想要将PDF文件转图像,可以使用PyMuPDF库。PyMuPDF是MuPDF的Python绑定-“轻量级PDF和XPS查看器”。MuPDF可以访问PDF,XPS,OpenXPS,CBZ(漫画书档案),FB2和EPUB(电子书)格式的文件,也可以是扩展名为.pdf,.xps,.oxps,.cbz,.fb2 或.epub的文件(因此您可以使用Python开发电子书查看器……),因此它不仅仅可以解析PDF文件。支持的操作系统原创 2021-11-18 21:24:05 · 1257 阅读 · 0 评论 -
Ubuntu下增加Python的PATH环境变量
Ubuntu下增加Python的PATH环境变量1. Ubuntu专有方式编辑 /etc/ld.so.conf 文件,如果以下语句不存在,则加入:include /etc/ld.so.conf.d/*.conf然后在/etc/ld.so.conf.d下边新建一个以 .conf 结尾的文件。在新建的 .conf 文件中写入需要设置的 path,例如:~/mypath/bin2. 用户目录下的 .bashrc 文件在用户主目录下,有一个 .bashrc 文件,编辑该文件:$s原创 2021-09-23 21:26:45 · 6191 阅读 · 0 评论 -
Python:__all__变量用法
当我们向文件导入某个模块时,导入的是该模块中那些名称不以下划线(单下划线“_”或者双下划线“__”)开头的变量、函数和类。因此,如果我们不想模块文件中的某个成员被引入到其它文件中使用,可以在其名称前添加下划线。...转载 2021-06-14 21:06:57 · 152 阅读 · 0 评论 -
Python编译、运行、反编译pyc文件
Python 并非完全是解释性语言,它也存在编译。先将源码文件 *.py 编译为 *.pyc,然后由 Python 的虚拟机执行。相对于 *.py 文件来说,编译为 *.pyc本质上和 *.py 没有太大区别,只是提高了模块的加载速度,并没有提高代码的执行速度。...原创 2021-06-13 23:31:26 · 791 阅读 · 0 评论 -
matplotlib: 有关 Backend 的说明
matplotlib: 有关 Backend 的说明什么是Backend?Matplotlib针对许多不同的用例和输出格式。有些人在python shell中交互式地使用Matplotlib,并在键入命令时弹出绘图窗口。有些人使用木星笔记本,绘制内联图来快速分析数据。还有一些人将Matplotlib嵌入到图形用户界面中,如PyQt或PyGObject,以构建丰富的应用程序。有些人在批处理脚本中使用Matplotlib从数值模拟中生成postscript图像,还有一些人运行web应用程原创 2021-03-27 22:59:47 · 2837 阅读 · 0 评论 -
PyTorch: TORCHVISION.TRANSFORMS
PyTorch: TORCHVISION.TRANSFORMS变换是常见的图像变换。可以使用Compose将它们链接在一起。此外,还有torchvision.transforms.functional模块。函数转换提供对转换的细粒度控制。如果你需要构建一个更复杂的转换管道(例如,在分割任务的情况下),这非常有用。所有的转换都接受PIL图像,张量图像或批张量图像作为输入。张量图像是一个具有(C, H, W)形状的张量,其中C是一些通道,H和W是图像的高度和宽度。Batch of Tens.原创 2021-03-14 23:53:57 · 791 阅读 · 0 评论 -
Python: 从PYTORCH导出模型到ONNX,并使用ONNX运行时运行它
Python: 从PYTORCH导出模型到ONNX,并使用ONNX运行时运行它本教程我们将描述如何将PyTorch中定义的模型转换为ONNX格式,然后使用ONNX运行时运行它。ONNX运行时是一个针对ONNX模型的性能关注引擎,它可以高效地跨多个平台和硬件(Windows、Linux和Mac以及cpu和gpu)进行推理。ONNX运行时已被证明在多个模型上显著提高了性能。对于本教程,您将需要安装ONNX和ONNX运行时。您可以使用pip install ONNX onnxruntime获得ONNX原创 2021-03-14 10:46:21 · 15622 阅读 · 1 评论 -
Python: 如何安装 torch 对应的 torchvision 版本?
Python: 如何安装 torch 对应的 torchvision 版本?参考链接:https://pytorch.org/get-started/locally/选择合适的版本:运行命令:pip install torch===1.7.1 torchvision===0.8.2 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html即可安装 torch 对应的 torchvision 版本原创 2021-01-28 22:22:39 · 12304 阅读 · 0 评论 -
Python: TensorFlow2.4与CUDA11.1缺失 ‘cusolver64_10.dll‘动态库
Python: TensorFlow2.4与CUDA11.1缺失 ‘cusolver64_10.dll‘动态库错误提示:Could not load dynamic library ‘cusolver64_10.dll’; dlerror: cusolver64_10.dll not found解决办法:从百度文库下载:百度网盘:https://pan.baidu.com/s/1N_GZHBLkPjnk4DP1MR_u1Q提取码:msa2下载完毕后:win10 下将cus原创 2020-12-18 21:34:26 · 1130 阅读 · 0 评论 -
Python: 更改Jupyter Notebook默认工作路径?
Python: 更改Jupyter Notebook默认工作路径?每次打开Jupyter Notebook时,在弹出的浏览器界面上是系统默认的文件位置(工作路径, "C:\Windows\System32")。如果我们想保存写好的Python文件到自己想要的位置时将会非常的不方便,那么该如何修改Jupyter Notebook默认的工作路径呢?1. 在cmd命令窗口中输入命令使Jupyter产生配置文件:jupyter_notebook_config.py。jupyter notebook原创 2020-12-10 22:49:52 · 557 阅读 · 0 评论 -
Python: 除matplotlib外还有哪些数据可视化库?
Python: 除matplotlib外还有哪些数据可视化库?matplotlib算是python比较底层的可视化库,可定制性强、图表资源丰富、简单易用、达到出版质量级别。其它的可视化库诸如:seaborn:https://pypi.org/project/seaborn/pyecharts:https://pypi.org/project/pyecharts/#filespyecharts:https://pypi.org/project/pyecharts35/ggplot:ht原创 2020-12-09 22:23:09 · 348 阅读 · 0 评论 -
Python: 函数参数传递机制
Python: 函数参数传递机制Python函数参数由实参传递给形参的过程,是由参数传递机制来控制的,根据实际参数类型不同,函数参数传递方式分为值传递和引用传递(又称为地址传递)。值传递机制所谓值传递,实际上就是将实际参数值的副本(复制品)传入函数,而参数本身不会受到任何影响。值传递的实质:当系统开始执行函数时,系统对形参执行初始化,就是把实参变量的值赋给函数的形参变量,在函数中操作的并不是实际的实参变量。引用传递如果实际参数的数据类型是可变对象(列表、字典),则函数参数的传递方式将原创 2020-12-09 09:51:12 · 641 阅读 · 0 评论 -
Python: PyCharm中导入matplotlib时报错:“Backend Qt5Agg is interactive backend”的解决方案
Python: PyCharm中导入matplotlib时报错:“Backend Qt5Agg is interactive backend”的解决方案在使用PyCharm时,在PyCharm的Python Console中import matplotlib.pyplot as plt时,会出现:Backend Qt5Agg is interactive backend. Turning interactive mode on.或者其他跟Qt5Agg相关的错误,导致程序中断。虽然现在还不得而.原创 2020-12-07 14:44:52 · 4063 阅读 · 0 评论 -
Python: PIL基本代码
Python: PIL基本代码# 声明使用字符库# -*- coding: utf-8 -*-# 导入系统库import os# 导入文件读写库import io# 导入数学库import math# 导入 PIL 图像库(The Image Module)from PIL import Image# 导入 PIL 图像通道运算库(The ImageChops Module)from PIL import ImageChops# 导入 PIL 图像绘制库(The ImageDr原创 2020-12-05 09:52:04 · 972 阅读 · 0 评论 -
Python+OpenCV:OpenCV-Python绑定是如何工作的?
Python+OpenCV:OpenCV-Python绑定是如何工作的?目标How OpenCV-Python bindings are generated?How to extend new OpenCV modules to Python?How OpenCV-Python bindings are generated?In OpenCV, all algorithms are implemented in C++. But these algorithms can be used f原创 2020-12-03 10:53:51 · 351 阅读 · 0 评论 -
Python+OpenCV:训练级联分类器(Cascade Classifier Training)
Python+OpenCV:训练级联分类器(Cascade Classifier Training)IntroductionWorking with a boosted cascade of weak classifiers includes two major stages: the training and the detection stage.The detection stage using either HAAR or LBP based models, is described i原创 2020-12-03 10:31:46 · 1572 阅读 · 0 评论 -
Python+OpenCV:级联分类器(Cascade Classifier)
Python+OpenCV:级联分类器(Cascade Classifier)目标We will learn how the Haar cascade object detection works. We will see the basics of face detection and eye detection using the Haar Feature-based Cascade Classifiers. We will use thecv::CascadeClassifiercla..原创 2020-12-03 09:38:42 · 1808 阅读 · 0 评论 -
Python+OpenCV:高动态范围(High Dynamic Range, HDR)
Python+OpenCV:高动态范围(High Dynamic Range, HDR)目标Learn how to generate and display HDR image from an exposure sequence. Use exposure fusion to merge an exposure sequence.理论High-dynamic-range imaging (HDRI or HDR) is a technique used in imaging and pho原创 2020-12-02 22:18:29 · 2346 阅读 · 0 评论 -
Python+OpenCV:图像修复(Image Inpainting)
Python+OpenCV:图像修复(Image Inpainting)理论Most of you will have some old degraded photos at your home with some black spots, some strokes etc on it. Have you ever thought of restoring it back?We can't simply erase them in a paint tool because it is will原创 2020-12-02 09:48:52 · 2645 阅读 · 0 评论 -
Python+OpenCV:图像去噪(Image Denoising)
Python+OpenCV:图像去噪(Image Denoising)理论We have seen many image smoothing techniques like Gaussian Blurring, Median Blurring etc and they were good to some extent in removing small quantities of noise.In those techniques, we took a small neighbourhood a原创 2020-12-01 23:56:28 · 4248 阅读 · 0 评论 -
Python+OpenCV:K-Means聚类
Python+OpenCV:K-Means聚类目标Learn to usecv.kmeans()function in OpenCV for data clustering.理解参数输入参数:samples: It should be ofnp.float32data type, and each feature should be put in a single column. nclusters(K): Number of clusters required at end...原创 2020-12-01 17:07:44 · 603 阅读 · 0 评论 -
Python+OpenCV:理解K-Means聚类(K-Means Clustering)
Python+OpenCV:理解K-Means聚类(K-Means Clustering)理论We will deal this with an example which is commonly used.T-shirt size problemConsider a company, which is going to release a new model of T-shirt to market. Obviously they will have to manufacture mode原创 2020-12-01 15:59:08 · 610 阅读 · 0 评论 -
Python+OpenCV:基于SVM手写数据OCR(OCR of Hand-written Data using SVM)
Python+OpenCV:基于SVM手写数据OCR(OCR of Hand-written Data using SVM)dsize = 20affine_flags = lmc_cv.WARP_INVERSE_MAP | lmc_cv.INTER_LINEARbin_number = 16####################################################################################################原创 2020-12-01 15:41:31 · 346 阅读 · 0 评论 -
Python+OpenCV:理解支持向量机(SVM)
Python+OpenCV:理解支持向量机(SVM)理论线性可分数据(Linearly Separable Data)Consider the image below which has two types of data, red and blue.In kNN, for a test data, we used to measure its distance to all the training samples and take the one with minimum distanc原创 2020-12-01 14:33:38 · 453 阅读 · 0 评论 -
Python+OpenCV:基于KNN手写数据OCR(OCR of Hand-written Data using kNN)
Python+OpenCV:基于KNN手写数据OCR(OCR of Hand-written Data using kNN)OCR of Hand-written Digits##################################################################################################### 基于KNN手写数据OCR(OCR of Hand-written Data using kNN)def lmc_cv_原创 2020-11-30 11:31:05 · 353 阅读 · 0 评论 -
Python+OpenCV:理解k近邻(kNN)算法(k-Nearest Neighbour (kNN) algorithm)
Python+OpenCV:理解k近邻(kNN)算法(k-Nearest Neighbour (kNN) algorithm)理论kNN is one of the simplest classification algorithms available for supervised learning.The idea is to search for the closest match(es) of the test data in the feature space.We will lo原创 2020-11-30 10:39:56 · 719 阅读 · 0 评论 -
Python+OpenCV:立体图像深度图(Depth Map from Stereo Images)
Python+OpenCV:立体图像深度图(Depth Map from Stereo Images)理论If we have two images of same scene, we can get depth information from that in an intuitive way.Below is an image and some simple mathematical formulas which prove that intuition.The above diag原创 2020-11-27 20:15:40 · 2958 阅读 · 0 评论 -
Python+OpenCV:对极几何(Epipolar Geometry)
Python+OpenCV:对极几何(Epipolar Geometry)理论When we take an image using pin-hole camera, we loose an important information, ie depth of the image.Or how far is each point in the image from the camera because it is a 3D-to-2D conversion.So it is an impor原创 2020-11-27 16:57:04 · 1992 阅读 · 0 评论 -
Python+OpenCV:姿态估计(Pose Estimation)
Python+OpenCV:姿态估计(Pose Estimation)##################################################################################################### 姿态估计(Pose Estimation)def lmc_cv_pose_estimation(method): """ 函数功能: 姿态估计(Pose Estimation)。 """原创 2020-11-27 15:48:58 · 2138 阅读 · 0 评论 -
Python+OpenCV:摄像机标定(Camera Calibration)
Python+OpenCV:摄像机标定(Camera Calibration)理论Some pinhole cameras introduce significant distortion to images. Two major kinds of distortion are radial distortion (径向畸变)and tangential distortion (切向畸变).Radial distortion causes straight lines to appear cu.原创 2020-11-26 21:57:39 · 4453 阅读 · 0 评论 -
Python+OpenCV:Optical Flow(光流)
Python+OpenCV:Optical Flow(光流)理论Optical flow is the pattern of apparent motion of image objects between two consecutive frames caused by the movement of object or camera.It is 2D vector field where each vector is a displacement vector showing the mov原创 2020-11-26 20:56:00 · 2780 阅读 · 0 评论 -
Python+OpenCV:Meanshift and Camshift
Python+OpenCV:Meanshift and CamshiftMeanshiftConsider you have a set of points. (It can be a pixel distribution like histogram backprojection).You are given a small window (may be a circle) and you have to move that window to the area of maximum pixe原创 2020-11-26 18:57:31 · 392 阅读 · 0 评论 -
Python+OpenCV:How to Use Background Subtraction Methods
Python+OpenCV:How to Use Background Subtraction MethodsBackground subtraction (BS) is a common and widely used technique for generating a foreground mask (namely, a binary image containing the pixels belonging to moving objects in the scene) by using sta原创 2020-11-26 08:01:45 · 464 阅读 · 0 评论 -
Python+OpenCV:Feature Matching + Homography to find Objects
Python+OpenCV:Feature Matching + Homography to find Objects##################################################################################################### 图像特征匹配(Feature Matching with Homography)def lmc_cv_image_feature_matching_homography():原创 2020-11-25 23:45:18 · 368 阅读 · 0 评论 -
Python+OpenCV:特征匹配(Feature Matching)
Python+OpenCV:特征匹配(Feature Matching)Basics of Brute-Force MatcherBrute-Force matcher is simple. It takes the descriptor of one feature in first set and is matched with all other features in second set using some distance calculation. And the closest on原创 2020-11-25 23:33:34 · 1891 阅读 · 0 评论 -
Python+OpenCV:ORB: An efficient alternative to SIFT or SURF
Python+OpenCV:ORB: An efficient alternative to SIFT or SURF理论As an OpenCV enthusiast, the most important thing about the ORB is that it came from "OpenCV Labs".This algorithm was brought up by Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary R. B原创 2020-11-25 22:50:35 · 330 阅读 · 0 评论