python-opencv中imshow总报错的问题 5C

我用的是visual studio2017,自带安装的Anaconda2,pip安装的opencv-python,在我调用imshow函数的时候总是报错
cv2.error
Message=C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:331: error: (-215) size.width>0 && size.height>0 in function cv::imshow

StackTrace:
中的 C:\Users\Administrator\source\repos\PythonApplication1\PythonApplication1\PythonApplication1.py:4
图片说明
图片说明
求大佬帮忙解答下

4个回答

看一下你的图片格式,把后缀去掉试试

weixin_41038390
半限人 没用
大约 2 年之前 回复

应该是图片加载时的问题,你先将imread的地址改为D:/input/1.jpg(我先默认是jpg格式,不对的话你自己改一下)

weixin_41038390
半限人 还是不对
大约 2 年之前 回复

1这个文件存在吗?是文件夹还是文件,这里应该是一个图片文件

weixin_41038390
半限人 是图片
大约 2 年之前 回复

已解决,改为双斜杆即可'D:\1\1.jpg'

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
python使用opencv中的imshow时出错,无法显示图片

python使用opencv中imshow语句时报错,窗口就是灰色的没有图片,错误提示cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' 求大神帮忙解决 下面是代码 import cv2 #加载图片 image=cv2.imread('‪SS09001.JPG') #建立一个窗口 cv2.namedWindow('image') #展示 cv2.imshow('image',image) cv2.waitKey()

python-opencv无法打开摄像头

在linux下,使用python无法打开摄像头,第一次编译程序是没有任何反映,第二次就显示libv4l2: error setting pixformat: Device or resource busy HIGHGUI ERROR: libv4l unable to ioctl S_FMT libv4l2: error setting pixformat: Device or resource busy libv4l1: error setting pixformat: Device or resource busy libv4l2: error setting pixformat: Device or resource busy libv4l1: error setting pixformat: Device or resource busy HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT 这种错误,此后一直显示资源繁忙。但是使用opencv能够正常的打开摄像头。以下是python的程序import cv2 import numpy as np cap = cv2.VideoCapture(0) while(1): # get a frame ret, frame = cap.read() # show a frame cv2.imshow('capture', frame) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows() 求大神帮忙解决,没有人有类似的问题吗

opencv imshow()崩溃 急求救

平台win 7 64位 vs2013 opencv3.0.0 debug和release x64的模式下都不行 #include<iostream> #include<opencv2/opencv.hpp> using namespace cv; using namespace std; int main(){ Mat grayim(600, 800, CV_8UC1); for (int i = 0; i < grayim.rows; i++) for (int j = 0; j < grayim.cols; j++) grayim.at<uchar>(i, j) = (i, j) % 255; imshow("grayim", grayim); waitKey(0); return 0; } 像这段,运行到imshow()就会中断……快崩溃了 ,网上百度的方法都试过了,还是没解决 调试报错信息: 0x00000000776FF922 (ntdll.dll) (openCV_test1.exe 中)处有未经处理的异常: 0xC0000374: 堆已损坏。 (参数: 0x0000000077776470)。

Python与opencv新手,做毕设看一位大神源码,但自己执行时候有如下错误,请问怎么解决?

代码如下: if __name__ == '__main__': im = array(Image.open('G:/graduation project/picture/车牌.jpg')) ret, binary = cv2.threshold(im, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU) img = cv2Thin(im, 3) im2, cdf = histeq(im) cv2.imshow('细化图像', img) plt.imshow(im2, cmap=cm.gray) show() # 定义在pylab中 报错: C:\Python27\python.exe "G:/graduation project/Python-opencv/imtools.py" Traceback (most recent call last): File "G:/graduation project/Python-opencv/imtools.py", line 387, in <module> ret, binary = cv2.threshold(im, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU) TypeError: src data type = 17 is not supported

python的opencv打开两个摄像头失败

今天在搞双目的时候碰到的,之前在笔记本上可以运行的,换了台式出问题了。应该是**cv2.VideoCapture**就出问题了,网上翻了半天,不加上微软专属的**cv2.CAP_DSHOW**会出现 ``` [ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1113) SourceReaderCB::OnReadSample videoio(MSMF): OnReadSample() is called with error status: -1072875772 [ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1125) SourceReaderCB::OnReadSample videoio(MSMF): async ReadSample() call is failed with error status: -1072875772 [ WARN:1] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1159) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -1072875772 ``` 加上了就没有这个问题,但是第二个摄像头依然不能使用,读取帧返回false,报错 ``` cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' ``` 求解决!! 附部分代码: ``` import cv2 capture = cv2.VideoCapture(0, cv2.CAP_DSHOW) capture_usb = cv2.VideoCapture(1, cv2.CAP_DSHOW) # 持续读取摄像头数据 while True: read_code, frame = capture.read() read_code2, frame2 = capture_usb.read() cv2.imshow("1", frame) cv2.imshow("2", frame2) if cv2.waitKey(1) == ord('q'): break ```

Python程序中能调用外部库但是cmd中运行opencv工具报错没有外部的库

``` #-*- encoding: UTF-8 -*- import cv2 import numpy import argparse import Image import time from naoqi import ALProxy from naoqi import ALBroker def nothing(x): pass def choseHSV(filePath): img=cv2.imread(filePath,1) hsv = cv2.cvtColor(img,cv2.COLOR_BGR2HSV) cv2.namedWindow("image",cv2.WINDOW_NORMAL) cv2.createTrackbar('minH','image',0,179,nothing) cv2.createTrackbar('minS','image',0,255,nothing) cv2.createTrackbar('minV','image',0,255,nothing) cv2.createTrackbar('maxH','image',0,179,nothing) cv2.createTrackbar('maxS','image',0,255,nothing) cv2.createTrackbar('maxV','image',0,255,nothing) while(1): minH=cv2.getTrackbarPos('minH','image') minS=cv2.getTrackbarPos('minS','image') minV=cv2.getTrackbarPos('minV','image') maxH=cv2.getTrackbarPos('maxH','image') maxS=cv2.getTrackbarPos('maxS','image') maxV=cv2.getTrackbarPos('maxV','image') thresholdMin = numpy.array([minH, minS, minV]) thresholdMax = numpy.array([maxH, maxS, maxV]) mask=cv2.inRange(hsv,thresholdMin,thresholdMax) res=cv2.bitwise_and(img,img,mask = mask) cv2.imshow('image',res) k=cv2.waitKey(1) if k==ord('q'): break cv2.destroyAllWindows() def readRobotTemperature(): pass def takePhotos(cameraID, robotIP, port): CAMERA = ALProxy("ALVideoDevice", robotIP, port) CAMERA.setActiveCamera(cameraID) # VGA 设置分辨率为2:640*480 0:160*120 resolution = 2 # RGB 设置颜色空间为RGB colorSpace = 11 videoClient = CAMERA.subscribe("python_client", resolution, colorSpace, 5) #设置曝光度模式 CAMERA.setCamerasParameter(videoClient,22,2) time.sleep(0.5) #获取照片 naoImage = CAMERA.getImageRemote(videoClient) CAMERA.unsubscribe(videoClient) imageWidth = naoImage[0] imageHeight = naoImage[1] array = naoImage[6] #装换为PIL图片格式 img = Image.fromstring("RGB", (imageWidth, imageHeight), array) img.save("photo.png", "PNG") def test(): broker = ALBroker("broker","0.0.0.0",0,"127.0.0.1",9559) MOTION = ALProxy("ALMotion") MOTION.moveTo(1,0,0) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--filePath", type=str, help="file path.") args = parser.parse_args() choseHSV(args.filePath) #takePhotos(0, "192.168.1.103", 9559) #test() ``` 以上就是代码,代码是一个tools工具,没有问题,但是一用cmd命令运行以下命令: tools.py --filePath pic.png (最后那是一个图片) 就会报错没有XXX库,我调试了一下,发现所有的外部库它都会报错,不知道这是个什么问题,有没有大神能帮我看看,谢谢了先

用python实现opencv报错an integer is required

以下是代码 managers.py ``` #!/usr/bin/env python # -*- coding: utf-8 -*- import cv2 import numpy import time '''     视频管理 ''' class CaptureManager(object): def __init__(self,capture,previewWindowManager = None,shouldMirrorPreview = False): self.previewWindowManager = previewWindowManager self.shouldMirrorPreview = shouldMirrorPreview #定义非公有变量,单下划线开始,为保护变量,只有类对象或子类对象可以访问 protected #如果以双下划线开始,为私有成员变量,只有类对象自已可以访问,像private self._capture = capture self._channel = 0 self._enteredFrame = False self._frame = None self._imageFilename = None self._videoFilename = None self._videoEncoding = None self._videoWriter = None self._startTime = None self._framesElapsed = long(0) self._fpsEstimate = None @property def channel(self): return self._channel @channel.setter def channel(self,value): if self._channel != value: self._channel = value self.frame = None @property def frame(self): if self._enteredFrame and self._frame is None: _,self._frame = self._capture.retrieve() return self._frame @property def isWritingImage(self): return self._imageFilename is not None @property def isWritingVideo(self): return self._videoFilename is not None #只能同步一帧 def enterFrame(self): """Capture the next frame,if any.""" if self._capture is not None: #but first,check that any previous frame was exited. #assert not self._enteredFrame,'previous enterFrame() had no matching exitFrame()' if self._capture is not None: self._enteredFrame = self._capture.grab() else: None def exitFrame(self): """可以从当前通道中取得图像,估计帧率,显示图像,执行暂停的请求,向文件中写入图像""" #计算帧率 if self.frame is None: self._enteredFrame = False return #Update the FPS estimate and related variables.通过窗体显示图像 if self._framesElapsed == 0: self._startTime = time.time() else: timeElapsed = time.time() - self._startTime self._fpsEstimate = self._framesElapsed/timeElapsed self._framesElapsed += 1 #Draw to the Window,if any.保存图像文件 if self.previewWindowManager is not None: if self.shouldMirrorPreview: mirroredFrame = numpy.fliplr(self._frame).copy() self.previewWindowManager.show(mirroredFrame) else: self.previewWindowManager.show(self._frame) #Write to the image file,if any.保存图像文件 if self.isWritingImage: cv2.imwrite(self._imageFilename,self._frame) self._imageFilename = None #Write to the video file,if any.保存视频文件 self._writeVideoFrame() #Release the frame.释放资源 self._frame = None self.enteredFrame = False def writeImage(self,filename): """Write the next exited frame to an image file."""#保存图片,公有函数 self._imageFilename = filename def startWritingVideo(self,filename,encoding = cv2.VideoWriter_fourcc('I','4','2','0')): """Start writing exited frames to a video file."""#开始保存视频,公有函数 self._videoFilename = filename self._videoEnchding = None self._videoWriter = None def _writeVideoFrame(self):#停止视频写入,公有函数 if not self.isWritingVideo: return if self._videoWriter is None: fps = self._capture.get(cv2.CAP_PROP_FPS) if fps == 0.0: #The capture's FPS is unknown so use an entimate. if self._framesElapsed < 20: #Wait until more frames frames elapse so that the estimate is more stable. return else: fps = self._fpsEstimate size = (int(self._capture.get(cv2.CAP_PROP_FRAME_WIDTH)),\ int(self._capture.get(cv2.CAP_PROP_FRAME_HEIGHT))) self._videoWriter = cv2.VideoWriter(self._videoFilename,self._videoEncoding,fps,size) self._videoWriter.write(self._frame) '''     窗口管理,支持键盘事件 ''' class WindowManager(object): def __init__(self,windowName,keypressCallback = None): #窗体名称#按键回调函数 self.keypressCallback = keypressCallback self._windowName = windowName self._isWindowCreated = False @property def isWindowCreated(self):#检查窗体是否被创建 return self._isWindowCreated def creatWindow(self):#创建窗体 cv2.namedWindow(self._windowName) self._isWindowCreated = True def show(self,frame):#显示图像 cv2.imshow(self._windowName,frame) def destroyWindow(self):#关闭窗体释放资源 cv2.destroyWindow(self._windowName) self._isWindowCreated = False def processEvents(self): keycode = cv2.waitKey(1) if self.keypressCallback is not None and keycode != -1: #Discard any non-ASCII info encoded by GTY. keycode &= 0xFF self.keypressCallback(keycode) ``` cameo.py ``` #!/usr/bin/env python # -*- coding: utf-8 -*- import cv2 from managers import WindowManager,CaptureManager class Cameo(object): def __init__(self): self._windowManager = WindowManager('Cameo',self.onKeypress) self._captureManager = CaptureManager(cv2.VideoCapture(0),self._windowManager,True) def run(self): """Run the main loop.""" self._windowManager.creatWindow() while self._windowManager.isWindowCreated: self._captureManager.enterFrame() frame = self._captureManager.frame #TODO:Filter the frame (Chapter 3). self._captureManager.exitFrame() self._windowManager.processEvents() def onKeypress(self,keycode): """Handle a keycode. space -> 载图 tab -> 启动和停止视频录制 escape -> 退出应用 """ if keycode == 32: #space self._captureManager.writeImage('screenshot.png') elif keycode == 9:#tab if not self._captureManager.isWritingVideo: self._captureManager.startWritingVideo("screencast.avi") else: self._captureManager.stopWritingVideo() elif keycode == 27:#escape self._windowManager.destroyWindow() if __name__ == "__main__": Cameo().run() ```

Python OpenCV人脸识别错误待解

在编写人脸识别的时候(代码如下): ``` import cv2 import numpy as np cascPath = "C:\opencv\sources\data\haarcascades\haarcascade_frontalface_alt2.xml" faceCascade = cv2.CascadeClassifier(cascPath) video_capture = cv2.VideoCapture(0) while True: ret, frame = video_capture.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiScale( gray, scaleFactor=1.1, minNeighbors=10, #Adjust accuracy minSize=(50, 50), flags=cv2.CASCADE_SCALE_IMAGE ) for (x, y, w, h) in faces: cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 255, 255), 2) cv2.imshow('Video', frame) if cv2.waitKey(1) & 0xFF == ord('q'): break if cv2.waitKey(1) & 0xFF == ord('s'): cv2.imwrite('test1.png', frame) img = cv2.imread("test1.png") face = img[x:x+w,y:y+h] cv2.imshow('Face', face) cv2.imwrite("face_detected.png", face) images=[] images.append(cv2.imread("klp.jpg",cv2.IMREAD_GRAYSCALE)) images.append(cv2.imread("wh.jpg",cv2.IMREAD_GRAYSCALE)) images.append(cv2.imread("wk.jpg",cv2.IMREAD_GRAYSCALE)) Labels=[0,1,2] recognizer = cv2.face.LBPHFaceRecognizer_create() recognizer.train(images, np.array(Labels)) predict_image = cv2.imread("face_detected.png",cv2.IMREAD_GRAYSCALE) label,confidence= recognizer.predict(predict_image) print("Label=", label) print("Confidence=", confidence) video_capture.release() cv2.destroyAllWindows() ``` 出现了如下问题: ``` Exception has occurred: error OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\core\src\matrix.cpp:235: error: (-215:Assertion failed) s >= 0 in function 'cv::setSize' File "F:\learn_python\Models\DetectFace&Recognize.py", line 41, in <module> recognizer.train(images, np.array(Labels)) ```

Python OpenCV Canny错误待解

买了一本OpenCV的书,在使用Canny进行边缘检测的时候出现了声明错误 代码片段如下: ``` import cv2 import matplotlib.pyplot as plt o=cv2.imread("lena.bmp", cv2.IMREAD_GRAYSCALE) r1 = cv2.Canny(o,128,200) cv2.imshow("result1",r1) cv2.waitKey() cv2.destroyAllWindows() ``` 书上是这么写的,但是我用起来就会报错,报错内容如下: ``` Exception has occurred: error OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' File "F:\learn_python\Models\test.py", line 6, in <module> cv2.imshow("result1",r1) ``` 其中```cv2.imshow```里面的双引号和单引号都试过,报同样的错误。

用python实现opencv照书上的代码打进去报错NameError

这是代码 import cv2 import numpy import time class CaptureManager(object): def __init__(self,capture,previewWindowManager = None,shouldMirrorPreview = False): self.previewWindowManager = previewWindowManager self.shouldMirrorPreview = shouldMirrorPreview self._capture = capture self._channel = 0 self._enteredFrame = False self._frame = None self._imageFilename = None self._videoFilename = None self._videoEncoding = None self._videoWriter = None self._startTime = None self._framesElapsed = long(0) self._fpsEstimate = None @property def channel(self): return self._channel @channel.setter def channel(self,value): if self._channel != value: self._channel = value self.frame = None @property def frame(self): if self._enteredFrame and self._frame is None: _, self.frame = self._capture.retrieve() return self.frame @property def isWritingImage(self): return self._imageFilename is not None @property def isWritingVideo(self): return self._videoFilename is not None def enterFrame(self): """Capture the next frame,if any.""" #but first,check that any previous frame was exited. assert not self._enteredFrame,\ 'previous enterFrame() had no maching exitFrame()' if self._capture is not None: self._enteredFrame = self._capture.grab() def exitFrame(self): """Draw to the window. Write to files.Release the frame.""" #Check whether any grabbed frame is retriveable. #The getter may retrieve and cache the frame. if self.frame is None: self._enteredFrame = False return #Update the FPS estimate and related variables. if self._framesElapsed == 0: self._startTime = time.time() else: timeElapsed = time.time() - self.startTime self.fpsEstimate = self._framesElapsed / timeElapsed self._framesElapsed += 1 #Draw to the Window,if any. if self.previewWindowManager is not None: if self.showldMirrorPreview: mirroredFrame = numpy.fliplr(self._frame).copy() self.previewWindowManager.show(mirroredFrame) else: self.previewWindowManager.show(self._frame) #Write to the image file,if any. if self.isWrintingImage: cv2.imwrite(self.imageFilename,self._frame) self._imageFilename = None #Write to the video file,if any. self._writeVideoFrame() #Release the frame. self._frame = None self.enteredFrame = False def writeImage(self,filename): """Write the next exited frame to an image file.""" self._imageFilename = filename def startWritingVideo(self,filename,encoding = cv2.VideoWriter_fourcc('I','4','2','0')): """Start writing exited frames to a video file.""" self._videoFilename = filename self._videoEnchding = None self._videoWriter = None def _writeVideoFrame(self): if not self.isWritingVideo: return if self._videoWriter is None: fps = self._capture.get(cv2.CAP_PROP_FPS) if fps == 0.0: #The capture's FPS is unknown so use an entimate. if self._framesElapsed < 20: #Wait until more frames frames elapse so that the estimate is more stable. return else: fps = self._fpsEstimate size = (int(self._capture.get(cv2.CAP_PROP_FRAME_WIDTH)),int(self._capture.get(cv2.CAP_FRAME_HEIGHT))) self._videoWriter = cv2.VideoWriter(self._videoFilename,self._videoEncoding,fps,size) self._videoWriter.write(self._frame) class WindowManager(object): def __init__(self,windowName,keypressCallback = None): self.keypressCallback = keypressCallback self._windowName = windowName self._isWindowCreated = False @property def isWindowCreated(self): return self._iswindowCreated def creatWindow(self): cv2.namedWindow(self._windowName) self._isWindowCreated = True def show(self,frame): cv2.imshow(self._windowName,frame) def destroyWindow(self): cv2.destroyWindow(self._windowName) self._isWindowCreated = False def processEvents(self): keycode = cv2.waitKey(1) if self.keypressCallback is not None and keycode != -1: #Discard any non-ASCII info encoded by GTY. keycode &= 0xFF self.keypressCallback(keycode) 运行一下报错 Traceback (most recent call last): File "G:\opencv\usrcold\managers.py", line 5, in <module> class CaptureManager(object): File "G:\opencv\usrcold\managers.py", line 76, in CaptureManager self._framesElapsed += 1 NameError: name 'self' is not defined 为什么~

python3调用别人的opencv图片匹配程序报错

小白,调用别人python算法进行图片匹配报错。 代码: import cv2 from matplotlib import pyplot as plt import numpy as np import os import math def getMatchNum(matches,ratio): '''返回特征点匹配数量和匹配掩码''' matchesMask=[[0,0] for i in range(len(matches))] matchNum=0 for i,(m,n) in enumerate(matches): if m.distance<ratio*n.distance: #将距离比率小于ratio的匹配点删选出来 matchesMask[i]=[1,0] matchNum+=1 return (matchNum,matchesMask) path='D:/code/' queryPath=path+'yangben/' #图库路径 samplePath=path+'yuanjian/image1.jpg' #样本图片 comparisonImageList=[] #记录比较结果 #创建SIFT特征提取器 sift = cv2.xfeatures2d.SIFT_create() #创建FLANN匹配对象 FLANN_INDEX_KDTREE=0 indexParams=dict(algorithm=FLANN_INDEX_KDTREE,trees=5) searchParams=dict(checks=50) flann=cv2.FlannBasedMatcher(indexParams,searchParams) sampleImage=cv2.imread(samplePath,0) kp1, des1 = sift.detectAndCompute(sampleImage, None) #提取样本图片的特征 for parent,dirnames,filenames in os.walk(queryPath): for p in filenames: p=queryPath+p queryImage=cv2.imread(p,0) kp2, des2 = sift.detectAndCompute(queryImage, None) #提取比对图片的特征 matches=flann.knnMatch(des1,des2,k=2) #匹配特征点,为了删选匹配点,指定k为2,这样对样本图的每个特征点,返回两个匹配 (matchNum,matchesMask)=getMatchNum(matches,0.9) #通过比率条件,计算出匹配程度 matchRatio=matchNum*100/len(matches) drawParams=dict(matchColor=(0,255,0), singlePointColor=(255,0,0), matchesMask=matchesMask, flags=0) comparisonImage=cv2.drawMatchesKnn(sampleImage,kp1,queryImage,kp2,matches,None,**drawParams) comparisonImageList.append((comparisonImage,matchRatio)) #记录下结果 comparisonImageList.sort(key=lambda x:x[1],reverse=True) #按照匹配度排序 count=len(comparisonImageList) column=4 row=math.ceil(count/column) #绘图显示 figure,ax=plt.subplots(row,column) for index,(image,ratio) in enumerate(comparisonImageList): ax[int(index/column)][index%column].set_title('Similiarity %.2f%%' % ratio) ax[int(index/column)][index%column].imshow(image) plt.show() 报错信息: Traceback (most recent call last): File "sift7.py", line 55, in <module> ax[int(index/column)][index%column].set_title('Similiarity %.2f%%' % ratio) TypeError: 'AxesSubplot' object does not support indexing 求大神指点。

python OpenCV图像去噪处问题求解

我想把一张图片去噪,然后再把对比度增强一下,即让图片更鲜艳更亮一点,但是现在去噪可以了(第一段代码),若再把对比度增强则报错,即变为第二段代码。 ``` import cv2 import matplotlib.pyplot as plt import math import copy import numpy as np img_file = 'uglybaboon.png' img = cv2.imread(img_file) gray = cv2.cvtColor(img,cv2.COLOR_RGB2BGR) medina = cv2.medianBlur(gray,5) plt.figure() plt.subplot(1,2,1), plt.imshow(gray) plt.subplot(1,2,2), plt.imshow(medina) plt.show() ``` ![图片说明](https://img-ask.csdn.net/upload/202004/24/1587687562_789083.png) ``` import cv2 import matplotlib.pyplot as plt import math import copy import numpy as np img_file = 'uglybaboon.png' img = cv2.imread(img_file) gray = cv2.cvtColor(img,cv2.COLOR_RGB2BGR) medina = cv2.medianBlur(gray,5) img_gray = cv2.cvtColor(medina, cv2.IMREAD_GRAYSCALE) img_gray_a = img_gray.astype(np.uint8) img_gray_eq = cv2.equalizeHist(img_gray_a) plt.figure() plt.subplot(1,2,1), plt.imshow(gray) plt.subplot(1,2,2), plt.imshow(img_gray_eq) plt.show() ``` ( 13行为img_gray_eq = cv2.equalizeHist(img_gray_a) ) line 13, in <module> img_gray_eq = cv2.equalizeHist(img_gray_a) cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\histogram.cpp:3439: error: (-215:Assertion failed) _src.type() == CV_8UC1 in function 'cv::equalizeHist'

cv2.error:Opencv(3.4.3)

s = robot.get_camera_data() plt.imshow(s) plt.show() s_ = robot.get_camera_data() print (s_.shape) plt.imshow(s_) plt.show() flow = cv2.calcOpticalFlowFarneback(s, s_, None, 0.5, 3, 15, 3, 5, 1.2, 0) ``` s与s_分别为在仿真环境中采集到的3通道图片数据,但是 运行代码报错,在网上也没有找到相关问题,谢谢大家。 ``` cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\video\src\optflowgf.cpp:1114: error: (-215:Assertion failed) prev0.size() == next0.size() && prev0.channels() == next0.channels() && prev0.channels() == 1 && pyrScale_ < 1 in function 'cv::`anonymous-namespace'::FarnebackOpticalFlowImpl::calc' 此处为代码运行错误。

python3调用opencv报错:TypeError: Expected Ptr<cv::UMat> for argument 'array'

## python3调用opencv报错:TypeError: Expected cv::UMat for argument 'array’ ``` def measure_object(image): gray = cv.cvtColor(image, cv.COLOR_RGBA2GRAY) ret, binary = cv.threshold(gray, 0, 255, cv.THRESH_BINARY | cv.THRESH_OTSU) print("ret:%s" % ret) cv.imshow("binary image", binary) contours, hireachy = cv.findContours(binary, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_SIMPLE) for contour in enumerate(contours): # area = cv.contourArea(contour) #得到第几个轮廓面积 x, y, w, h = cv.boundingRect(contour) #得到外接矩形的大小 #求取几何矩 mm = cv.moments(contour) # type(mm) cx = mm['m10']/mm['m00'] cy = mm['m01'] / mm['m00'] cv.circle(image, (np.int(cx), np.int(cy)), 3, (0, 0, 255), -1) cv.rectangle(image, (x, y), ((x+w), (y+h)), (0, 0, 255), 2) cv.imshow("measure_contours", image) print("-------hello python-------") src = cv.imread('pic\\sample2.jpg') # cv.namedWindow("input image", cv.WINDOW_AUTOSIZE) cv.imshow('sample2', src) measure_object(src) cv.waitKey(0) cv.destroyAllWindows() ``` ## 报错如下: ![图片说明](https://img-ask.csdn.net/upload/202003/27/1585264814_429069.jpg) 查询了cv.boundingRect() 方法是返回 四个参数没错,请教一下大神。

openCV_python自带的ANN进行手写字体识别,报错。求助

![图片说明](https://img-ask.csdn.net/upload/202001/31/1580479207_695592.png)![图片说明](https://img-ask.csdn.net/upload/202001/31/1580479217_497206.png) 我用python3.6按照《OpenCV3计算机视觉》书上代码进行手写字识别,识别率很低,运行时还报了错:OpenCV(3.4.1) Error: Assertion failed ((type == 5 || type == 6) && inputs.cols == layer_sizes[0]) in cv::ml::ANN_MLPImpl::predict, file C:\projects\opencv-python\opencv\modules\ml\src\ann_mlp.cpp, line 411 ``` 具体代码如下:求大佬指点下 import cv2 import numpy as np import digits_ann as ANN def inside(r1, r2): x1, y1, w1, h1 = r1 x2, y2, w2, h2 = r2 if (x1 > x2) and (y1 > y2) and (x1 + w1 < x2 + w2) and (y1 + h1 < y2 + h2): return True else: return False def wrap_digit(rect): x, y, w, h = rect padding = 5 hcenter = x + w / 2 vcenter = y + h / 2 if (h > w): w = h x = hcenter - (w / 2) else: h = w y = vcenter - (h / 2) return (int(x - padding), int(y - padding), int(w + padding), int(h + padding)) ''' 注意:首次测试时,建议将使用完整的训练数据集,且进行多次迭代,直到收敛 如:ann, test_data = ANN.train(ANN.create_ANN(100), 50000, 30) ''' ann, test_data = ANN.train(ANN.create_ANN(10), 50000, 1) # 调用所需识别的图片,并处理 path = "C:\\Users\\64601\\PycharmProjects\Ann\\images\\numbers.jpg" img = cv2.imread(path, cv2.IMREAD_UNCHANGED) bw = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) bw = cv2.GaussianBlur(bw, (7, 7), 0) ret, thbw = cv2.threshold(bw, 127, 255, cv2.THRESH_BINARY_INV) thbw = cv2.erode(thbw, np.ones((2, 2), np.uint8), iterations=2) image, cntrs, hier = cv2.findContours(thbw.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) rectangles = [] for c in cntrs: r = x, y, w, h = cv2.boundingRect(c) a = cv2.contourArea(c) b = (img.shape[0] - 3) * (img.shape[1] - 3) is_inside = False for q in rectangles: if inside(r, q): is_inside = True break if not is_inside: if not a == b: rectangles.append(r) for r in rectangles: x, y, w, h = wrap_digit(r) cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2) roi = thbw[y:y + h, x:x + w] try: digit_class = ANN.predict(ann, roi)[0] except: print("except") continue cv2.putText(img, "%d" % digit_class, (x, y - 1), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0)) cv2.imshow("thbw", thbw) cv2.imshow("contours", img) cv2.waitKey() cv2.destroyAllWindows() ####### import cv2 import pickle import numpy as np import gzip """OpenCV ANN Handwritten digit recognition example Wraps OpenCV's own ANN by automating the loading of data and supplying default paramters, such as 20 hidden layers, 10000 samples and 1 training epoch. The load data code is taken from http://neuralnetworksanddeeplearning.com/chap1.html by Michael Nielsen """ def vectorized_result(j): e = np.zeros((10, 1)) e[j] = 1.0 return e def load_data(): with gzip.open('C:\\Users\\64601\\PycharmProjects\\Ann\\mnist.pkl.gz') as fp: # 注意版本不同,需要添加传入第二个参数encoding='bytes',否则出现编码错误 training_data, valid_data, test_data = pickle.load(fp, encoding='bytes') fp.close() return (training_data, valid_data, test_data) def wrap_data(): # tr_d数组长度为50000,va_d数组长度为10000,te_d数组长度为10000 tr_d, va_d, te_d = load_data() # 训练数据集 training_inputs = [np.reshape(x, (784, 1)) for x in tr_d[0]] training_results = [vectorized_result(y) for y in tr_d[1]] training_data = list(zip(training_inputs, training_results)) # 校验数据集 validation_inputs = [np.reshape(x, (784, 1)) for x in va_d[0]] validation_data = list(zip(validation_inputs, va_d[1])) # 测试数据集 test_inputs = [np.reshape(x, (784, 1)) for x in te_d[0]] test_data = list(zip(test_inputs, te_d[1])) return (training_data, validation_data, test_data) def create_ANN(hidden=20): ann = cv2.ml.ANN_MLP_create() # 建立模型 ann.setTrainMethod(cv2.ml.ANN_MLP_RPROP | cv2.ml.ANN_MLP_UPDATE_WEIGHTS) # 设置训练方式为反向传播 ann.setActivationFunction( cv2.ml.ANN_MLP_SIGMOID_SYM) # 设置激活函数为SIGMOID,还有cv2.ml.ANN_MLP_IDENTITY,cv2.ml.ANNMLP_GAUSSIAN ann.setLayerSizes(np.array([784, hidden, 10])) # 设置层数,输入784层,输出层10 ann.setTermCriteria((cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 100, 0.1)) # 设置终止条件 return ann def train(ann, samples=10000, epochs=1): # tr:训练数据集; val:校验数据集; test:测试数据集; tr, val, test = wrap_data() for x in range(epochs): counter = 0 for img in tr: if (counter > samples): break if (counter % 1000 == 0): print("Epoch %d: Trained %d/%d" % (x, counter, samples)) counter += 1 data, digit = img ann.train(np.array([data.ravel()], dtype=np.float32), cv2.ml.ROW_SAMPLE, np.array([digit.ravel()], dtype=np.float32)) print("Epoch %d complete" % x) return ann, test def predict(ann, sample): resized = sample.copy() rows, cols = resized.shape if rows != 28 and cols != 28 and rows * cols > 0: resized = cv2.resize(resized, (28, 28), interpolation=cv2.INTER_CUBIC) return ann.predict(np.array([resized.ravel()], dtype=np.float32)) ```

cv2.error: OpenCV(4.0.0)

新手入门,想用Python处理图片,在网上查了这个函数cv2.adaptiveThreshold想用来处理阈值分割,但是代码报错了,在网上也没有找到解决方法![图片说明](https://img-ask.csdn.net/upload/201901/24/1548309323_400772.png), 报的错是![图片说明](https://img-ask.csdn.net/upload/201901/24/1548309393_440640.png) 哪位大佬能麻烦帮我解答一下,

python opencv 图片前景与背景的分割,拜大神求如何改错

在网上找到了一个用Kmeans算法对图片前景与背景的分割的例子,很适合现在的学习,可一直有一个错误不会修改,跪求大神了。 ``` ```# -*- coding: utf-8 -*- import cv2 import numpy as np import math def panelAbstract(srcImage): # read pic shape imgHeight,imgWidth = srcImage.shape[:2] imgHeight = int(imgHeight);imgWidth = int(imgWidth) # 均值聚类提取前景:二维转一维 imgVec = np.float32(srcImage.reshape((-1,3))) criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER,10,1.0) flags = cv2.KMEANS_RANDOM_CENTERS label,clusCenter = cv2.kmeans(imgVec,2,None,criteria,10,flags) clusCenter = np.uint8(clusCenter) clusResult = clusCenter[label.flatten()] imgres = clusResult.reshape((srcImage.shape)) imgres = cv2.cvtColor(imgres,cv2.COLOR_BGR2GRAY) bwThresh = int((np.max(imgres)+np.min(imgres))/2) _,thresh = cv2.threshold(imgres,bwThresh,255,cv2.THRESH_BINARY_INV) threshRotate = cv2.merge([thresh,thresh,thresh]) # 确定前景外接矩形 #find contours contours = cv2.findContours(thresh,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE) minvalx = np.max([imgHeight,imgWidth]);maxvalx = 0 minvaly = np.max([imgHeight,imgWidth]);maxvaly = 0 maxconArea = 0;maxAreaPos = -1 for i in range(len(contours)): if maxconArea < cv2.contourArea(contours[i]): maxconArea = cv2.contourArea(contours[i]) maxAreaPos = i objCont = contours[maxAreaPos] # 旋转校正前景 rect = cv2.minAreaRect(objCont) for j in range(len(objCont)): minvaly = np.min([minvaly,objCont[j][0][0]]) maxvaly = np.max([maxvaly,objCont[j][0][0]]) minvalx = np.min([minvalx,objCont[j][0][1]]) maxvalx = np.max([maxvalx,objCont[j][0][1]]) if rect[2] <=-45: rotAgl = 90 +rect[2] else: rotAgl = rect[2] if rotAgl == 0: panelImg = srcImage[minvalx:maxvalx,minvaly:maxvaly,:] else: rotCtr = rect[0] rotCtr = (int(rotCtr[0]),int(rotCtr[1])) rotMdl = cv2.getRotationMatrix2D(rotCtr,rotAgl,1) imgHeight,imgWidth = srcImage.shape[:2] #图像的旋转 dstHeight = math.sqrt(imgWidth *imgWidth + imgHeight*imgHeight) dstRotimg = cv2.warpAffine(threshRotate,rotMdl,(int(dstHeight),int(dstHeight))) dstImage = cv2.warpAffine(srcImage,rotMdl,(int(dstHeight),int(dstHeight))) dstRotimg = cv2.cvtColor(dstRotimg,cv2.COLOR_BGR2GRAY) _,dstRotBW = cv2.threshold(dstRotimg,127,255,0) contours = cv2.findContours(dstRotBW,cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE) maxcntArea = 0;maxAreaPos = -1 for i in range(len(contours)): if maxcntArea < cv2.contourArea(contours[i]): maxcntArea = cv2.contourArea(contours[i]) maxAreaPos = i x,y,w,h = cv2.boundingRect(contours[maxAreaPos]) #提取前景:panel panelImg = dstImage[int(y):int(y+h),int(x):int(x+w),:] return panelImg if __name__=="__main__": srcImage = cv2.imread('11.jpg') a=panelAbstract(srcImage) cv2.imshow('figa',a) cv2.waitKey(0) cv2.destroyAllWindows() 这是原地址https://blog.csdn.net/Dawn__Z/article/details/82115160 报错如下(知道错是什么意思就是不会改):Traceback (most recent call last): File "D:\Workspaces\MyEclipse 2015\pythonTest\src\cc.py", line 70, in a=panelAbstract(srcImage) File "D:\Workspaces\MyEclipse 2015\pythonTest\src\cc.py", line 7, in panelAbstract imgHeight,imgWidth = srcImage.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'

python使用Opencv实现人脸识别进行人脸数据训练时,为什么总是报文件无法打开的错误?

recognizer = cv2.face.LBPHFaceRecognizer_create() recognizer.train(faces, np.array(ids)) recognizer.write(r'face_trainer\trainer.yml') 我看了网上大部分都是这样写的,但是运行时总是报 error: (-2:Unspecified error) File can't be opened for writing! in function 'cv::face::FaceRecognizer::write' 网上查不到解决办法。。

树莓派opencv调用cvShowImage("Original Image",img);会报错

我用的是VNC远程打开树莓派桌面,但是执行cvShowImage("Original Image",img);或cv2.imshow('image',img)就是报错,Xlib:extension "RANDR" missing on display ":1.0". GdkGLExt-WARNING **:Window system doesn't support OpenGL. 这个问题困扰我几天了,网上找的一些方法根本没法解决,还请大神帮帮忙,再次先谢过了!

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

将一个接口响应时间从2s优化到 200ms以内的一个案例

一、背景 在开发联调阶段发现一个接口的响应时间特别长,经常超时,囧… 本文讲讲是如何定位到性能瓶颈以及修改的思路,将该接口从 2 s 左右优化到 200ms 以内 。 二、步骤 2.1 定位 定位性能瓶颈有两个思路,一个是通过工具去监控,一个是通过经验去猜想。 2.1.1 工具监控 就工具而言,推荐使用 arthas ,用到的是 trace 命令 具体安装步骤很简单,大家自行研究。 我的使用步骤是...

学历低,无法胜任工作,大佬告诉你应该怎么做

微信上收到一位读者小涛的留言,大致的意思是自己只有高中学历,经过培训后找到了一份工作,但很难胜任,考虑要不要辞职找一份他能力可以胜任的实习工作。下面是他留言的一部分内容: 二哥,我是 2016 年高中毕业的,考上了大学但没去成,主要是因为当时家里经济条件不太允许。 打工了三年后想学一门技术,就去培训了。培训的学校比较垃圾,现在非常后悔没去正规一点的机构培训。 去年 11 月份来北京找到了一份工...

JVM内存结构和Java内存模型别再傻傻分不清了

讲一讲什么是Java内存模型 Java内存模型虽说是一个老生常谈的问题 ,也是大厂面试中绕不过的,甚至初级面试也会问到。但是真正要理解起来,还是相当困难,主要这个东西看不见,摸不着。 这是一个比较开放的题目,面试官主要想考察的是对Java内存模型的了解到了什么程度了,然后根据回答进行进一步的提问 下面,我们就这个问题的回答列一下我们的思路 具体的思路如下: 说一说Java内存模型的缘由 简略辨析...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Google 与微软的浏览器之争

浏览器再现“神仙打架”。整理 | 屠敏头图 | CSDN 下载自东方 IC出品 | CSDN(ID:CSDNnews)从 IE 到 Chrome,再从 Chrome 到 Edge,微软与...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

立即提问
相关内容推荐