Face Features Detection Using OpenCV Haar-cascades

I am using Java with OpenCV Library to detect Face,Eyes and Mouth using Laptop Camera. What I have done so far: Capture Video Frames using VideoCapture object. Detect Face using Haar-Cascades. Divide the Face region into Top Region and Bottom Regi...
more »

2017-03-17 02:03 (1) Answers

How to pass an image to a function?

Here is the code I used: import threading import cv2 def showimg(*a): cv2.imshow('img', a) cv2.waitKey(5) cv2.destroyAllWindows() def main(): img = cv2.imread('tree.jpg') t = threading.Thread(target = showimg, args = (img) ) ...
more »

2017-03-14 05:03 (1) Answers

Convert RGB image to index image

I want to convert a 3 channel RGB image to a index image with Python. It's used for handling the labels of training a deep net for semantic segmentation. By index image I mean it has one channel and each pixel is the index, which should starts with z...
more »

2017-03-12 18:03 (1) Answers

Inconsistent PIL.ImageTk.PhotoImage() performance

I am converting numpy arrays (webcamera footage loaded with OpenCV) into Tkinter PhotoImage objects to display them on Tkinter GUI. However, the function PIL.ImageTk.PhotoImage() experiences around 800 ms peaks that result in serious drops in frame r...
more »

2017-03-11 17:03 (0) Answers

lvalue And rvalue Return Types For Efficiency

Update: So, as per the comment by Jean, I have looked at this link. This is actually pretty close to the question I am asking. The only difference is that it deals with Classes explicitly (which cv::UMat undoubtedly is); However, would the func...
more »

2017-03-08 20:03 (3) Answers

OpenCV Mat image data structure

I have an image that has been processed throw: //UIImage to Mat cv::Mat originalMat = [self cvMatFromUIImage:inputImage]; //Grayscale cv::Mat grayMat; cv::cvtColor(originalMat, grayMat, CV_RGB2GRAY); //Blur cv::Mat gaussMat; cv::GaussianBlur( gray...
more »

2017-03-04 02:03 (2) Answers

too many values to unpack, python, findcontours

im working on an OCR project and here I'm doing hand written digit recognition the problem i have is with the function findcontours(): # Import the modules import cv2 from sklearn.externals import joblib from skimage.feature import hog import numpy ...
more »

2017-02-26 16:02 (1) Answers

Remove pairs of values from NumPy array

I have a NumPy array contours that I got from cv2.findContours and flattened using contours = np.concatenate(contours, axis = 0). It stores coordinates of contours of objects from an image. However, I want to delete coordinates whose either X or Y is...
more »

2017-02-19 16:02 (1) Answers

Remove background of the image using opencv Python

I have two images, one with only background and the other with background + detectable object (in my case its a car). Below are the images I am trying to remove the background such that I only have car in the resulting image. Following is the code...
more »

2017-02-17 10:02 (1) Answers

OpenCV ROI background padding

I am trying to focus on a Region of Interest on the face by using Numpy cropping. For large images, I have no trouble. But for smaller ones, I can find the face and find the matching bounding box, but when I try to crop it and show the image, I get a...
more »

2017-01-13 00:01 (0) Answers

Opencv Different Outputs with imshow and imwrite

I read two images into numpy arrays using open cv. I tried two different equations for adding these images Equation 1: img = (img_one/2) + (img_two/2) Equation 2: img = (0.5*img_one) + (0.5*img_two) Equation 1 outputs image as expected, bu...
more »

2017-01-08 09:01 (1) Answers

Average face - algorithm

Quesion and code is at the end I hope this question belongs here and not to the TCS's stack. I am trying to go through algorithms in Turk and Pentland's "Eigenfaces for Recognition". On page 74 one can read (last paragraph of left column): Let t...
more »

2017-01-03 22:01 (1) Answers

Wrong Python 2 libraries in CMake

I am using CMake to build and install OpenCV on my computer running MacOS with python. When I try to specify the python 2 libraries path in CMake, the output always seems to use the wrong file. In my specifications, PYTHON2_LIBRARY=/usr/local/Cellar...
more »

2017-01-02 04:01 (1) Answers