Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] post-hoc pygaze webcam tracker?

edited February 2015 in PyGaze

Hi there,

I'm wondering if there's any straightforward way to use PyGaze with existing HD videos of faces to get pupil dilation sizes automatically, without using an eye tracker? The videos are 1080p60 and so the pupil size is very easy to manually determine... but I've never used eye tracking before so have no idea if one can automate the measuring without having an eye tracker present that projects an infrared light.

any ideas?
thanks!
Sam

Comments

  • edited February 2015

    Hi Sam,

    Post-hoc image processing is quite possible indeed! You could use the same approach my webcam pupil tracker does, perhaps even by tweaking the code to load images from a video rather than a webcam.

    The approach is as follows:

    1) Set a darkness threshold for the entire image

    2) Use the threshold to binary mask the image (e.g. code 0 for 'darker' and 1 for 'lighter')

    3) Every connected area in the 'darker' category could be the pupil

    4) Indicate the actual pupil by clicking on it

    5) Set the size of the (moving!) window in which the pupil may be detected

    6) Only allow for limited movement of the pupil, so we can be relatively sure that the connected darker area we are currently following is in fact the pupil (and not, for example, an eyebrow)

    Cheers,

    Edwin

  • edited 12:49PM

    Thanks, Edwin! This is exactly what we were hoping for. I wonder: have you tried different lighting setups? Maybe a soft light directed toward the face might be best?

    And this is just from a raw webcam image, right? From what I gather it doesn't require a bunch of infrared lights or anything, which is super elegant. We'll be using a super high quality camera which likely will be able to really differentiate in color between the pupils and hair (for instance).

    Sam

  • edited 12:49PM

    also, one question on the pupillometry: what happens if your head moves toward the camera, but pupil dilation remains constant? does the reported pupil size change? or is it getting the raw size from some immobile face locations like tip of nose or something?

    thanks!
    Sam

  • edited 12:49PM

    Hi Sam,

    For pupil tracking, the lighting is usually best if the participant is not illuminated too much, preferably using a diffuse light source. Directing a light directly towards the face might result in a massive reflection that obscures the pupil.

    The current code does indeed depend on an image from a webcam, which has been converted to a PyGame Surface. So should you want to replace the webcam stream with a video, all you need to figure out is how to convert the images in your video to PyGame Surfaces.

    Regarding your questions on the pupil tracker: If you move closer to the screen, the pupil size will increase. Please note that this is not very sophisticated software, it really just does what I described above. So there's no fancy way of estimating the distance between head and camera. For more info, see this page on my website.

    Cheers,

    Edwin

  • edited 12:49PM

    Thanks, Edwin! Sounds great.

    We have some friends in the vision lab who may be able to add in some face processing algorithms so that we can adjust the pupil size based on forward/backward head movement. If they come up with anything useful I'll let you know!

    Sam

  • edited 12:49PM

    Would be great, thanks!

    BTW: probably good to point out that OpenCV (for which Python bindings are available) has some built-in face detection, if I'm not mistaken.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games