Pupil Center is Jumping a Lot in Real Time Eye Tracking [closed] - image-processing

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed last month.
Improve this question
In my eye tracking project, the pupil center is jumping a lot and I don't see it as a fixed point.
What should I do?
My idea is comparing the pupil center and pupil in 2 frames with a threshold but it doesn't help the problem. Another point is camera noise.
What should I do to reduce the noises?
I used the starburst algorithm.
Starburst: A hybrid algorithm for video-based eye tracking combining feature-based and model-based approaches.

Eye trackers come with 2 types of noise/errors: variable and systematic error. Variable noise is basically the dispersion around the gazed target and the constant drift or the deviation from the gaze target is the systematic noise. For reference, see the following paper:
https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0196348
In your case, its the variable error. Variable error arises due to fatigue, involuntary eye ball vibrations, light, and so on. You can remove it by just filtering the gaze data. However, be careful not to smoothen it too much which might lead to the loss of natural fluctuations inherent in the eye ball.

Related

What is momentum in machine learning? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm new in the field of machine learning and recently I heard about this term. I tried to read some articles in the internet but I still don't understand the idea behind it. Can someone give me some examples?
During back-propagation, we're adjusting the weights of the model to adapt to the most recent training results. On a nicely-behaved surface, we would simply use Newton's method and converge to the optimum solution with no problem. However, reality is rarely well-behaved, especially in the initial chaos of a randomly-initialized model. We need to traverse the space with something less haphazard than a full-scale attempt to hit the optimum on the next iteration (as Newton's method does).
Instead, we make two amendments to Newton's approach. The first is the learning rate: Newton adjusted weights by using the local gradient to compute where the solution should be, and going straight to that new input value for the next iteration. Learning rate scales this down quite a bit, taking smaller steps in the indicated direction. For instance, a learning rate of 0.1 says to go only 10% of the computed distance. From that new value, we again compute the gradient, "sneaking up" on the solution. This gives us a better chance of finding the optimum on a varied surface, rather than overshooting or oscillating past it in all directions.
Momentum see here is a similar attempt to maintain a consistent direction. If we're taking smaller steps, it also makes sense to maintain a somewhat consistent heading through our space. We take a linear combination of the previous heading vector, and the newly-computed gradient vector, and adjust in that direction. For instance, if we have a momentum of 0.90, we will take 90% of the previous direction plus 10% of the new direction, and adjust weights accordingly -- multiplying that direction vector by the learning rate.
Does that help?
Momentum is a term used in gradient descent algorithm.
Gradient descent is an optimization algorithm which works by finding the direction of steepest slope in its current status and updates its status by moving towards that direction. As a result, in each step its guaranteed that the value of function to be minimized decreases by each step. The problem is this direction can change greatly in some points of the function while there best path to go usually does not contain a lot of turns. So it's desirable for us to make the algorithm keep the direction it has already been going along for sometime before it changes its direction. To do that the momentum is introduced.
A way of thinking about this is imagining a stone rolling down a hill till it stops at a flat area (a local minimum). If the stone rolling down a hill happens to pass a point where the steepest direction changes for a just moment, we don't expect it to change its direction entirely (since its physical momentum keeps it going). But if the direction of slope changes entirely the stone will gradually change its direction towards the steepest descent again.
here is a detailed link, you might want to check out the math behind it or just see the effect of momentum in action:
https://towardsdatascience.com/stochastic-gradient-descent-with-momentum-a84097641a5d

straight line detection from a image [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am doing a project which is hole detection in road. I am using a laser to emit beam on the road and using a camera to take a image of the road. the image may be like this
Now i want to process this image and give a result that is it straight or not. if it curve then how big the curve is.
I dont understand how to do this. i have search a lot but cant find a appropriate result .Can any one help me for that?
This is rather complicated and your question is very broad, but lets have a try:
Perhaps you have to identify the dots in the pixel image. There are several options to do this, but I'd smoothen the image by a blur filter and then find the most red pixels (which are believed to be the centers of the dots). Store these coordinates in a vector array (array of x times y).
I'd use a spline interpolation between the dots. This way one can simply get the local derivation of a curve touching each point.
If the maximum of the first derivation is small, the dots are in a line. If you believe, the dots belong to a single curve, the second derivation is your curvature.
For 1. you may also rely on some libraries specialized in image processing (this is the image processing part of your challenge). One such a library is opencv.
For 2. I'd use some math toolkit, either octave or a math library for a native language.
There are several different ways of measuring the straightness of a line. Since your question is rather vague, it's impossible to say what will work best for you.
But here's my suggestion:
Use linear regression to calculate the best-fit straight line through your points, then calculate the mean-squared distance of each point from this line (straighter lines will give smaller results).
You may need to read this paper, it is so interesting one to solve your problem
As #urzeit suggested, you should first find the points as accurately as possible. There's really no way to give good advice on that without seeing real pictures, except maybe: try to make the task as easy as possible for yourself. For example, if you can set the camera to a very short shutter time (microseconds, if possible) and concentrate the laser energy in the same time, the "background" will contribute less energy to the image brightness, and the laser spots will simply be bright spots on a dark background.
Measuring the linearity should be straightforward, though: "Linearity" is just a different word for "linear correlation". So you can simply calculate the correlation between X and Y values. As the pictures on linked wikipedia page show, correlation=1 means all points are on a line.
If you want the actual line, you can simply use Total Least Squares.

Detect Low Light Condition and FaceRotation Angle in Degrees in Real-Time FaceDetection IOS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
I am writing an iOS app that will do real-time face-detection using iPhone's Front camera.
In it, I need to check whether the lighting is proper or not. Like checking for "low light condition" or is left half light is more than right half light or vice versa.
I am checking both OpenCV on iOS and the iOS default face-detction using CIDetector for one week but I am unable to find the solution.
Any Ideas or samples will be helpful.
In the same project iam using CIFaceFeature+FaceRotation to detect the face rotation angle its returning -1 to +1 values, but i need to show the values in 0 to 180 degrees (like user face is tilted 30 degrees)
Thanks.
You can check below link it might not actually solve your problem but yes it can give you an idea about luminosity of ios camera image for the starter:
https://www.transpire.com/insights/blog/obtaining-luminosity-ios-camera/
generally, checking for "low light condition" could use statistic methods like:
thanks spider1983
or histogram things.
for "left half light is more than right half light or vice versa. ", if you are meaning the left half of the face.
I don't think ios face detection api helps. you can't get where is exactly the left face, the eyes, the nose... with face detection only.
face detection gives you, "OK, here is a face, roughly this size"
check these methods for more detail face modelling.
asm1 asm2
also, check this interesting latest challenge: ICCV2013

Closed eye detection opencv C++

I need to detect closed eyes only and also both eyes separately. That means I need to tell if left eye is open or closed, also same about the right eye.
I tried few ways. One of them is to detect eyes with haarcascade_eye and haarcascade_eye_tree_eyeglasses separately and then compare the results. If both detect eye, then eye open, if one detect and another can't,then eye closed. This trick was taken from this link:
http://tech.groups.yahoo.com/group/OpenCV/messages/87666?threaded=1&m=e&var=1&tidx=1
But it doesn't work as expected.eye cascade detectors don't work as mentioned in the link. Much close results are found with those haarcascade that I mentioned above. Sometimes it gives correct result, sometimes it can't. I don't know why. Besides it can't be told with this method that which eye is open and which eye is closed.
Now can someone help me to solve this?? At least I need a way to tell that one of the eyes is closed regardless which one and need to do that accurately. Please help.......
If you want to avoid training your own Haar cascade to detect a single eye, you can attempt simpler techniques such as pupil detection. If you fail to detect a black circle, the eye is closed. If you have a smallish region of interest, this probably works very well. Another option would be color histograms of the eye region, which may look pretty different for the open and closed state.
If you cannot predict with reasonable accuracy where the eyes can be found in the image, these approaches are doomed and your best shot is training your own cascade I think.

best Segmentation algorithm [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm trying to develop a system, which recognizes various objects present in an image based on their primitive features like texture, shape & color.
The first stage of this process is to extract out individual objects from an image and later on doing image processing on each one by one.
However, segmentation algorithm I've studied so far are not even near perfect or so called Ideal Image segmentation algorithm.
Segmentation accuracy will decide how much better the system responds to given query.
Segmentation should be fast as well as accurate.
Can any one suggest me any segmentation algorithm developed or implemented so far, which won't be too complicated to implement but will be fair enough to complete my project..
Any Help is appreicated..
A very late answer, but might help someone searching for this in google, since this question popped up as the first result for "best segmentation algorithm".
Fully convolutional networks seem to do exactly the task you're asking for. Check the paper in arXiv, and an implementation in MatConvNet.
The following image illustrates a segmentation example from these CNNs (the paper I linked actually proposes 3 different architectures, FCN-8s being the best).
Unfortunately, the best algorithm type for facial recognition uses wavelet reconstruction. This is not easy, and almost all current algorithms in use are proprietary.
This is a late response, so maybe it's not useful to you but one suggestion would be to use the watershed algorithm.
beforehand, you can use a generic drawing(black and white) of a face, generate a FFT of the drawing---call it *FFT_Face*.
Now segment your image of a persons face using the watershed algorithm. Call the segmented image *Water_face*.
now find the center of mass for each contour/segment.
generate an FFT of *Water_Face*, and correlate it with the *FFT_Face image*. The brightest pixel in resulting image should be the center of the face. Now you can compute the distances between this point and the centers of segments generated earlier. The first few distances should be enough to distinguish one person from another.
I'm sure there are several improvements to the process, but the general idea should get you there.
Doing a Google search turned up this paper: http://www.cse.iitb.ac.in/~sharat/papers/prim.pdf
It seems that getting it any better is a hard problem, so I think you might have to settle for what's there.
you can try the watershed segmentation algorithm
also you can calculate the accuracy of the segmentation algorithm by the qualitative measures

Resources