OpenCV

How Can I Solve this Crash when Compiling an iOS App with OpenCV Contrib using React Native?

故事扮演 提交于 2021-02-07 11:04:14
问题 trying to compile an iOS app with OpenCV 4.3 with contrib in a react native app. The app works fine in xcode, but as soon as I try compiling to bit code, the app fails. I've gone through several similar questions, but have not had any results and I'm hoping someone more experienced than I might have some suggestions. The .ipa file does generate and I can test it on an iPad or iPhone, but as soon as the app opens, it crashes. Here is the crash log; {"app_name":"helloOpenCV","timestamp":"2020

Recording video in specified time intervals and then saving them into file OpenCv Python

自作多情 提交于 2021-02-07 10:51:57
问题 Here are my goals. Capture video continuously until 'q; is pressed Every ten seconds save the video in created directory file Continue step two until 'q' is pressed I am executing the following code. But when creating files it's creating 6kb files and saying cannot play. I am fairly new to opencv and python. Not sure what I am missing. Running this code on pycharm with Python 3.6. Also the cv2.imshow('frame',frame) stops after ten seconds but recording is happening in background and files are

OpenCV create Mat from Array in heap

假装没事ソ 提交于 2021-02-07 10:51:46
问题 I have a problem when I try to initialize a Mat object using an array allocated on the heap. This is my code: void test(){ int rows = 2; int cols = 3; float **P_array; P_array = new float*[rows]; int i; for(i = 0; i < rows; i++) P_array[i] = new float[cols]; P_array[0][0]=1.0; P_array[0][1]=2.0; P_array[0][2]=3.0; P_array[1][0]=4.0; P_array[1][1]=5.0; P_array[1][2]=6.0; float P_array2[2][3]={{1.0,2.0,3.0},{4.0,5.0,6.0}}; Mat P_m = Mat(rows, cols, CV_32FC1, &P_array); Mat P_m2 = Mat(2,3, CV

OpenCV: How to detect rhombus on image?

懵懂的女人 提交于 2021-02-07 10:44:54
问题 I hame some image with plane which have perspective transform. I need to detect center of each white rhombus or rhombus itself. Here is examples: As I unserstand the problem can be solved by simple template matching if we rectify image, but I need to do it automatically. Is there any functions in OpenCV suitable for this task? Any other ideas? 回答1: Here are two quick tests I just did without correcting the perspective issue. Pure mathematical morphology : Extract the red channel Big white top

Python-Opencv Write x264 video on memory buffer

随声附和 提交于 2021-02-07 10:34:19
问题 I have a problem for writing x264 video(or single frame) on memory buffer. In opencv for images, imencode and imdecode do this task. But i want save x264 video frame for lower memory usage and sending on internet. I am able to with jpeg but jpeg size bigger than x264 video frame and quality much worser. I searched but i can't find how i write video frame on buffer. Here is the example code to taking frames on webcam import numpy as np import cv2 cap = cv2.VideoCapture(0) cap.set(3,320) cap

opencv 2.4.0 laplacian different results depending on API used?

与世无争的帅哥 提交于 2021-02-07 10:29:25
问题 I'm using OpenCV 2.4.0 python bindings and I found that when calculating a laplacian of an image I get different results with the cv2 API from the cv2.cv API. if I use cv2 API: im_laplacian = cv2.Laplacian(im_gray, cv2.IPL_DEPTH_32F, ksize = 3) im_laplacian is always uint8 (missing sign), and ddepth has to be IPL_DEPTH_32F or IPL_DEPTH_64F, if I try IPL_DEPTH_16S or IPL_DEPTH_32S I get an error: "OverflowError: Python int too large to convert to C long" if I use cv2.cv API: cvgray = cv

opencv 2.4.0 laplacian different results depending on API used?

好久不见. 提交于 2021-02-07 10:28:17
问题 I'm using OpenCV 2.4.0 python bindings and I found that when calculating a laplacian of an image I get different results with the cv2 API from the cv2.cv API. if I use cv2 API: im_laplacian = cv2.Laplacian(im_gray, cv2.IPL_DEPTH_32F, ksize = 3) im_laplacian is always uint8 (missing sign), and ddepth has to be IPL_DEPTH_32F or IPL_DEPTH_64F, if I try IPL_DEPTH_16S or IPL_DEPTH_32S I get an error: "OverflowError: Python int too large to convert to C long" if I use cv2.cv API: cvgray = cv

How to deploy pytesseract to Heroku

一笑奈何 提交于 2021-02-07 10:25:44
问题 I have a Python app which words great via Localhost on my machine. I am trying to deploy it to Heroku. However it does not seem possible to accomplish this (I have spent approx 30 hours trying now). The problem is Tesseract OCR. I am using the pytesseract wrapper, and my code utilises this. However, no matter what I try, it does not seem to be possible to use pytesseract when it is uploaded to Heroku. Could anyone either suggest how to go about deploying a Hello World Tesseract OCR Python app

Using dicom Images with OpenCV in Python

扶醉桌前 提交于 2021-02-07 10:23:27
问题 I am trying to use a dicom image and manipulate it using OpenCV in a Python environment. So far I have used the pydicom library to read the dicom(.dcm) image data and using the pixel array attribute to display the picture using OpenCV imshow method. But the output is just a blank window. Here is the snippet of code I am using at this moment. import numpy as np import cv2 import pydicom as dicom ds=dicom.dcmread('sample.dcm') cv2.imshow('sample image dicom',ds.pixel_array) cv2.waitkey() If i

Recognize numbers from an image python

假如想象 提交于 2021-02-07 10:23:24
问题 I am trying to extract numbers from in game screenshots. I'm trying to extract: 98 3430 5/10 from PIL import Image import pytesseract image="D:/img/New folder (2)/1.png" pytesseract.pytesseract.tesseract_cmd = 'C:/Program Files/Tesseract-OCR/tesseract.exe' text = pytesseract.image_to_string(Image.open(image),lang='eng',config='--psm 5') print(text) output is gibberish ‘t hl) keteeeees ek pSlaerenen JU) pgrenmnreserenny Rates B d dali eas. 5 cle aM (Sores |, S| pgranmrerererecons a cee 3 pea 3