自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(41)
  • 资源 (6)
  • 收藏
  • 关注

原创 用vite构建vue3应该注意的点

试试vite加vue3

2022-04-13 10:59:05 1343

原创 逻辑练习(求180拥有的质数

逻辑题

2022-02-18 15:02:42 154

原创 vue渲染未知层级的单一结构列表

数据: listData: [ { title: "hahah", content: "hahahahah", children: [{ title: "hahah", content: "hahahahah" }] }, { title: "hahah", content: "hahahahah", children: [

2021-03-17 09:06:09 394

原创 问题记录

1.let const var 的区别var 作用域为全局 只有在函数中表现为局部let const 作用域于{}内let 是变量可修改 const 常量不可修改2.jq链式调用原理猜测:回调原理将dom对象重新返回出来?,或者是类似promise的回调写法?3说明promise是什么?一个promise有几种状态?promise解决异步问题,和请求过程中可能出现的回调嵌套。状态?成功返回结果并调用回调函数,捕获错误并调用回调函数,无论是否成功返回结果最终执行finally回调4.calc

2021-03-09 11:51:24 697

原创 js+css3的卡牌抽奖特效动画

项目结构:index.html<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Lucky draw</title> <link rel="style

2021-03-05 14:58:16 2331

原创 父元素transform对子元素绝对定位的影响

<div style="transform: rotate(0);width: 20px;height: 20px;background-color: red;"> <div style="position: absolute;left: 0;top: 0;width: 5px;height: 5px;background-color: yellow;"></div> </div>由上述代码可知子元素添加position:a...

2021-02-24 08:51:15 3602

原创 python-opencv 图像金字塔

import cv2 as cvimport numpy as npimg = cv.imread('./shangyi.jpg',cv.IMREAD_COLOR)#高斯金字塔#pyrDown利用高斯模糊降低图片分辨率,原图分辨率的1/2#取原图5个像素点进行高斯加权平均,得到新的像素点,将新的像素点排列成新的图像,图像分辨率下降lower = cv.pyrDown(img)lower1 = cv.pyrDown(lower)#pyrUp利用高斯模糊扩展图片分辨率,原图分辨率*2#

2021-02-22 16:37:17 3357

原创 python-opencv 图像梯度及边缘检测

只探讨函数使用方法,不涉及原理import cv2 as cv import numpy as np img = cv.imread('./shangyi.jpg',cv.IMREAD_GRAYSCALE)#Sobel算子 => 抗噪 ksize很小时可能会出现边缘定位精度不足#注意:输出数据类型ddepth为cv.CV_8U或np.uint8时,#白色到黑色的过渡边缘会因负斜率而丢失#ddepth:图像深度 -1代表与输入的原图相同#ksize:内核大小,值为正奇数#dx:

2021-02-22 09:04:30 3991

原创 python-opencv 形态学处理图像

形态学处理图像,其实就是以一定的结构元去改变原图,这里的结构元就是内核矩阵(0和1的矩阵)import cv2 as cv import numpy as np img = cv.imread("./shangyi.jpg",cv.IMREAD_GRAYSCALE)#侵蚀 (应用与灰度图)#在5*5的区域像素中有像素值不为1的,则这个区域全部像素为0#iterations=3表示进行3次侵蚀循环kernel = np.ones((5,5),np.uint8)erosion = cv.er

2021-02-01 11:48:00 5802

原创 python-opencv 图像平滑(模糊)

import cv2 as cv import numpy as npimg = cv.imread("./shangyi.jpg")#2D卷积kernel = np.ones((50,50),np.float32)/2500#卷积矩阵# src:原图像# ddepth:目标图像的深度,值为-1时默认与原图的深度一致.# kernel:卷积核(或相当于相关核),单通道浮点矩阵;如果要将不同的内核应用于不同的通道,请使用拆分将图像拆分为单独的颜色平面,然后单独处理它们.# anchor?:

2021-02-01 08:37:02 5130 1

原创 python-opencv利用阈值函数将灰度图二值化

import cv2 as cvimg = cv.imread('./shangyi.jpg',cv.IMREAD_COLOR)gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)#固定阈值 手动决定thresh大小#src:灰度图资源 thresh:阈值 maxval:像素最大值 type:像素值分配方式#将灰度图中的灰度值进行二值化变换,变换方式由type决定# eq:cv.THRESH_BINARY表示大于thresh的灰度值会转为maxval,小于thre

2021-01-28 17:12:22 8824

原创 python-opencv 图片的基本变换操作

import cv2 as cvimport numpy as npimg = cv.imread("./shangyi.jpg",cv.IMREAD_COLOR) #960*540 numpy.ndarray#截取像素区域print(img[1:,2:3,:])print(img[100,100,1])#获取像素点print(img.item(100,100,0))#获取图像分辨率print(img.shape) #(行,列,通道)#获取图像大小(像素个数)print(img.si

2021-01-27 10:50:49 7307

原创 python-opencv绘图功能及鼠标事件

import cv2 as cv import numpy as np #rgb转bgrdef rgb(r,g,b,a=None): if not a: bgr_tuple = (b,g,r) else: bgr_tuple = (b,g,r,a) return bgr_tuple#定义背景图片样式def defineCanvas(width,height,color): alpha = len(color) canvas

2021-01-22 15:54:55 8954

原创 python-opencv修改视频帧,并保存成新视频

import cv2 as cvimport numpycap = cv.VideoCapture('./shangyiv.mp4')fourcc = cv.VideoWriter_fourcc(*'mp4v')width = int(cap.get(3))height = int(cap.get(4))out = cv.VideoWriter('new.mp4',fourcc,60,(width,height)) #fps=60,这里是视频的帧率,可以随意调整,大小只影响每张图片的播

2021-01-21 15:23:39 11172

原创 python-opencv 播放本地视频

import cv2 as cvimport numpyclass VideoPlayer: class_name = 'Video' def __init__(self,video_path): self.path = video_path self.video = [] def getPath(self): return self.path def get_video_frame(self): c

2021-01-19 18:02:45 10487 2

原创 增加blog文章点击量(python)

import requests as reqimport threadingfrom bs4 import BeautifulSoupimport timeblog_url = 'https://blog.csdn.net/weixin_51364599' #博客所在地址is_proxy = True #是否开启代理user = '123456' #用户名password = '123456' #密码loop = 3 #循环次数proxy = {#代理设置 "http":"htt

2021-01-15 17:28:40 11884

原创 python 爬动态壁纸

这里爬的是网站对外的一个推广接口,里面的图片均可以访问到import requests as reqfrom bs4 import BeautifulSoupimport reimport os is_proxy = True #是否加载代理user = '123456' password = '123456'http = "http://{__user}:{__password}@10.191.131.43:3128".format(__user=user,__password=pa.

2021-01-13 10:17:49 11174

原创 利用新浪壁纸接口下载壁纸(python)

import requests as reqfrom bs4 import BeautifulSoupimport reimport os is_proxy = True #是否加载代理user = '123456' password = '123456'http = "http://{__user}:{__password}@10.191.131.43:3128".format(__user=user,__password=password)proxy = { "http":ht

2021-01-12 16:14:55 12932

原创 python中的类js定时器(setTimeout)

import threadingdef setTimeout(cbname,delay,*argments): threading.Timer(delay,cbname,argments).start()cbname:回调函数名 delay:延迟时间*argments:回调函数参数(不定参数)

2021-01-11 11:19:09 12899

原创 css3实现书本翻页效果

css3翻页效果关键要点:1.css3 3d动画的掌握2.如何解决翻转后页面内容的改变3.如何保持书本一直处于居中位置代码总览<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <tit

2020-12-22 17:25:38 13379

原创 canvas实现中国象棋(未判断绝杀)

中国象棋<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title></head><body> <h1 i

2020-12-07 09:30:52 12427

原创 利用canvas的getimageData和putimageData进行图像处理

canvas ImageData代码总览<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title></head><bo

2020-12-07 09:11:34 14017

原创 归并排序

merge sortfunction split(arr){ let spLenCount = Math.floor(arr.length/2) + (arr.length%2) let left = arr.splice(0,spLenCount) let right = arr if(left.length===1||right.length===1){ if(left.length===2&&right.length===1){

2020-12-07 08:59:55 12884

原创 希尔排序

shell sortfunction shellSort(sortList){//希尔排序 let drict = sortList.length do{ drict = Math.floor(drict/3)+1 for(let i = 0;i + drict<=sortList.length-1;i++){ if(sortList[i]>sortList[i+drict]){ swap(

2020-12-07 08:58:57 13113

原创 js用递归实现深拷贝

深拷贝判断要拷贝的对象类型(是简单类型还是复杂类型)function isComplexData (data) { if(data===null||data===undefined){ return false } let flag = data.constructor===Array||data.constructor===Object return flag}递归拷贝函数function deepCopy (data) { if

2020-10-28 09:17:14 13193

原创 canvas实现流星特效

控制透明度变化函数 function easeInQuad(curtime,begin,end,duration){ let x = curtime/duration; //x值 let y = x*x; //y值 return begin+(end-begin)*y; //套入最初的公式 } //用平方根构建的缓慢减速运动 核心函数:x*x + 2*x functi.

2020-10-14 08:25:35 13855

原创 缓动函数easeInout

easeIn函数 function easeInQuad(curtime,begin,end,duration){ let x = curtime/duration; //x值 let y = x*x; //y值 return begin+(end-begin)*y; //套入最初的公式 }参数: curtime 当前时间,,begin 开始的位置,,end 结束的位置,,duration 动画.

2020-10-12 08:30:52 15566

原创 斐波那契查找

Fibonacci Search1. 构建获取斐波那契数列值的一个函数function getFibonacciListValue (num) { if(num===0){ return 0 }else if(num===1){ return 1 }else{ return getFibonacciListValue(num-2) + getFibonacciListValue(num-1) }}let fib

2020-10-09 09:03:45 13060

原创 二分查找之进阶(插值查找)

Interpolation Search1. 二分查找即是折半查找,即把数据分成2份进行比较判断。(前提是有序列表)二分查找代码function bsearch (list,item) { //有序队列的二分查找 let lindex = 0 let hindex = list.length-1 let mid while (lindex<=hindex) { mid = Math.floor(lindex+(hindex-lindex)/

2020-10-08 08:47:40 12638

原创 如何用canvas实现五子棋

自己的游戏系列html部分<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title></head><body styl

2020-10-08 08:18:45 13166

原创 如何用canvas实现俄罗斯方块

我的游戏系列技术比较菜,用了要600多行代码完成,内容涉及完完全全只有canvas<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title>

2020-10-08 08:18:32 12765 1

原创 如何用js实现深拷贝

深拷贝deep copy判断数据类型(简单or复杂)递归循环调用复制函数得到结果function isComplexData (data) { if(data===null||data===undefined){ return false } let flag = data.constructor===Array||data.constructor===Object return flag}function deepCopy (data)

2020-10-07 14:28:56 11845

原创 在h5中用canvas实现网页画笔功能

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title></head><body style="margin-left:20

2020-10-07 14:25:09 13831

原创 集合问题中的贪婪策略模拟

Greedy策略(近似算法)let states = new Set(['mt','wa','or','id','nv','ut','ca','az'])let stations = {}stations['kone']=new Set(['id','nv','ut'])stations['ktwo']=new Set(['wa','id','mt'])stations['kthree']=new Set(['or','nv','ca'])stations['kfour']=new Set(['

2020-10-07 14:23:07 12949

原创 堆排序算法

heap算法function findParentNodeKey (key) { let parentKey = 1 if(key===1){ return parentKey }else if(key%2===0){ parentKey = key/2 return parentKey }else if(key%2!==0){ parentKey = (key-1)/2 return parentKey }}let heapArr =

2020-10-07 14:21:47 13136

原创 动态规划之最长公共子串问题

Dynamic算法//longest common subsequence problem 最长公共子序列let word = 'fosh'let anotherWord = 'fish'let answerTable = []for(let i =0;i< anotherWord.length;i++){ let valueList = [] for(let j = 0;j< word.length;j++){ if(i===0&&j=

2020-10-07 14:20:32 13090

原创 动态规划中的背包问题

Dynamic算法//bag problem 最优解=>动态规划(大问题分解成小问题,大背包分解成为空间最小单位1的一个个小背包) 次优解=>贪婪策略let bag = 6let list = { water:{weight:3,value:10}, book:{weight:1,value:3}, food:{weight:2,value:9}, jacket:{weight:2,value:5}, camera:{weight:1,value:

2020-10-07 14:19:13 13091

原创 最短路径之Bellman-Ford

Bellman-Ford算法function getCostByPositiveGraph (graph,start) { let cost = {} for(let i in graph){ for (let j in graph[start]){ if(i === graph[start][j]['target']){ cost[i] = graph[start][j]['value']

2020-10-07 14:17:25 13324

原创 最短路径之Dijkstra

Dijkstra算法function getCostByPositiveGraph (graph,start) { let cost = {} for(let i in graph){ for (let j in graph[start]){ if(i === graph[start][j]['target']){ cost[i] = graph[start][j]['value'] b

2020-10-07 14:16:04 12672

原创 贝叶斯去除垃圾邮件模拟

贝叶斯算法let pointWordsList = [ {words:['周六', '公司', '一起', '聚餐', '时间'],isTrash:0}, {words:['优惠', '返利', '打折', '优惠', '金融', '理财'],isTrash:1}, {words:['喜欢', '机器学习', '一起', '研究', '欢迎', '贝叶斯', '算法', '公式'],isTrash:0}, {words:['公司', '发票', '税点', '优惠', '增

2020-10-07 14:13:00 11965

vite project demo

vite project demo

2022-04-13

vuecli2.zip

vue-cli2模板简化版,内含http,插件

2021-03-18

vue项目模板,http模块,插件等

vue项目模板

2021-03-08

卡牌抽奖特效(内含背景音乐,图片,代码)

卡牌抽奖特效(内置自定义音乐播放器)

2021-03-05

opencv4.1.zip

python opencv 入门

2021-01-22

mycode有关排序等内容

my code有关排序算法和各种结构算法等内容,包括五子棋游戏,和俄罗斯方块游戏等内容。 还有一些js小工具

2020-10-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除