- 博客(100)
- 收藏
- 关注
原创 Win10系统下编译FFmpeg
1、使用git下载源码git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg2、FFmpeg在windows平台编译需要使用MinGW-w64来编译,单独使用MinGW-w64比较麻烦,推荐使用MSYS2来编译,下载地址:MSYS23、下载MSYS2后,点击exe,直接安装,如下:4、安装完MSYS2后,自动运行 或者在"开始"菜单栏中,选择“MSYS2 MSYS”软件,点击运行,运行窗口如下:5、在MSYS2中更新基础依.
2022-05-20 18:37:43
1566
原创 Ubuntu20.04下载安装FFmpeg源码,并且编译FFmpeg
一、Terminal终端输入:git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg二、安装依赖环境:sudo apt-get install -y autoconf automake build-essential git libass-dev libfreetype6-dev libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev l
2022-05-13 02:55:24
2528
原创 C++获取系统当前时间
方法一 、调用time.h#include <time.h>time_t t_now;struct tm pt;time(&t_now);//tm *pt = localtime(&t);localtime_s(&pt,&t_now);int year = pt.tm_year + 1900;int month = pt.tm_mon + 1;int day = pt.tm_mday;int hour = pt.tm_hour;in
2021-10-26 09:46:29
441
原创 用python来控制wifi连接
1、python连接WiFi,需要使用pywifi包,安装pywifi:pip install pywifi2、判断wifi连接状态:def wifi_connect_status(): wifi = pywifi.PyWiFi() iface = wifi.interfaces()[0] #acquire the first Wlan card,maybe not if iface.status() in [const.IFACE_CONNECTED,const.IFA
2021-09-02 18:03:21
10925
9
原创 U盘被分割多个区,恢复操作
在做U盘系统启动盘时,通常会被分割成多个区,想恢复U盘该怎么操作呢?1、win+R,输入:diskpart2、在命令框中输入:list disk,来查看所有硬盘,如下:3、我是64G的U盘,该磁盘1为我的U盘,选择对应的U盘,输入:select disk 14、目前操作的是自己的U盘,输入:clean5、按Win+X,在磁盘管理器中,可以看到未分配的磁盘就剩一个了,重新新建卷,分配盘符就可以了6、在我的电脑中查看我的U盘,就完全恢复了。...
2021-08-23 14:29:20
10542
5
原创 Ubuntu系统安装Cmake
Cmake安装有两种方式:1、指令安装,sudo apt install cmake注意这种安装方式,可能不是最新版本的Cmake2、Cmake源码安装
2021-06-09 15:53:57
1601
原创 Python构建TCP来传输图片
python构建TCP的Client和Server来实现图片传输:Client:# -*- coding=utf-8 -*-import socketimport osimport sysimport structdef socket_client(): try: client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(('172.16.1.102',
2021-02-04 20:09:25
1014
5
原创 C++字符串转16进制
在串口通讯中,时常涉及到16进制字符串发送,需要将字符串转为16进制。Example:string str = "07 0a 02 10 03 00 00 00 00 00"#include <stdio.h>#include <stdlib.h>#include <string.h>int char2bits(char ch){ int bits = 0; if (ch >= 'a' && ch <= '.
2020-12-20 00:50:14
7285
3
原创 VS2015配置halcon
VS2015编辑器配置Halcon环境,步骤如下:1、打开项目属性编辑,VC++目录处,修改两项:包含目录添加:C:\Program Files\MVTec\HALCON-18.11-Steady\include; C:\Program Files\MVTec\HALCON-18.11-Steady\include\halconcpp库目录下添加:C:\Program Files\MVTec\HALCON-18.11-Steady\lib\x6...
2020-12-06 23:54:25
958
原创 Qt报错This application failed to start because it could not find or load the Qt platform plugin “windo
Qt运行时报错:This application failed to start because it could not find or load the Qt platform plugin "windows"Reinstalling the application may fix this problem.解决办法:QT为了简化生成发布版本,特别提供了工具 "windeployqt.exe",这个工具在 "...\Qt5.8.0\5.8\msvc2015_64\bin"的目录下,通过该
2020-11-10 17:19:56
8189
3
原创 Windows系统下,pip切换镜像源
1、在C:\Users\xx下新建一个文件夹pip;2、在pip文件夹中建立pip.ini文件,并用记事本打开输入:[global] index-url=http://mirrors.aliyun.com/pypi/simple/ [install] trusted-host=mirrors.aliyun.com
2020-09-08 15:12:44
367
原创 PyQt读取视频并播放
import osimport sysfrom PyQt5 import QtGui,QtWidgets,QtCorefrom PyQt5.QtGui import *from PyQt5.QtWidgets import *from PyQt5.QtCore import *from PyQt5.uic import loadUiimport cv2class my_software(QMainWindow): def __init__(self,parent = None.
2020-08-20 01:18:05
3931
6
原创 PyQt加载显示图片
import osimport sysfrom PyQt5 import QtGui,QtWidgets,QtCorefrom PyQt5.QtGui import *from PyQt5.QtWidgets import *from PyQt5.QtCore import *import testimport cv2#初始化界面def Initial_GUI(): ui.lb_Screen.setFixedSize(ui.lb_Screen.width(),ui.lb.
2020-08-19 17:56:30
3497
原创 PyQt在windows10系统下编写软件
1、安装PyQt5:pip install PyQt5,在搜索框中,出现图片所示,即为安装成功:2、安装Qt Designer:pip install pyqt5-tools,在cmd中输入pyuic5,返回“Error:one input ui-file must be specified”,说明安装成功。3、在Qt Designer中绘制GUI,并保存为test.ui4、在保存文件夹中,用powershell运行:pyuic5 - o test.py test.ui,生成test.p
2020-08-17 15:50:36
365
原创 Opencv做形状匹配
#include <iostream>#include <vector>//Opencv库#include <opencv.hpp>void findcontours(cv::Mat &image,std::vector<std::vector<cv::Point>> &contours){ cv::Mat gray,binary; std::vector<cv::Vec4i> hiera.
2020-08-11 17:02:13
1059
原创 python使用pyplot画图
import numpy as np import matplotlib.pyplot as plt#设置画布大小plt.figure(figsize= (10,5))#设定画的titleplt.title("miaojingkang",fontsize = 20)#设定x,y轴的labelplt.xlabel('x_Miao',fontsize = 15)plt.ylabel('y_Miao',fontsize = 15)#画图plt.plot(list(range(5)),.
2020-08-05 15:56:04
560
原创 C++做UDP 客户端通讯
#include <QCoreApplication>#include <main.h>#include <iostream>#include <WinSock2.h>#pragma comment(lib, "ws2_32.lib")int main(int argc, char *argv[]){ WSAData wsd; //初始化信息 SOCKET udpSocket; //UDP的SOC.
2020-07-20 20:16:05
469
原创 Linux系统下安装python和pip
一、安装python1、下载python,地址:下载安装包:https://www.python.org/ftp/python2、安装python解压tgz文件,在命令端输入:./configure --prefix=/usr/local/python36make && make install二、安装pipsudo apt-get install python3-pipsudo pip3 install --upgrade pip切换pip源根目
2020-06-12 22:47:52
389
原创 深度学习:Tensorflow模型持久化
Tensorflow训练的模型,常常需要保存下来,便于调用,有两种方式保存:ckpt和pb1、保存为ckpt模型,代码为:import tensorflow as tfv1 = tf.Variable(tf.constant(1.0,shape = [1],name = "v1"))v2 = tf.Variable(tf.constant(2.0,shape = [1],name = "v2"))result = v1 +v2init_op = tf.global_variables
2020-05-18 15:53:03
340
原创 python实现txt文件批量格式互转
import osimport codecs #txt文件所在目录path = 'D:/file/' for root,dirs,files in os.walk(path):#for files in os.walk(path): for name in files: #本代码中,原文件的编码必须是UCS-2 Little Endian 要不然读出来是乱码 eachFile= codecs.open(path + name,'r','utf-16-l.
2020-05-14 00:50:57
1225
原创 深度学习之用TensorBoard查看ckpt和pb图结构
一、查看ckpt图结构1、在ckpt文件所在文件夹中新建check_ckpt.py文件,代码如下import tensorflow as tffrom tensorflow.summary import FileWritersess = tf.Session()tf.train.import_meta_graph("./model.ckpt.meta")FileWriter("__tb", sess.graph)2、运行check_ckpt.py,生成__tb文件夹3、在__tb
2020-05-12 11:11:20
3536
1
原创 python IDLE 设置清屏快捷方式
1、在python安装文件夹Lib中找到idlelib文件夹;2、在此文件夹中新建CleanWindow.py文件,并输入以下代码:class ClearWindow: menudefs = [ ('options', [None, ('Clear Shell Window', '<<clear-window>...
2020-05-07 20:22:26
453
原创 python opencv报错解决
import cv2 as cvimg = cv.imread("test.jpg")cv.imshow("test",img)cv.waitKey(10000)报错1:module cv2 has no ‘imread’ member原因:VSCode插件检测不到模块, 因为cv2模块下还有cv2模块。解决办法:此段代码运行是没有问题的,但是VSCode会有红色波浪线提示,...
2020-05-07 20:12:23
21894
1
原创 Tensorflow保存和读入pb文件
tensorflow保存pb文件import tensorflow as tfimport osfrom tensorflow.python.framework import graph_util#消除警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2...
2020-04-30 00:58:23
1280
原创 深度学习:3_手写一个单层的神经网络
# *******************************# 手写一个单隐层的神经网络# Author: Miao# 思路:# 1、定义网络结构(指定输出层、隐藏层、输出层的大小)# 2、初始化模型参数# 3、循环操作:执行前向传播/计算损失/执行后向传播/权值更新# *******************************import numpy as npi...
2020-03-18 23:01:50
370
原创 工作小技能:微信双开
生活中,很多小伙伴有两个,甚至多个微信账号,工作时,需要同时登录接收消息,但PC端的微信客户端,只允许打开一个客户端,此时怎么办呢?方法来了:1、在硬盘中,新建生成一个.txt文件;2、用记事本打开,写下:start F:\WeChat\install\WeChat\WeChat.exestart F:\WeChat\install\WeChat\WeChat.ex...
2020-03-15 17:56:53
233
原创 深度学习:1_常用的数据增强 Data Augmentation
深度学习中,通常需要对数据进行增强处理 Data Augmentaion,再训练数据。常用的数据增强方法有1、翻转变换 flip(左右/上下)2、随机修剪 random crop3、色彩抖动 color jittering4、平移变换 shift5、尺度变换 scale6、对比度变换 contrast7、噪声扰动 noise8、旋转变换/反射变换 Rotation/...
2020-02-25 22:56:17
1607
原创 OpenCV:13_最大值最小值滤波 MaxMin Filter
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...
2020-02-24 00:27:05
3512
原创 OpenCV:11_均值滤波 Mean Filter
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...
2020-02-23 23:58:06
721
原创 OpenCV:9_高斯滤波Gauss Filter
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...
2020-02-23 17:38:30
457
原创 OpenCV:10_中值滤波 Median Filter
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...
2020-02-21 20:52:35
1157
原创 Halcon_缺陷检测_FFT
calculate_lines_gauss_parameters (20, [18,5], Sigma, Low, High)rft_generic (ImageReduced2, ImageFFT, 'to_freq', 'none', 'complex', Width)gen_gauss_filter (ImageGauss, 150, 150, 0, 'n', 'rft', Widt...
2020-01-19 22:00:18
782
原创 数据结构:1_链表_链表删除
代码复现list->delete()函数:#include <iostream>#include <list>/***********************************/ /* 1、如果插入位置不合理,抛出异常 /* 2、从最后一个元素开始向前遍历到第i个位置,分别将它们都向前移动一个位置 /* 3、将要插入的元素填入位置i处 * ...
2019-12-20 23:35:13
291
原创 数据结构:1_链表_链表插入
代码复现list->insert()函数#include <iostream>#include <list>/***********************************/ /* 1、如果插入位置不合理,抛出异常 /* 2、如果线性表长度大于等于数组长度,则抛出异常或动态增加数组容量 /* 3、从最后一个元素开始向前遍历到第i个位置,分别将...
2019-12-20 23:11:48
287
原创 OpenCV:7_平均池化 Average Pooling
#include <QCoreApplication>#include <iostream>#include <fstream>#include <opencv.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>...
2019-12-19 15:15:49
1322
原创 Halcon-MLP分类
步骤:1、创建分类器create_class_mlp()2、获取各个类别的特征向量 gen_features()3、将各个类别训练样本的特征向量添加到分类器中 add_sample_class()4、训练模型,生成gmc文件 train_class_mlp(),write_class_mlp()5、获取待分类图像的特征向量6、通过分类器计算特征向量的类 class...
2019-12-18 10:07:52
3130
1
原创 Python—更改文件的名字
import osraw_dir = "D:/1/"new_dir = "D:/2/"i = 0for file in os.listdir(raw_dir): old_name = os.path.join(raw_dir,file) new_name = new_dir + str(i) + ".bmp" os.rename(old_name,new_n...
2019-12-01 20:31:41
666
原创 数据结构的可视化
1. 可视化数据结构:http://www.cs.usfca.edu/~galles/visualization/Algorithms.html2. C++实现的各种算法演示:http://people.cs.pitt.edu/~kirk/cs1501/animations/3. 很酷的各种排序演示:http://sorting.at/4. 很有创意的排序比较(匈牙利 Sapient...
2019-11-21 19:42:15
481
原创 Math函数
1、fmod(double x, double y):返回x除以y的余数;2、pow(x,y):返回x的y次幂;3、ceil(double x):返回大于或等于x的最小的整数值4、floor(double x):返回小于或等于x的最大的整数值5、sqrt(double x):返回x的平方根6、fabs(double x):返回x的绝对值7、exp(double x): e的...
2019-11-19 01:56:04
247
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人