image-processing

Get color of individual pixels of images in pygame

北城余情 提交于 2020-03-01 12:44:32
问题 How can I get the colour values of pixels of an image that is blitted onto a pygame surface? Using Surface.get_at() only returns the color of the surface layer, not the image that has been blitted over it. 回答1: The method surface.get_at is fine. Here is an example showing the difference when blitting an image without alpha channel. import sys, pygame pygame.init() size = width, height = 320, 240 screen = pygame.display.set_mode(size) image = pygame.image.load("./img.bmp") image_rect = image

Finding all the X and Y coordinates of an image in python opencv

我的未来我决定 提交于 2020-02-29 09:16:22
问题 I am a beginner in opencv-python. I want to get all the X and Y coordinates of for the region of the interest mentioned in the code and store it in an array. Can anyone give me an idea on how to proceed? I was able to run the code, but is not showing any results. Image for detecting all the X and Y coordinates The sample code i wrote is written below, import cv2 import numpy as np import matplotlib.pyplot as plt import imutils img = cv2.imread("/home/harikrishnan/Desktop/image.jpg",0) img1 =

Finding all the X and Y coordinates of an image in python opencv

本秂侑毒 提交于 2020-02-29 09:16:07
问题 I am a beginner in opencv-python. I want to get all the X and Y coordinates of for the region of the interest mentioned in the code and store it in an array. Can anyone give me an idea on how to proceed? I was able to run the code, but is not showing any results. Image for detecting all the X and Y coordinates The sample code i wrote is written below, import cv2 import numpy as np import matplotlib.pyplot as plt import imutils img = cv2.imread("/home/harikrishnan/Desktop/image.jpg",0) img1 =

Take Screenshot of a UIImage iOS

僤鯓⒐⒋嵵緔 提交于 2020-02-29 06:30:07
问题 I want to take screenshot of a perticular section of my screen in a iOS App. The attached image is that part of screen. Here I want to take screenshot of the red marked rectangular area containing 3 UIImageViews which contains a white Image Frame at background , an image with coffee cup and the apple sign image on the coffee respectively. I am using the following code for doing that... - (UIImage *)captureView:(UIView *)view withArea:(CGRect)screenRect { UIGraphicsBeginImageContext(screenRect

Take Screenshot of a UIImage iOS

天大地大妈咪最大 提交于 2020-02-29 06:29:37
问题 I want to take screenshot of a perticular section of my screen in a iOS App. The attached image is that part of screen. Here I want to take screenshot of the red marked rectangular area containing 3 UIImageViews which contains a white Image Frame at background , an image with coffee cup and the apple sign image on the coffee respectively. I am using the following code for doing that... - (UIImage *)captureView:(UIView *)view withArea:(CGRect)screenRect { UIGraphicsBeginImageContext(screenRect

TesseractNotFoundError: tesseract is not installed or it's not in your path

こ雲淡風輕ζ 提交于 2020-02-28 18:42:05
问题 I am trying to use tesseract-OCR to print text from the image. But I am getting the above error. I have installed tesseract OCR using https://github.com/UB-Mannheim/tesseract/wiki and pytesseract in the anaconda prompt using pip install pytesseract but its not working. Please help if anyone has faced the similar issue. (base) C:\Users\500066016>pip install pytesseract Collecting pytesseract Downloading https://files.pythonhosted.org/packages/13/56

How to detect an octagonal shape in Python and Opencv

 ̄綄美尐妖づ 提交于 2020-02-28 09:41:23
问题 I am working on a shape detection algorithm with opencv in python . I am using Contours from the library and I have had some shapes being detected successfully: Circle, Rectangle and Triangle. The only problem is that I only need to detect circles rectangles and octagons. Also, the circle was working, but inconsistently. So, this is my code: import cv2 import numpy as np def nothing(x): # any operation pass cap = cv2.VideoCapture(1) cv2.namedWindow("Trackbars") cv2.createTrackbar("L-H",

How to detect an octagonal shape in Python and Opencv

送分小仙女□ 提交于 2020-02-28 09:38:48
问题 I am working on a shape detection algorithm with opencv in python . I am using Contours from the library and I have had some shapes being detected successfully: Circle, Rectangle and Triangle. The only problem is that I only need to detect circles rectangles and octagons. Also, the circle was working, but inconsistently. So, this is my code: import cv2 import numpy as np def nothing(x): # any operation pass cap = cv2.VideoCapture(1) cv2.namedWindow("Trackbars") cv2.createTrackbar("L-H",

How to detect an octagonal shape in Python and Opencv

时光总嘲笑我的痴心妄想 提交于 2020-02-28 09:38:29
问题 I am working on a shape detection algorithm with opencv in python . I am using Contours from the library and I have had some shapes being detected successfully: Circle, Rectangle and Triangle. The only problem is that I only need to detect circles rectangles and octagons. Also, the circle was working, but inconsistently. So, this is my code: import cv2 import numpy as np def nothing(x): # any operation pass cap = cv2.VideoCapture(1) cv2.namedWindow("Trackbars") cv2.createTrackbar("L-H",

How to detect an octagonal shape in Python and Opencv

倾然丶 夕夏残阳落幕 提交于 2020-02-28 09:38:29
问题 I am working on a shape detection algorithm with opencv in python . I am using Contours from the library and I have had some shapes being detected successfully: Circle, Rectangle and Triangle. The only problem is that I only need to detect circles rectangles and octagons. Also, the circle was working, but inconsistently. So, this is my code: import cv2 import numpy as np def nothing(x): # any operation pass cap = cv2.VideoCapture(1) cv2.namedWindow("Trackbars") cv2.createTrackbar("L-H",