image-processing

How to capture a picture after every 5 seconds of camera using opencv python and Raspbery Pi 3?

限于喜欢 提交于 2020-01-25 07:40:05
问题 I am working on a school project which is related to Image Processing using OpenCV Python and Raspberry Pi 3. The hardware of Raspberry Pi 3 cannot handle the video from camera consecutively, therefore I'm thinking about only capture a picture after every 5 seconds from the camera and use it to recognize what I need, then continue. I did some research on the internet and found a function called time.sleep(5), however this function only pause the camera 5 seconds and then continue. Can anyone

Extract image data based on coordinates or tessaract and writing the content in docs/docx word file

房东的猫 提交于 2020-01-25 07:28:07
问题 I have image.want to extract image data with same layout into docx file and in readable form using python.i have tried Applied tessaract on image and converting to pdf using pyteesaract Then converting pdf to word file But i am not able to maintain the layout and format. 回答1: This question has been answered before in here. You can use the pdf2image library for this issue: from pdf2image import convert_from_path pages = convert_from_path('sample.pdf', 400) //400 is the Image quality in DPI

use cv2.connectedComponentswithstats to display images

Deadly 提交于 2020-01-25 06:51:11
问题 I have an image and I want to remove the white small dots from the image. I read many post and found cv2.connectedComponentsWithStats would work. But how to display the images using its output.Below is my code : import cv2 import numpy as np from matplotlib import pyplot as plt src = cv2.imread("./folder/0607130001-1.png",0) binary_map = (src > 0).astype(np.uint8) connectivity = 4 # or whatever you prefer output = cv2.connectedComponentsWithStats(binary_map, connectivity,cv2.CV_32S) plt

Trying to implement Connected Component Labeling in MATLAB

泄露秘密 提交于 2020-01-25 06:39:07
问题 I am trying to implement the two pass CCL algorithm in MATLAB without using the union-find data structure, here's my code: clear; clc; original_image = [ ... 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0]; original_image = im2bw(original_image); [image_height, image_width] = size(original_image); bigger_image = zeros(size

How to implement 24bit to 3bit ordered dither algorithm?

人盡茶涼 提交于 2020-01-25 02:50:47
问题 I am attempting to implement a Bayer ordered dithering matrix algorithm to convert a 24bit color image to a 3bit image. I have read the Wikipedia page, and several textbook sections on the topic and am a bit confused. This is what I have so far: for (int y = 0; x < image.Height; y++) { for (int x = 0; x < image.Width; x++) { Color color = image.GetPixel(x,y); color.R = color.R + bayer4x4[x % 4, y % 4]; color.G = color.G + bayer4x4[x % 4, y % 4]; color.B = color.B + bayer4x4[x % 4, y % 4];

Show the accumulator result after use houghcircles opencv function

二次信任 提交于 2020-01-25 02:47:08
问题 Please I want to draw accumulator output for opencv hougcircles function. . The function run ok and detected the circle (center&radius) only I want to show the accumulator for this function The path for function Opencv\modules\imgprocs\src\hough.cpp The function name for hough circle icvHoughCirclesGradient the parameter for accumulator is "accum". Any help please Thanks 来源: https://stackoverflow.com/questions/28718956/show-the-accumulator-result-after-use-houghcircles-opencv-function

Convert Image to Base64 string

杀马特。学长 韩版系。学妹 提交于 2020-01-25 01:29:06
问题 I am trying to convert an Image file to Base64 string in UWP with StorageFile Here's the method I have: public async Task<string> ToBase64String(StorageFile file) { var stream = await file.OpenAsync(FileAccessMode.Read); var decoder = await BitmapDecoder.CreateAsync(stream); var pixels = await decoder.GetPixelDataAsync(); var bytes = pixels.DetachPixelData(); return await ToBase64(bytes, (uint)decoder.PixelWidth, (uint)decoder.PixelHeight, decoder.DpiX, decoder.DpiY); } and ToBase64 goes like

Converting Cartesian image to polar, appearance differences

前提是你 提交于 2020-01-24 22:16:33
问题 I'm trying to do a polar transform on the first image below and end up with the second. However my result is the third image. I have a feeling it has to do with what location I choose as my "origin" but am unsure. radius = sqrt(width**2 + height**2) nheight = int(ceil(radius)/2) nwidth = int(ceil(radius/2)) for y in range(0, height): for x in range(0, width): t = int(atan(y/x)) r = int(sqrt(x**2+y**2)/2) color = getColor(getPixel(pic, x, y)) setColor( getPixel(radial,r,t), color) 回答1: There

Color only a segment of an image in Matlab

≯℡__Kan透↙ 提交于 2020-01-24 20:48:23
问题 I'm trying to color only a segment of an image in Matlab. For example, I load an RGB image, then I obtain a mask with Otsu's method ( graythresh ). I want to keep the color only in the pixels that have value of 1 after applying im2bw with graythresh as the threshold. For example: image = imread('peppers.png'); thr = graythresh(image); bw = im2bw(image, thr); With this code I obtain the following binary image: My goal is to keep the color in the white pixels. Thanks! 回答1: I have another

issue of the recognize people by their clothes color with not severe illumination environments

倾然丶 夕夏残阳落幕 提交于 2020-01-24 20:23:04
问题 I am interested in the human following using a real robot. I'd like to use the color of clothes as a key feature to identify the target person in front of the robot to follow him/ her but I am suffering due to it is a weak feature with a very simple illumination changing. So, I need to alter this algorithm to another or update values (RGB) online in real-time but I don't have enough experience with image processing. this is my full code for color detection: import cv2 import numpy as np from