opencv3.0

Houghlines in android with opencv

江枫思渺然 提交于 2019-12-21 19:49:23
问题 I am trying to make a perspective correction for quadrilateral objects using opencv3 . I managed to show the lines and also implemented the Houghlines using Imgproc.HoughLinesP() and tried to highlight the lines using Imgproc.lines() but output was no success. Below is my code and also I have attached my output image. Please let me know what is wrong happening and what should be done... Mat initImg; // initial image Mat greyImg; // converted to grey Mat lines = new Mat(); int threshold = 50;

Anaconda: cannot import cv2 even though opencv is installed (how to install opencv3 for python3)

回眸只為那壹抹淺笑 提交于 2019-12-21 07:55:52
问题 I have anaconda (version: conda 4.2.9, python3) installed and am trying to do import cv2 when I get the following error: ImportError: No module named 'cv2' With conda search cv2 I get this: opencv 2.4.2 np15py26_0 defaults 2.4.2 np15py27_0 defaults 2.4.2 np16py26_0 defaults 2.4.2 np16py27_0 defaults 2.4.2 np17py26_0 defaults 2.4.2 np17py27_0 defaults 2.4.2 np15py26_1 defaults 2.4.2 np15py27_1 defaults 2.4.2 np16py26_1 defaults 2.4.2 np16py27_1 defaults 2.4.2 np17py26_1 defaults 2.4.2 np17py27

How to extract relevant information from receipt

牧云@^-^@ 提交于 2019-12-20 14:21:56
问题 I am trying to extract information from a range of different receipts using a combination of Opencv, Tesseract and Keras. The end result of the project is that I should be able to take a picture of a receipt using a phone and from that picture get the store name, payment type (card or cash), amount paid and change tendered. So far I have done a few different preprocessing steps on a series of different sample receipts using Opencv such as removing background, denoising and converting to a

Opencv: Crop out text areas from license

江枫思渺然 提交于 2019-12-20 12:03:09
问题 I have the below image of a single drivers license, I want to extract information about the drivers license, name, DOB etc. My thought process is to find a way to group them line by line, and crop out the single rectangle that contains name, license, etc for eng and ara. But I have failed woefully. import cv2 import os import numpy as np scan_dir = os.path.dirname(__file__) image_dir = os.path.join(scan_dir, '../../images') class Loader(object): def __init__(self, filename, gray=True): self

How to merge a lot of square images via OpenCV

我的未来我决定 提交于 2019-12-20 10:55:09
问题 How can I merge images like below into a single image using OpenCV (there can be any number of them both horizontally and vertically)? Is there any built-in solution to do it? Additional pieces: 回答1: Well, it seems that I finished the puzzle: Main steps: Compare each pair of images ( puzzle pieces ) to know the relative position ( findRelativePositions and getPosition ). Build a map knowing the relative positions of the pieces ( buildPuzzle and builfForPiece ) Create the final collage putting

why cv2.imwrite() changes the color of pics?

与世无争的帅哥 提交于 2019-12-20 08:59:29
问题 I have the following piece of code: imgs = glob.glob('/home/chipin/heart/tray.png') current_img = io.imread(imgs[0]) cv2.imwrite('/home/chipin/heart/01.png', current_img[0:511,0:511]) The size of picture is 512*512, after being saved, a blue picture turns yellow. It seems that a channel is abandoned. I really don't know why. Here is the value of current_img: 回答1: Your problem is in the fact that skimage.io.imread loads image as RGB (or RGBA), but OpenCV assumes the image to be BGR or BGRA

Opencv installation error ubuntu 14.04

穿精又带淫゛_ 提交于 2019-12-20 07:14:55
问题 I am trying to build OpenCV on Ubuntu 14.04 for ARM using this guide. I have tried to install every package, but it is providing me these error on CMAKE. checking for module 'gstreamer-base-1.0' package 'gstreamer-base-1.0' not found checking for module 'gstreamer-video-1.0' package 'gstreamer-video-1.0' not found checking for module 'gstreamer-app-1.0' package 'gstreamer-app-1.0' not found checking for module 'gstreamer-riff-1.0' package 'gstreamer-riff-1.0' not found checking for module

How to save dpi info in py-opencv?

蓝咒 提交于 2019-12-20 03:52:10
问题 import cv2 def clear(img): back = cv2.imread("back.png", cv2.IMREAD_GRAYSCALE) img = cv2.bitwise_xor(img, back) ret, img = cv2.threshold(img, 120, 255, cv2.THRESH_BINARY_INV) return img def threshold(img): ret, img = cv2.threshold(img, 120, 255, cv2.THRESH_BINARY_INV) img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) ret, img = cv2.threshold(img, 248, 255, cv2.THRESH_BINARY) return img def fomatImage(img): img = threshold(img) img = clear(img) return img img = fomatImage(cv2.imread("1566135246468

OpenCV 3 error 'CV_FOURCC': identifier not found

江枫思渺然 提交于 2019-12-20 03:12:41
问题 Just built OpenCV 3 on PC with Visual Studio 2013 and now I'm trying code but sadly I can't figure out what's wrong? #include "opencv2/opencv.hpp" #include <iostream> using namespace std; using namespace cv; int main() { VideoCapture vcap(0); if (!vcap.isOpened()) { cout << "Error opening video stream or file" << endl; return -1; } int frame_width = vcap.get(cv::CAP_PROP_FRAME_WIDTH); int frame_height = vcap.get(cv::CAP_PROP_FRAME_HEIGHT); VideoWriter video("out.avi", CV_FOURCC('M', 'J', 'P',

OpenCV3: where has cv::cuda::Stream::enqueueUpload() gone?

给你一囗甜甜゛ 提交于 2019-12-19 10:26:09
问题 In former versions of OpenCV there was the function Stream::enqueueUpload that could be used to upload data to the GPU asynchronously together with CudaMem (compare: how to use gpu::Stream in OpenCV?). However, this function does no longer exist in OpenCV 3. The CudaMem class is also gone but seems to have been replaced by the HostMem class. Can anyone tell me how to perform an asynchronous upload in OpenCV 3? 回答1: It can be done now via void GpuMat::upload(InputArray arr, Stream& stream)