OpenCV

文章目录

  • OpenCV学习报告
    • 读取图片和网络摄像头
      • 1.1 图片读取
      • 1.2 视频读取
        • 1.1.1 读取视频文件
        • 1.1.2读取网络摄像头
    • OpenCV基础功能
    • 调整、裁剪图像
      • 3.1 调整图像大小
      • 3.2 裁剪图像
    • 图像上绘制形状和文本
      • 4.1 图像上绘制形状
      • 4.2图像上写文字
    • 透视变换
    • 图像拼接
    • 颜色检测
    • 轮廓检测
    • 人脸检测
      • 9.1静态图片
      • 9.2 摄像头
    • 实战
      • 10.1虚拟绘画
      • 10.2纸张扫描
      • 10.3 车牌检测器
    • 参考资料

OpenCV学习报告

读取图片和网络摄像头

1.1 图片读取

import cv2
# read image
img = cv2.imread("Resources/dnn.jpg")
cv2.imshow("Output",img)
cv2.waitKey(0)

在这里插入图片描述

1.2 视频读取

1.1.1 读取视频文件

import cv2
# read video
cap = cv2.VideoCapture("Resources/test_video.mp4")
while True:success,img = cap.read()cv2.imshow("Video",img)if cv2.waitKey(1) & 0xFF == ord('q'):break

在这里插入图片描述

1.1.2读取网络摄像头

import cv2
# read webcam
cap = cv2.VideoCapture(0)
cap.set(3,640) #width
cap.set(4,480) #height
cap.set(10,100)while True:success,img = cap.read()cv2.imshow("Video",img)if cv2.waitKey(1) & 0xFF == ord('q'):break

在这里插入图片描述

OpenCV基础功能

import cv2
import numpy as np
# basic function
img = cv2.imread("Resources/dnn.jpg")
kernel = np.ones((5,5),np.uint8)# 灰度转换
imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# 图像模糊
imgBlur = cv2.GaussianBlur(imgGray,(7,7),0)
# 边缘检测
imgCanny = cv2.Canny(img,100,100)
# 膨胀
imgDialation = cv2.dilate(imgCanny, kernel,iterations=1)
# 腐蚀
imgEroded = cv2.erode(imgDialation,kernel,iterations=1)# cv2.imshow("Output",img)
cv2.imshow("Gray Image",imgGray)
cv2.imshow("Blur Image",imgBlur)
cv2.imshow("Blur Image",imgCanny)
cv2.imshow("Dialation Image",imgDialation)
cv2.imshow("Eroded Image",imgEroded)cv2.waitKey(0)

在这里插入图片描述
在这里插入图片描述

调整、裁剪图像

3.1 调整图像大小

import cv2# resize imageimg = cv2.imread("Resources/lambo.PNG")
print(img.shape)imgResize = cv2.resize(img,(300,200))
print(imgResize.shape)cv2.imshow("Image",img)
cv2.imshow("Image Resize",imgResize)cv2.waitKey(0)

在这里插入图片描述

3.2 裁剪图像

import cv2img=cv2.imread("Resources/lambo.PNG")
cv2.imshow('image',img)print(img.shape)#height,width,dpthcrop_img=img[100:400,50:500]
cv2.imshow('crop image',crop_img)cv2.waitKey(0)

在这里插入图片描述

图像上绘制形状和文本

4.1 图像上绘制形状

import cv2
import numpy as np
# shapes and texts
img = np.zeros((512,512,3),np.uint8)
cv2.imshow('oringin image',img)cv2.line(img,(0,0),(img.shape[1],img.shape[0]),(0,255,0),3)
cv2.imshow('line image',img)cv2.rectangle(img,(0,0),(250,350),(0,0,255),2)
cv2.imshow('rectangle image',img)cv2.circle(img,(400,500),30,(255,255,0),5)
cv2.imshow('circle image',img)cv2.waitKey(0)

在这里插入图片描述

4.2图像上写文字

import cv2
import numpy as npimg = np.zeros((512,512,3),np.uint8)
cv2.imshow('oringin image',img)cv2.putText(img,"OPENCV",(300,200),cv2.FONT_HERSHEY_COMPLEX,1,(0,150,0),1)
cv2.imshow("putText01 Image",img)
cv2.putText(img,"I LOVE XD",(100,300),cv2.FONT_HERSHEY_COMPLEX,1,(0,150,0),1)
cv2.imshow("putText02 Image",img)cv2.waitKey(0)

在这里插入图片描述

透视变换

import cv2
import numpy as np
# warp perspective
img = cv2.imread("Resources/cards.jpg")width,height = 250,350
pts1 = np.float32([[111,219],[287,188],[154,482],[352,440]])
pts2 = np.float32([[0,0],[width,0],[0,height],[width,height]])
matrix = cv2.getPerspectiveTransform(pts1,pts2)
imgOutput = cv2.warpPerspective(img,matrix,(width,height))cv2.imshow("Image",img)
cv2.imshow("Output",imgOutput)cv2.waitKey(0)

在这里插入图片描述

图像拼接

import cv2
import numpy as np
# join images
def stackImages(scale,imgArray):rows = len(imgArray)cols = len(imgArray[0])rowsAvailable = isinstance(imgArray[0], list)width = imgArray[0][0].shape[1]height = imgArray[0][0].shape[0]if rowsAvailable:for x in range ( 0, rows):for y in range(0, cols):if imgArray[x][y].shape[:2] == imgArray[0][0].shape [:2]:imgArray[x][y] = cv2.resize(imgArray[x][y], (0, 0), None, scale, scale)else:imgArray[x][y] = cv2.resize(imgArray[x][y], (imgArray[0][0].shape[1], imgArray[0][0].shape[0]), None, scale, scale)if len(imgArray[x][y].shape) == 2: imgArray[x][y]= cv2.cvtColor( imgArray[x][y], cv2.COLOR_GRAY2BGR)imageBlank = np.zeros((height, width, 3), np.uint8)hor = [imageBlank]*rowshor_con = [imageBlank]*rowsfor x in range(0, rows):hor[x] = np.hstack(imgArray[x])ver = np.vstack(hor)else:for x in range(0, rows):if imgArray[x].shape[:2] == imgArray[0].shape[:2]:imgArray[x] = cv2.resize(imgArray[x], (0, 0), None, scale, scale)else:imgArray[x] = cv2.resize(imgArray[x], (imgArray[0].shape[1], imgArray[0].shape[0]), None,scale, scale)if len(imgArray[x].shape) == 2: imgArray[x] = cv2.cvtColor(imgArray[x], cv2.COLOR_GRAY2BGR)hor= np.hstack(imgArray)ver = horreturn verimg = cv2.imread('Resources/dnn.jpg')
imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)imgStack = stackImages(0.5,([img,imgGray,img],[img,img,img]))# imgHdr = np.hstack((img,img))
# imgVer = np.vstack((img,img))
# cv2.imshow("Horizontal",imgHdr)
# cv2.imshow("Vertical",imgVer)cv2.imshow("ImageStack",imgStack)cv2.waitKey(0)

在这里插入图片描述

颜色检测

import cv2
import numpy as np
# color dectiondef empty(a):pass
'''连接图片'''
def stackImages(scale,imgArray):rows = len(imgArray)cols = len(imgArray[0])rowsAvailable = isinstance(imgArray[0], list)width = imgArray[0][0].shape[1]height = imgArray[0][0].shape[0]if rowsAvailable:for x in range ( 0, rows):for y in range(0, cols):if imgArray[x][y].shape[:2] == imgArray[0][0].shape [:2]:imgArray[x][y] = cv2.resize(imgArray[x][y], (0, 0), None, scale, scale)else:imgArray[x][y] = cv2.resize(imgArray[x][y], (imgArray[0][0].shape[1], imgArray[0][0].shape[0]), None, scale, scale)if len(imgArray[x][y].shape) == 2: imgArray[x][y]= cv2.cvtColor( imgArray[x][y], cv2.COLOR_GRAY2BGR)imageBlank = np.zeros((height, width, 3), np.uint8)hor = [imageBlank]*rowshor_con = [imageBlank]*rowsfor x in range(0, rows):hor[x] = np.hstack(imgArray[x])ver = np.vstack(hor)else:for x in range(0, rows):if imgArray[x].shape[:2] == imgArray[0].shape[:2]:imgArray[x] = cv2.resize(imgArray[x], (0, 0), None, scale, scale)else:imgArray[x] = cv2.resize(imgArray[x], (imgArray[0].shape[1], imgArray[0].shape[0]), None,scale, scale)if len(imgArray[x].shape) == 2: imgArray[x] = cv2.cvtColor(imgArray[x], cv2.COLOR_GRAY2BGR)hor= np.hstack(imgArray)ver = horreturn ver# 调整滑动条的位置来改变图像的颜色阈值,从而实现对图像的颜色分割或过滤
path = 'Resources/lambo.PNG'
framWidth = 640
framHeight = 480cap = cv2.VideoCapture(path)
cap.set(3,framWidth) #width
cap.set(4,framHeight) #height
cap.set(10,150)cv2.namedWindow("TrackBars")
cv2.resizeWindow("TrackBars",640,240)
cv2.createTrackbar("Hue Min","TrackBars",0,179,empty)  # hue
cv2.createTrackbar("Hue Max","TrackBars",179,179,empty)
cv2.createTrackbar("Sat Min","TrackBars",0,255,empty) # saturation
cv2.createTrackbar("Sat Max","TrackBars",255,255,empty)
cv2.createTrackbar("Val Min","TrackBars",0,255,empty)  # value
cv2.createTrackbar("Val Max","TrackBars",255,255,empty)while True:img = cv2.imread(path)imgHSV = cv2.cvtColor(img,cv2.COLOR_BGR2HSV)h_min = cv2.getTrackbarPos("Hue Min","TrackBars")h_max = cv2.getTrackbarPos("Hue Max", "TrackBars")s_min = cv2.getTrackbarPos("Sat Min", "TrackBars")s_max = cv2.getTrackbarPos("Sat Max", "TrackBars")v_min = cv2.getTrackbarPos("Val Min", "TrackBars")v_max = cv2.getTrackbarPos("Val Max", "TrackBars")# print(h_min,h_max,s_min,s_max,v_min,v_max)lower = np.array([h_min,s_min,v_min])upper = np.array([h_max,s_max,v_max])#用掩码对原始图像进行位运算mask = cv2.inRange(imgHSV,lower,upper)imgResult = cv2.bitwise_and(img,img,mask=mask) #二值图像# cv2.imshow("Original",img)# cv2.imshow("HSV",imgHSV)# cv2.imshow("Mask", mask)# cv2.imshow("Result", imgResult)imgStack = stackImages(0.6, ([img, imgHSV], [mask, imgResult]))cv2.imshow("Stacked Images", imgStack)cv2.waitKey(1)

在这里插入图片描述

轮廓检测

import cv2
import numpy as np#contours / shape detectiondef stackImages(scale,imgArray):rows = len(imgArray)cols = len(imgArray[0])rowsAvailable = isinstance(imgArray[0], list)width = imgArray[0][0].shape[1]height = imgArray[0][0].shape[0]if rowsAvailable:for x in range ( 0, rows):for y in range(0, cols):if imgArray[x][y].shape[:2] == imgArray[0][0].shape [:2]:imgArray[x][y] = cv2.resize(imgArray[x][y], (0, 0), None, scale, scale)else:imgArray[x][y] = cv2.resize(imgArray[x][y], (imgArray[0][0].shape[1], imgArray[0][0].shape[0]), None, scale, scale)if len(imgArray[x][y].shape) == 2: imgArray[x][y]= cv2.cvtColor( imgArray[x][y], cv2.COLOR_GRAY2BGR)imageBlank = np.zeros((height, width, 3), np.uint8)hor = [imageBlank]*rowshor_con = [imageBlank]*rowsfor x in range(0, rows):hor[x] = np.hstack(imgArray[x])ver = np.vstack(hor)else:for x in range(0, rows):if imgArray[x].shape[:2] == imgArray[0].shape[:2]:imgArray[x] = cv2.resize(imgArray[x], (0, 0), None, scale, scale)else:imgArray[x] = cv2.resize(imgArray[x], (imgArray[0].shape[1], imgArray[0].shape[0]), None,scale, scale)if len(imgArray[x].shape) == 2: imgArray[x] = cv2.cvtColor(imgArray[x], cv2.COLOR_GRAY2BGR)hor= np.hstack(imgArray)ver = horreturn verdef getContours(img):contours,hierarchy = cv2.findContours(img,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_NONE)for cnt in contours:area = cv2.contourArea(cnt)print(area)if area>500:cv2.drawContours(imgContour,cnt,-1,(255,0,0),3)#计算轮廓曲线长度peri = cv2.arcLength(cnt,True)print(peri)approx = cv2.approxPolyDP(cnt,0.02*peri,True)print(len(approx))objCor = len(approx)x,y,w,h = cv2.boundingRect(approx)# 图形分类if objCor == 3: objectType = "Tri"elif objCor == 4 :aspRatio = w / float(h)if aspRatio > 0.98 and aspRatio < 1.03: objectType = "Square"else: objectType = "Rectangle"elif objCor > 4: objectType = "Circles"else: objectType = "None"cv2.rectangle(imgContour,(x,y),(x+w,y+h),(0,255,0),2)cv2.putText(imgContour,objectType,(x+(w//2)-10,y+(h//2)-10),cv2.FONT_HERSHEY_COMPLEX,0.7,(0,0,0),2)path = 'Resources/shapes.png'
img = cv2.imread(path)
imgContour = img.copy()imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
imgBlur = cv2.GaussianBlur(imgGray,(7,7),1)
imgCanny = cv2.Canny(imgBlur,50,50)
getContours(imgCanny)imgBlank = np.zeros_like(img)
imgStack = stackImages(0.8,([img,imgGray],[imgCanny,imgContour]))cv2.imshow("Stack",imgStack)cv2.waitKey(0)

在这里插入图片描述

人脸检测

9.1静态图片

import cv2
# face detection
faceCascade = cv2.CascadeClassifier("Resources/haarcascade_frontalface_default.xml")
img = cv2.imread("Resources/dnn.jpg")
imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)faces = faceCascade.detectMultiScale(imgGray,1.1,4)for(x,y,w,h) in faces:cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
cv2.imshow("Result",img)cv2.waitKey(0)

在这里插入图片描述

9.2 摄像头

import cv2faceCascade = cv2.CascadeClassifier("Resources/haarcascade_frontalface_default.xml")cap = cv2.VideoCapture(0)
cap.set(3,640) #width
cap.set(4,480) #height
cap.set(10,100)while True:success,img = cap.read()cv2.imshow("Video",img)imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)faces = faceCascade.detectMultiScale(imgGray, 1.1, 4)for (x, y, w, h) in faces:cv2.rectangle(img, (x, y), (x + w, y + h), (255, 0, 0), 2)cv2.imshow("Result", img)if cv2.waitKey(1) & 0xFF == ord('q'):break

在这里插入图片描述

实战

10.1虚拟绘画

import cv2
import numpy as npframeWidth = 640
frameHeight = 480
cap = cv2.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
cap.set(10, 150)# 想要检测的颜色
myColors = [[0,89,0,98,255,255], [0,47,0,97,255,255], [0,66,0,179,255,255], [0,54,0,98,255,255]]
# 想要绘制的颜色  BGR
myColorValues = [[51, 153, 255],[0, 255, 0],[255,0,0],[0,255,255]]
# 绘制的点的列表
myPoints = []  ## [x , y , colorId ]"""获取想要绘制的,及对应的颜色"""
def findColor(img, myColors, myColorValues):imgHSV = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)count = 0newPoints = []for color in myColors:lower = np.array(color[0:3])upper = np.array(color[3:6])mask = cv2.inRange(imgHSV, lower, upper) x, y = getContours(mask)  # 想要绘制的点cv2.circle(imgResult, (x, y), 20, myColorValues[count], cv2.FILLED)  # 将点绘制在图上if x != 0 and y != 0:newPoints.append([x, y, count])  # 将点添加到 newPoints列表中,count为想要绘制颜色的编号count += 1return newPoints  def getContours(img):contours, Heriachy = cv2.findContours(img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE) x, y, w, h = 0, 0, 0, 0for cnt in contours:area = cv2.contourArea(cnt)if area > 500:# cv2.drawContours(imgResult, cnt, -1, (255, 0, 0), 3)peri = cv2.arcLength(cnt, True)approx = cv2.approxPolyDP(cnt, 0.02 * peri, True)x, y, w, h = cv2.boundingRect(approx)  return x + w // 2, y  """把点绘制在画布上"""
def drawOnCanvas(myPoints, myColorValues):for point in myPoints:cv2.circle(imgResult, (point[0], point[1]), 20, myColorValues[point[2]], cv2.FILLED)while True:success, img = cap.read()imgResult = img.copy()newPoints = findColor(img, myColors, myColorValues)  # 想要绘制的点if len(newPoints) != 0:for newP in newPoints:myPoints.append(newP)if len(myPoints) != 0:drawOnCanvas(myPoints, myColorValues)  # 将点绘制在画布上cv2.imshow("Result", imgResult)if cv2.waitKey(1) & 0xFF == ord('q'):break

利用颜色检测滑杆来得出笔的颜色

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

10.2纸张扫描

import cv2
import numpy as npwidthImg=480
heightImg =640img = cv2.imread("Resources/1.jpg")"""图像预处理"""
def preProcessing(img):imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)imgBlur = cv2.GaussianBlur(imgGray,(5,5),1)imgCanny = cv2.Canny(imgBlur,200,200)kernel = np.ones((5,5))imgDial = cv2.dilate(imgCanny,kernel,iterations=2)imgThres = cv2.erode(imgDial,kernel,iterations=1)return imgThres'''获取最大轮廓角点'''
def getContours(img):biggest = np.array([])maxArea = 0contours,Heriachy= cv2.findContours(img,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_NONE)for cnt in contours:area = cv2.contourArea(cnt)if area>5000:peri = cv2.arcLength(cnt,True)approx = cv2.approxPolyDP(cnt,0.02*peri,True)if area >maxArea and len(approx) == 4:biggest = approxmaxArea = area#绘制轮廓(biggest仅仅包含矩形的轮廓)cv2.drawContours(imgContour, biggest, -1, (255, 0, 0), 20)return biggest'''矩形角点的重新处理:按照一定的顺序排列(左上,右上,左下,右下)'''
def reorder (myPoints):myPoints = myPoints.reshape((4,2))#四个角点myPointsNew = np.zeros((4,1,2),np.int32)#点按照一定的顺序重新排列add = myPoints.sum(1)#将点进行x+y计算,myPointsNew[0] = myPoints[np.argmin(add)] #和最小的点为左上角点myPointsNew[3] = myPoints[np.argmax(add)]#和最大的点为右下角点diff = np.diff(myPoints,axis=1)#将点进行x-y差异计算myPointsNew[1]= myPoints[np.argmin(diff)]#差异最小的点为右上myPointsNew[2] = myPoints[np.argmax(diff)]#差异最大的点为左下return myPointsNew'''鸟瞰转换'''
def getWarp(img,biggest):#矩阵角点的处理,按照一个统一顺序排列biggest = reorder(biggest)pts1 = np.float32(biggest)pts2 = np.float32([[0, 0], [widthImg, 0], [0, heightImg], [widthImg, heightImg]])matrix = cv2.getPerspectiveTransform(pts1, pts2)#鸟瞰图imgOutput = cv2.warpPerspective(img, matrix, (widthImg, heightImg))#得到的鸟瞰图,边缘有其他背景,所以裁剪边缘,并将裁剪后的图像,重新调整为原来窗口大小。imgCropped = imgOutput[20:imgOutput.shape[0]-20,20:imgOutput.shape[1]-20]imgCropped = cv2.resize(imgCropped,(widthImg,heightImg))return imgCropped'''图像堆叠显示'''
def stackImages(scale,imgArray):rows = len(imgArray)cols = len(imgArray[0])rowsAvailable = isinstance(imgArray[0], list)width = imgArray[0][0].shape[1]height = imgArray[0][0].shape[0]if rowsAvailable:for x in range ( 0, rows):for y in range(0, cols):if imgArray[x][y].shape[:2] == imgArray[0][0].shape [:2]:imgArray[x][y] = cv2.resize(imgArray[x][y], (0, 0), None, scale, scale)else:imgArray[x][y] = cv2.resize(imgArray[x][y], (imgArray[0][0].shape[1], imgArray[0][0].shape[0]), None, scale, scale)if len(imgArray[x][y].shape) == 2: imgArray[x][y]= cv2.cvtColor( imgArray[x][y], cv2.COLOR_GRAY2BGR)imageBlank = np.zeros((height, width, 3), np.uint8)hor = [imageBlank]*rowshor_con = [imageBlank]*rowsfor x in range(0, rows):hor[x] = np.hstack(imgArray[x])ver = np.vstack(hor)else:for x in range(0, rows):if imgArray[x].shape[:2] == imgArray[0].shape[:2]:imgArray[x] = cv2.resize(imgArray[x], (0, 0), None, scale, scale)else:imgArray[x] = cv2.resize(imgArray[x], (imgArray[0].shape[1], imgArray[0].shape[0]), None,scale, scale)if len(imgArray[x].shape) == 2: imgArray[x] = cv2.cvtColor(imgArray[x], cv2.COLOR_GRAY2BGR)hor= np.hstack(imgArray)ver = horreturn verwhile True:imgresize = cv2.resize(img,(widthImg,heightImg))imgContour = imgresize.copy()imgThres = preProcessing(imgresize)biggest = getContours(imgThres)if biggest.size != 0:# 鸟瞰转换imgWarped = getWarp(imgresize, biggest)imageArray = ([imgresize,imgThres],[imgContour,imgWarped])cv2.imshow("ImageWarped", imgWarped)else:imageArray = ([imgContour, img])# 图像堆叠显示stackedImages = stackImages(0.5, imageArray)cv2.imshow("WorkFlow", stackedImages)cv2.waitKey(0)

在这里插入图片描述

10.3 车牌检测器

import cv2frameWidth = 640
frameHeight = 480
nPlateCascade = cv2.CascadeClassifier("Resources/haarcascade_russian_plate_number.xml")
minArea = 200
color = (255,0,255)cap = cv2.VideoCapture(0)
cap.set(3, frameWidth)
cap.set(4, frameHeight)
cap.set(10,150)
count = 0while True:success, img = cap.read() imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #车牌检测numberPlates = nPlateCascade.detectMultiScale(imgGray, 1.1, 10)for (x, y, w, h) in numberPlates:area = w*hif area >minArea:#绘制矩形cv2.rectangle(img, (x, y), (x + w, y + h), (255, 0, 255), 2)#绘制文字cv2.putText(img,"Number Plate",(x,y-5),cv2.FONT_HERSHEY_COMPLEX_SMALL,1,color,2)imgRoi = img[y:y+h,x:x+w]cv2.imshow("ROI", imgRoi)cv2.imshow("Result", img)if cv2.waitKey(1) & 0xFF == ord('s'):cv2.imwrite("Resources/Scanned/NoPlate_"+str(count)+".jpg",imgRoi)cv2.rectangle(img,(0,200),(640,300),(0,255,0),cv2.FILLED)cv2.putText(img,"Scan Saved",(150,265),cv2.FONT_HERSHEY_DUPLEX,2,(0,0,255),2)cv2.imshow("Result",img)cv2.waitKey(500)count +=1break

在这里插入图片描述

按s键后可保存车牌

在这里插入图片描述

参考资料

ChatGPT (openai.com)

RGB Color Codes Chart 🎨 (rapidtables.com)

图像基本操作 - 【布客】OpenCV 4.0.0 中文翻译 (apachecn.org)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/92216.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Doris集群安装部署(1.2.4.1 release)

此文阅读需要有Linux和服务器硬件基础&#xff01;某些内容写的不是特别细&#xff0c;如果常见的linux基础命令tar、uzip、mv、mkdir、系统包的安装等等&#xff0c;以文字带过了&#xff0c;这样可以减少文章篇幅。官方的安装部署方式一定要好好看一下&#xff0c;最好是尝试…

电脑前置耳机没声音怎么办

有很多小伙伴反映在将自己的耳机连接到主机前面时没有声音&#xff0c;这是怎么回事呢&#xff0c;遇到这种情况应该怎么解决呢&#xff0c;下面小编就给大家详细介绍一下电脑前置耳机没声音的解决方法&#xff0c;有需要的小伙伴可以来看一看电脑前面耳机没声音。 解决方法&a…

系统架构技能之设计模式-单件模式

一、开篇 其实我本来不是打算把系统架构中的一些设计模式单独抽出来讲解的&#xff0c;因为很多的好朋友也比较关注这方面的内容&#xff0c;所以我想通过我理解及平时项目中应用到的一 些常见的设计模式,拿出来给大家做个简单讲解&#xff0c;我这里只是抛砖引玉&#xff0c…

直播预告|博睿学院第四季即将开讲:博睿数据资深运维团队现身说法!

博睿学院第四季开讲啦&#xff01;本季博睿学院的课程将于本周四&#xff08;8月31日&#xff09;16点正式启动。本季我们邀请到了博睿数据平台支撑中心的四位资深运维专家现身说法&#xff0c;来为我们分享一体化智能可观测平台Bonree ONE的实践干货。 他们&#xff0c;见多识…

Unity3D Pico VR 手势识别

视频链接 本文章使用的 Unity3D版本: 2021.3.6 , Pico SDK 230 ,Pico OS v.5.7.1 硬件Pico 4 Pico SDK可以去Pico官网下载SDK 导入SDK 第一步&#xff1a;创建Unity3D项目 第二步&#xff1a;导入 PICO Unity Integration SDK 选择 Windows > Package Manager。 …

java八股文面试[多线程]——Synchronized优化手段:锁膨胀、锁消除、锁粗化和自适应自旋锁

1.锁膨胀 &#xff08;就是锁升级&#xff09; 我们先来回顾一下锁膨胀对 synchronized 性能的影响&#xff0c;所谓的锁膨胀是指 synchronized 从无锁升级到偏向锁&#xff0c;再到轻量级锁&#xff0c;最后到重量级锁的过程&#xff0c;它叫锁膨胀也叫锁升级。 JDK 1.6 之前…

清华联合北航提出全新多模态融合方法SkipcrossNets,更快更强!!

多模态融合越来越多地用于自动驾驶任务&#xff0c;因为来自不同模态的图像为特征提取提供了独特的信息。然而&#xff0c;现有的双流网络只在特定的网络层次进行融合&#xff0c;这需要大量手动尝试来设置。随着卷积神经网络的深入&#xff0c;两种模态的特征变得越来越高级和…

Dockerfile 使用教程

1.Dockerfile 1.1 什么是Dockerfile Dockerfile可以认为是 Docker镜像的描述文件&#xff0c;是由一系列命令和参数构成的脚本 。主要作用是 用来构建docker镜像的构建文件 。 通过架构图可以看出通过DockerFile可以直接构建镜像 1.2 Dockerfile解析过程 构建镜像步骤&#xf…

【核磁共振成像】相位差重建

目录 一、相位差map重建一般步骤和反正切函数主值范围二、反正切运算三、可预期相位误差和伴随场的校正四、图形变形校正 一、相位差map重建一般步骤和反正切函数主值范围 MRI是一个相敏成像模态&#xff0c;MR原始数据傅里叶变换后的复数图像中每个像素值有模和相位。标准模重…

Spring与Mybatis整合aop整合pageHelper分页插件

前言 Spring与MyBatis整合的意义在于提供了一种结合优势的方式&#xff0c;以便更好地开发和管理持久层&#xff08;数据库访问&#xff09;代码。 这里也是总结了几点主要意义 简化配置&#xff1a;Spring与MyBatis整合后&#xff0c;可以通过Spring的配置文件来管理和配置M…

C语言之数组题

目录 1.使用函数实现数组操作 2.冒泡排序 3.三子棋 4.【一维数组】交换数组 5.扫雷 6.概念辨析tips 我又来了&#xff0c;今天是数组题&#xff0c;本人还在补军训真的热&#xff01;&#x1f197; 1.使用函数实现数组操作 2.冒泡排序 3.三子棋 4.【一维数组】交换数组 …

自定义spring-boot-start的jar包被引用时,提示找不到bean

类似这个报错&#xff1a; 重点要看一下我们自定义的start包下的config配置 BeanConditionalOnProperty(prefix "file", value "iSenable", havingValue "true")public FileServiceTemplate fileServiceTemplate(){return new FileServiceTe…