Ask Your Question

Gioz79's profile - activity

2015-07-09 10:42:52 -0600 commented question My LBP face detection does not detect anything, never

Update!

I started to work again on this project after a compelling job. I tried to save Mat s in files as per:

imwrite("test1.ppm", frame); imwrite("test2.ppm", equalized);

but the saved files have width 0! So I think the problem is transforming my UYVY image into an OpenCV frame. I haven't compiled OpenCV with PNG nor JPEG support so I tried to save them as PPM, but for the same reason is it possible that imdecode (see example above) fails for UYVY? Do I need to recompile OpenCV with some support? Some cmake flag enabled? And in this case, which one?

2015-06-08 01:34:50 -0600 received badge  Enthusiast
2015-06-03 07:57:57 -0600 commented question My LBP face detection does not detect anything, never

Yes, sorry, I edited first post after your response. face.empty() is false, so I think it's loaded; and results.size() is always 0

2015-06-03 06:55:10 -0600 received badge  Editor (source)
2015-06-03 06:53:45 -0600 commented question My LBP face detection does not detect anything, never

Thanks for the suggestion! Just did it, and it seems loaded

2015-06-03 06:20:41 -0600 asked a question My LBP face detection does not detect anything, never

Hi to all,

I'm a beginner with OpenCV. A real beginner, I'm at my first real application.

I'm setting up OpenCV for face detection on an embedded device; the face detection will occur an image at a time, image are fed from an external source.

I have read a lot of guides and tutorials, wanting to statically link libs, so I recompiled OpenCV 2.4.11 and finally did it (flags were ALL unchecked apart BUILD_opencv_[calib3d, contrib, core, features2d, flann, gpu, highgui, improc, legacy, ml, nonfree, objdetect, ocl, photo, stitching, superres, ts, video, videostab] and ENABLE_OMIT_FRAME_POINTER; I set CMAKE_BUILD_TYPE to "Release" too).

Now I can compile and run my application using "-lopencv_oobjdetect -lopencv_imgproc -lopencv_highgui -lopencv_core -lrt -lz -lm" as linker flags.

My code is:

CascadeClassifier face("/<full_path>/lbpcascade_frontalface.xml"); // shipped with OpenCV
vector<Rect> results;
unsigned char *data; // contains a frame extracted from a network camera, format is UYVY 640x480
int len; // length of data above
const vector<unsigned char> bytes(data, data + len);
Mat frame(bytes);
frame = imdecode(frame, CV_LOAD_IMAGE_GRAYSCALE);
Mat equalized;
equalizeHist(frame, equalized);
face.detectMultiScale(equalized, results, 1.1, 3, 0, Size(10,10));
if (results.size() > 0) {
  // never gets here :/
}

I redirected stdout and stderr to two files but they stay empty, it seems to work like a charm, but nothing is ever detected. I tried, in many steps, to pass to the above code 1 to 30 images per second, without any errors/complains/exceptions/(other things I don't know what to expect in my noobiness).

Any ideas, suggestions, tutorial that I should have read and I missed?

TIA, Ivan