Hello I am trying to create a facial recognition program but I have a peculiar error: here is my code: and this error is the output I have “lbpcascade_frontalface.xml” in the working directory so that shouldn’t be an issue if it helps when I enter I get Answer New Answer OpenCV seems to now …
Tag: opencv
Perform line segmentation (cropping) serially with OpenCV
I am performing full Page Offline Handwriting Recognition with Deep Learning. The main idea is to build the model that can take one line of text image and give it’s corresponding text. For this main task is do line segmentation of every line in a page and send it to the model. But, i apply this code bel…
OpenCV: “[ WARN:0] terminating async callback” when attempting to take a picture
I am trying to take a picture from the defualt carmera with python, to do this I am using openCV (import cv2 as cv from python shell). However, when I attempt to disable the camera it closes but with the error [ WARN:0] terminating async callback. This is code I am trying to run: The code outputs the desired …
Is there a way to use cv2.approxPolyDP to approximate open curve?
I would like to approximate smooth lines with chain of line segments. cv2.approxPolyDP in OpenCV 3.4 made a good result in the case of closed curve. Origin close curve: Approximated close curve: But in the case of open curve, cv2.approxPolyDP did not achieve the desired effect. Origin open curve: Approximated…
ConvergenceWarning: Liblinear failed to converge, increase the number of iterations
Running the code of linear binary pattern for Adrian. This program runs but gives the following warning: I am running python2.7 with opencv3.7, what should I do? Answer Normally when an optimization algorithm does not converge, it is usually because the problem is not well-conditioned, perhaps due to a poor s…
Simple method to extract specific color range from an image in Python?
I’m trying to extract a specific color from an image within a defined RGB range using the OpenCV for python module. In the example below I am trying to isolate the fire from the exhaust of the space shuttle between yellow and white RGB values and then print out the percentage of RGB values within that r…
How to make USB camera work with OpenCV?
I copied code from https://stackoverflow.com/a/34588758/210342 and used with default (built-in) camera, it worked. Then I attached USB camera, tested it with VLC and changed the code to open camera 1: I check whether the camera is open cam.isOpened() — it is — but the camera is not enabled (its ha…
How to calculate nucleus amount of cell?
I am using Python 3.5 and OpenCV 3 to analyze pictures of cells in biology. My pictures look like this: I want to be able to calculate a ratio of the area of the cell’s nucleus to the area of the cell as a whole. In my slides, the nucleus is dark purple and other regions of the cell are
OpenCV’s `getTextSize` and `putText` return wrong size and chop letters with lower pixels
I have the following Python code: I create a new blank image, with the size returned by getTextSize, and then, I add the text at the bottom-left point, according to the docs, which is x = 0, y = (height – 1) and with the same font, scale and thickness parameters used for getTextSize But when I use imsho…
Image Type Error: OpenCV Python
I get an image type error when I run my code. I know HoughLinesP requires a grayscale image but when I try to convert the source image to grayscale I get the following error(1): error: (-215) depth == 0 || depth == 2 || depth == 5 in function cv::cvtColor If I run HoughLinesP without converting to grayscale I…