image-processing

How to find duplicated jpgs by content?

久未见 提交于 2021-02-11 12:40:24
问题 I'd like to find and remove an image in a series of folders. The problem is that the image names are not necessarily the same. What I did was to copy an arbitrary string from the images bytecode and use it like grep -ir 'YA'uu�KU���^H2�Q�W^YSp��.�^H^\^Q��P^T' . But since there are thousands of images this method lasts for ever. Also, some images are created by imagemagic of the original, so can not use size to find them all. So I'm wondering what is the most efficient way to do so? 回答1:

Find contours based on edges and output equipment label

江枫思渺然 提交于 2021-02-11 12:29:21
问题 I am trying to code a tool that automatically identifies and alphabetically sorts the images based on equipment number (19-V1083AI). I used the pytesseract library to convert the image to a string after the contours of the equipment label were identified. Although the code runs correctly, it never outputs the equipment number. It's my first time using the pytesseract library and the goodFeaturesToTrack function. Any help would be greatly appreciated! Original Image: import numpy as np import

Installing Magick++ in visual studio 2019

眉间皱痕 提交于 2021-02-11 12:28:13
问题 I have tried to install Magick++.h in visual studio 2019. First I download ImageMagick++ and installed my pc. Then I copied include & library path to project properties. there is no error when I am writing the program. after compiling, there is a build error. Can someone help to solve this problem? 来源: https://stackoverflow.com/questions/61864570/installing-magick-in-visual-studio-2019

Image Erosion manual implementation not doing anything Python

我是研究僧i 提交于 2021-02-11 12:20:05
问题 Testing image I write a Python script that manually do a Erosion Morphological Operation to an image using the attached test image, but when I display both the original and altered image, this last one still looks the same even thought is it supposed to be eroded. I have 3 functions, my Main function, a RGB to Gray Conversion function and the Erosion function. import cv2 import math import numpy as np from PIL import Image, ImageFilter def main(): #Read image img = cv2.imread('pattern04.bmp')

Image to Text - Pytesseract struggles with digits on windows

岁酱吖の 提交于 2021-02-11 12:03:28
问题 I'm trying to preprocess frames of a game in real-time for a ML project. I want to extract numbers from the frame, so I chose Pytesseract, since it looked quite good with text. Though, no matter how clear I make the text, it won't read it correctly. My code looks like this: section = process_screen(screen_image)[1] pixels = rgb_to_bw(section) #Makes the image grayscale pixels[pixels < 200] = 0 #Makes all non-white pixels black tess.image_to_string(pixels) => 'ye ml)' At best it outputs "ye ml

taking images from webcam

穿精又带淫゛_ 提交于 2021-02-11 04:54:55
问题 I have this script to capture images from webcam, but it is not saving any image, I donot know why. I am getting this error " Traceback (most recent call last): File "C:/Users/Iram/.PyCharmCE2019.3/config/scratches/scratch_5.py", line 26, in gray = cv2.cvtColor(img_, cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor' [ WARN:0] global C:\projects\opencv-python

taking images from webcam

一个人想着一个人 提交于 2021-02-11 04:54:17
问题 I have this script to capture images from webcam, but it is not saving any image, I donot know why. I am getting this error " Traceback (most recent call last): File "C:/Users/Iram/.PyCharmCE2019.3/config/scratches/scratch_5.py", line 26, in gray = cv2.cvtColor(img_, cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor' [ WARN:0] global C:\projects\opencv-python

Efficient way to assign values into random blocks of an array of images?

蓝咒 提交于 2021-02-10 20:50:53
问题 I have a 3d numpy array. It's an array of 2d square images, all of the same size. my task is to block out a random square patch of the images (set all the pixel values to 0). I can figure out how to do it in the case where i just have 1 image as follows x = np.random.randint(image_width - size) y = np.random.randint(image_width - size) image[x:x + size, y:y + size] = 0 where size is the size of the blocked out area. I'm not sure how to efficiently do this technique to an array of 2d images,

Efficient way to assign values into random blocks of an array of images?

安稳与你 提交于 2021-02-10 20:48:55
问题 I have a 3d numpy array. It's an array of 2d square images, all of the same size. my task is to block out a random square patch of the images (set all the pixel values to 0). I can figure out how to do it in the case where i just have 1 image as follows x = np.random.randint(image_width - size) y = np.random.randint(image_width - size) image[x:x + size, y:y + size] = 0 where size is the size of the blocked out area. I'm not sure how to efficiently do this technique to an array of 2d images,

Quickly Plotting Polar Radar Data using Python?

倖福魔咒の 提交于 2021-02-10 19:57:28
问题 I've got an interesting application that requires transforming 3D polar data (angle, distance, and value at that point) into images representing the data. It's NOAA NEXRAD radar data that I'm using in a custom application. The data is stored in 3 arrays, range_data (the distance from the radar in meters, 1800 points), azimuth_data (the angle in 0.5 degree steps, 720 points), and radar_data (a 720x1800 array containing a data value for each combination of range and azimuth). This is the format