Face detection and image preview drawing - c++

I'm developing application that uses DirectShow combined with C++.
Its main goal is to capture users' faces.
I have reached the phase when I capture a image from my webcam.
The problem is I need an intelligent render. In fact, I need that render to be able to detect a face inside a rectangle.
I'm wondring if there is a filter that I can use for this purpose,
or if I need to create my own custmized filter.
If so enlighten my mind.
It would look like this:
I need to understand how I can draw a recangle in my render in the first place. Because otherwise, even if I know the algorithm, I will not be able to apply it. This is my main goal now.
I have some idea but I don't know if they are correct. I think I need to grab each frame separately and apply some modification in some pixels, like what's drawn in the live render.

Have a look at OpenCV
Quick look inside and I found this.
Making your own "filter" that works well is no easy job.

Are you talking about automatic detection of where there is something like a human face in the shot you have taken with the webcam? In this case object detection algorithms like Viola-Jones might be interesting for you.

If a commercial package is an option, you can use the Montivision Filter SDK which includes filters that should do the job out of the box. They offer a free eval which is perfect for experimentation.

Related

How to make such animation in After Effects

I have the basics of AE but I don't know everything, I would like to make an animation like the one in the link, with phone, if someone can tell me where to find such tutorial then that would be great. The animation of the phone is my main problem, it looks like a 3d model in sketch style. https://www.planradar.com/wp-content/uploads/2019/05/iPad_EN-1.mp4
First of all you need vector paths for drawing the tablet/phone it the style you have shown. (like in this video https://youtu.be/zSlXOIsfjLY?t=123)
Next you just need to put that all in 3D via camera settings and each layer as an 3D object and work this out step by step.
I think you should find many examples on youtube for what you are looking for.

MOG2 background subtraction Parameters

I am trying to use the OpenCVs Background Subtractor class MOG2 to seperate a person moving infront of a camera. I got everything set up and working nicely. But the resulting mask I am getting looks something like this:
(default settings)
Now what I would like to get is something like this:
(bad gimp skills :D)
I have already tryed to mess around with the parameter described in the docu, but all I managed to accomplish was something the looked like a motion blur effect...
So I was hopeing somebody with a better understanding of the algorithm or somebody who has already done something similar might be able to help me!
Thanks in advance, Foaly
I am working also with that and what I've seen is that this algorithm needs a good calibration to accomplish that goal, because you should be aware that this algorithm try to put in the background some pixels that don't show changes, e.g. in your skin major part of the pixels have the same color maybe this is the reason. I recommend to you that use other kind of methods (using zncc) if you want to use an application like the one that is showed in your question.
So I guess this were our image processing skills come into play. The first thing I would do is make the lines on the image thicker and join it it. We can use the following:
1) I would want the lines thicker. Use Morphological operators tutorial on Morphological operators with Otsu's method. This paper worked for me when I did my ear biometrics http://www4.comp.polyu.edu.hk/~csajaykr/myhome/papers/PR2011.pdf
2) Fill in connected components using opencv and clean the image
3) Segment human profile

Is there a way to compare two hand-drawn drawings?

For an experiment, we are looking for a way to automatically compare two hand (mouse-)drawn images. These images are, for instance, drawn on an HTML5 canvas element and we need some way to see whether the pictures roughly match.
So, if someone draws a house, we need to test whether the second drawing looks like the first house. It doesn't matter what exactly is in the image, but we only need to know whether the two images look alike. I.e., we want to know whether the person drawing the picture, can redraw roughly the same picture. The exact orientations of the lines, the size of the image or the position of the picture on the canvas shouldn't matter.
Is there, by any chance, a library or project that does this?
Yes absolutely
With API provided by Face.com and with imagemagick Both are providing
api's
http://www.imagemagick.org/api/compare.php
FaceAPI - Track Faces from a Webcam: http://faceapi.com
it might be useful for your requirement
Ultimately, we didn't find a library that does exactly the same, so we have modified the original project's goals and have crowdsourced the comparison that needed to be done.
You can probably also use Mechanical Turk or something similar for the time being, depending on how much you wish to pay for it.
I think researchers are currently be working on technical solutions to the issue described above.

Augmented Reality-PC

I recently saw the virtual mirror concept on you tube, I tried it out and researched about it. It seems that the creators have used augmented reality so that people can see the output on their screens. On researching I found out that we identify a pattern on which a 3D image is superimposed.
Question 1:How are they able to superimpose the jewellery and track the face of the person without identifying any pattern?
I also tried to check various libraries that I can use to make a program similar to the one they show. Seems to me that a lot of people are using Android phones and iPhones and making apps that use augmented reality.
Question 2:Is there any way that I can use c++ and try to make a program that uses augmented reality?
Oh, and the most important thing, the link to the application is provided below:
http://www.boutiqueaccessories.com.au/virtual-mirror/w1/i1001664/
Do try it out. Its a good experience. :D
I'm not able to actually try the live demo, but the linked video suggests that they either use some simplified pattern recognition (get the person's outline), or they simply track you based on the initial image (with your position/texture being determined by the outline being shown.
Following the video, it's easy to see that there's no real/advanced AR behind this. The images are simply overlayed or hidden (e.g. in case it's missing track of one ear due to you looking to the side) and they're not transformed (no perspective or resizing happening). They definitely seem to track the head (or features like ears, neck, etc.). depending on your background and surroundings that's actually a rather trivial task.
Question 2: Sure! There are lots of premade toolsets out there, but you could as well use some general image processing library such as OpenCV to do the math. Augmented reality usually uses some kind of pattern (e.g. a card or page with a known pattern) to determine the correct position and transformation for the contents to be added to the image. There are also approaches using the device's orientation and perspective changes in camera images to determine depth/position (I really like this demo).

Creating SVG image in c++

I want to create a SVG image programmatically using preferably c++ from some image points. Can anyone help me with that?
simple-svg is a header only svg lib easy to use:
simple_svg_1.0.0
Here is an example how to use it: main_1.0.0.cpp
It is also hosted on GitHub.
You could check out LibBoard. I have no experience with it myself, so I can't vouch for its usefulness, but it does appear to be what you're looking for. I'm not sure how complicated your target image is going to be, but the website states:
For now, LibBoard can handle primitives like lines, rectangles,
triangles, polylines, circles, ellipses and text.
In future releases, bitmap insertion should be supported.
See the TODO file for a list of features that should be added in future releases.
So you'll have basic functionality from it, and you can probably mess around with the basic list of shapes to create some pretty complicated images.
I used GraphViz to do that, using 'dot' language, check it out.