Need help In using and executing Face Recognition by OpenCV - c++

I am currently trying to work on Face Recognition by OpenCV, in Visual Studio.
I am using the code by OpenCV tutorial.
I executed the code, and it compiled without any errors.
I am unable to see any output. Do I have to create a CSV file to execute this code? If so, how do I go about it? .
Please help me in this regard.

The OpenCV tutorial page gives all steps for face recognition in details, which contains 3 main steps:
Preparing the data.
Creating the CSV File.
Use the code shown in the page to train and test.
You're probably missing the 1st and 2nd steps.

Related

How to install Qt to work with OpenCV and Visual Studio 2022

I am sorry if this question is already asked but, from every source I have read on google so far they don't cover the most latest versions and I am having a lot of trouble figuring this out.
I have a VS code for detecting faces and saving the ROI onto the desktop. Now, I need to add the functionality for force capture and need to employ GUI for it which openCV is not good enough for. I have been told to use Qt. For more than a week now I have been stuck at simply installing Qt and getting it to work. If anyone could help me out in-line with my project's purpose I would greatly appreciate it.
Every time I install I get some sort of different error which I am not able to understand (complete beginner here), the latest one I got was that Qt could not find the "Kit", even though the dialog box displayed the available ones (Mingw 2022).
Thanks in advance!

How to use soft cascade in the latest opencv

I have already download the latest opencv from github and successed compile it. I notice that the latest version realize the soft cascade algorithm and I want to test it. But I don't know how to detect a pedestrian use this method. Is there anybody know it? My platform is vs2010+win64+opencv3.00 ,
Briefly, the problem is that I don't know how to load the existing xml file to scascade. I try the load function but the param is Filenode. If there is anbody who know it can you tell me?

OpenCV imshow() does not work

I have written an openCV code and my code has following statement:
cv::imshow("Matches", matchesImg);
cv::waitKey(0);
When I run the code either in Debug or Release I am not able to see window which shows me the output.
And this is happening for every project I create.
Not able to figure out the reason, Can someone please guide me on this?
I am coding on Windows 7 and Visual studio 2010, with opencv version of 2.4.6
As I mentioned in the comments, you have to create a window first, using namedWindow with the same window name as in imshow
See this tutorial for details.
EDIT
This strongly suggest that you have to create the window beforehand.
Some may argue that it didn't work this way for previous versions of OpenCV. Then, let's say this solution apply at least to OpenCV 2.4.6, which is the version of concern here (and it solved the problem).

OpenCV - How do I get started?

I just don't seem to be able to get OpenCV to work properly. Here's what I want to accomplish:
Use CodeBlocks (which I installed using codeblocks-10.05mingw-setup.exe) with OpenCV (installer: OpenCV-2.4.2.exe) on my Windows x64.
I've tried a lot of different configurations which will only bother you if I posted them all, so I hope you don't mind if I just ask the simple question: how do I get this to work?
I think I'm missing the smallest detail right now, so a detailed description of how to get started would be welcome.
If the OpenCV installer did the job, you should have by now OpenCV libraries and headers already installed in your system.
I would then go ahead and try to compile a hello world basic code, like the one you can get from here. If you would like to program using an IDE, like VisualC++ in Windows, you can follow this guide that will help you setting up the environment.
OpenCV team just introduced their new web site. There you can find Introduction to OpenCV section with installation instructions, including detailed instructions for Windows. Don't forget to cleanup your system before installation to avoid problems with mixing different install options. If you still can't get it working with CodeBlocks, follow Dan's advice and try compiling from command line.
When you are done with installation, go on and read there great new tutorials!

Using FreeType2 with OpenGL on Xcode 4

I am currently using Xcode 4.2.1 on OSX Lion 10.7.2 and I am trying to use my own font (MankSans.ttf) to display a string on the screen with OpenGL. I tried following the tutorial on this site:
http://www.freetype.org/freetype2/docs/tutorial/step1.html
But it doesn't seem to work with Xcode 4.2.1. I have also tried looking at other sites, but they also have not worked for me. Is there any easier way other than using FreeType2 to load your own font, or is this the only way? If someone could, can you post your own code if you have been successful with using FreeType2?
Thanks
You can't just (mindlessly) paste those code snippets from the tutorial text into a source file. Seriously people, aren't you reading and trying to understand what's happening in a code snippet, and what may be missing? Those ellipses (that's this -> '…') are a clear indicator that's this is not a fully working piece of code.
At the end of the tutorial there's written the following:
A complete source code example can be found here.
So why didn't you just grab this source file?