Ask Your Question

eshahnazi's profile - activity

2016-09-01 08:21:43 -0600 received badge  Peer Pressure (source)
2016-08-31 00:33:49 -0600 answered a question how to match paper sheet by opencv

hello you can this method;

GaussianBlur
convert to gray
convertTo
set threshold
calchist
comparehist

but i think image are highquality

2016-08-29 07:43:48 -0600 asked a question Suggest a method for detecting & tracking irregular polygon

hello

i want detect & track Irregular polygon in this picture(one frame of video).

please Suggest a method for detecting & tracking irregular polygon. And How to get the coordinates of the center of the polygon?

for detect pupil i use this method:

cvtColor
convertTo
resize frame { / }
dilate
erode
framepupil=~framepupil;
threshold
erode
resize frame { * }
framepupil=~framepupil;
dilate
framepupil=~framepupil;
dilate
threshold
morphologyEx (MORPH_GRADIENT)
threshold

image description

image description

2016-08-29 07:24:34 -0600 commented answer calibration between mouse move & pupil move (eye writer)

this jumps because of bad pupil detection and not related jumps mouse. i use houghcircles for detection pupil that It seems not suitable. In your opinion, what is the proper way to identify pupils in the photo below? /* pupil image */ thanks

2016-08-29 06:06:55 -0600 commented answer calibration between mouse move & pupil move (eye writer)

dont need change value...for anyone sstr<<1.2*x_pos; & sstr2<<0.9*y_pos; &

 if (xx>20 || yy>20){
        (circles[i][0])=(circles[i][0])*(2);
        (circles[i][1])=(circles[i][1])*(2);

is Fixed.

2016-08-29 04:11:07 -0600 received badge  Self-Learner (source)
2016-08-28 08:21:34 -0600 answered a question calibration between mouse move & pupil move (eye writer)

hello MR @StevenPuttemans i can Coordinate mouse move & pupil move...it very easy..!!! just i change this code:

sstr<<1.2*x_pos;
xcord = sstr.str();
sstr2<<0.9*y_pos;
ycord = sstr2.str();

1.2 & 0.9 is Multiple desktop to start the coordinate . (google translate!!!) before this Multiple is 5, As a result of moving the mouse was missing. with my code i dont need calibration!!! just use this code for control mouse move:

int xx=(circles[i][1])-x;
x=(circles[i][1]);
xx=abs(xx);
int yy=(circles[i][1])-y;
y=(circles[i][1]);
yy=abs(yy);

if(circles.size()!=0 ){ //اگر دایره ای در تصویر تشخیص داده شد شرط اجرا شود
    if (xx>20 || yy>20){
        (circles[i][0])=(circles[i][0])*(2);
        (circles[i][1])=(circles[i][1])*(2);
         mousemove((circles[i][0]),(circles[i][1]));}}

Unfortunately, my English is not good otherwise I wrote a fuller explanation.

my project code ; https://github.com/Ehsan-Shahnazi/ video of my project: https://www.youtube.com/user/eshahnazi very thanks mr@StevenPuttemans

2016-08-26 07:32:40 -0600 commented answer calibration between mouse move & pupil move (eye writer)

with change this code;

if(circles.size()!=0){
        (circles[t][0])=(circles[t][0])*((circles[t][0])/10);
        (circles[t][1])=(circles[t][1])*((circles[t][1])/10);
        mousemove((circles[t][0]),(circles[t][1]));
        }

I multiplied a constant factor ( this code: ( *((circles[t][0])/10); )) with center eye coordinates. in this case, the range of mouse move is large...It is true?

However, moving the mouse will be very fast and With noise.

if i can reduce noise, in this case Program is complete (Approximately)...!!

2016-08-26 07:01:56 -0600 commented answer calibration between mouse move & pupil move (eye writer)

i have coordinates of right eye area (not pupil area). The following code

croppedRectangle2=Rect(eyes[t].x,eyes[t].y+40,eyes[t].width ,eyes[t].height-40);

can i use this coordinates (right eye area) for calibration?? example coordinates right eye area is A rectangle with a length and width 80*100px.

2016-08-26 06:52:11 -0600 commented answer calibration between mouse move & pupil move (eye writer)

yes. you are right. How should I calibration between those positions and the image positions. Do you have code samples? thanks

2016-08-26 06:51:47 -0600 received badge  Supporter (source)
2016-08-26 05:03:50 -0600 received badge  Enthusiast
2016-08-25 23:39:13 -0600 received badge  Editor (source)
2016-08-25 23:35:58 -0600 asked a question calibration between mouse move & pupil move (eye writer)

hello i write program for detect face & then detect Right eye & then detect pupil (circle hough) Finally move mouse.

The problem I have is that ‌Move the mouse range is low. the range of motion mouse is 20 x 20 pixels. Mouse cursor moves only in a very small area of the desktop.

I need Mouse cursor moves in all area of the desktop.

This code get the coordinates of the center of the circular Hough and then cursor is moved .

......
......
.....

 void mousemove(int x_pos, int y_pos)
{
    ///Strings that will contain the conversions
    string xcord; string ycord;

    ///These are buffers or something? I don't really know... lol.
    stringstream sstr; stringstream sstr2;

    ///Conversion to regular string happens here
    sstr<<5*x_pos;
    xcord = sstr.str();
    sstr2<<5*y_pos;
    ycord = sstr2.str();

    ///Getting the command string
    string command = "xdotool mousemove " + xcord + " " + ycord;

    ///Converting command string to a form that system() accepts.
    const char *com = command.c_str();
    system(com);
}


int main()
{
    CascadeClassifier face_cascade("/home/elinux/opencv-3.1.0/data/haarcascades_cuda/haarcascade_frontalface_alt2.xml");
    CascadeClassifier eye_cascade("/home/elinux/opencv-3.1.0/data/haarcascades_cuda

/haarcascade_righteye_2splits.xml");
    ....
    ....
    ...
morphologyEx(framepupil, morph_grad, MORPH_GRADIENT,se,Point(-1,-1),1);
HoughCircles(morph_grad,  circles,  HOUGH_GRADIENT, 1,  1000,  100,15, 10,20);
if(circles.size()!=0){
        (circles[t][0])=(circles[t][0])*((circles[t][0])/10);
        (circles[t][1])=(circles[t][1])*((circles[t][1])/10);
        mousemove((circles[t][0]),(circles[t][1]));
        }
....
.....
....

Here are the all codes: https://github.com/Ehsan-Shahnazi/EyeWriter/blob/master/22-22.cpp

How should calibration between eye positions and cursor positions?? Do you have code samples?

(Perhaps the problem of how to track pupil or codes to move the mouse or...???)

thanks

2016-08-11 08:41:51 -0600 answered a question adding pupil detection

hello have you complete and trust code for pupil detection. thanks