Skip to main content
Visitor II
December 17, 2018
Question

Is VL53L1X people counting source code available?

  • December 17, 2018
  • 18 replies
  • 7191 views

I saw the VL53L1X used as a people counter video at:

https://www.youtube.com/watch?v=c91Ve-g0J2U

Is the source code used in that video available?

TIA,

    This topic has been closed for replies.

    18 replies

    Visitor II
    February 1, 2019

    I join to question.

    Visitor II
    February 4, 2019

    What is the idea behind people counting using VL53L1X sensor Since this sensor is used for measuring the distance. How to detect whether the obstacle is people or not?

    Visitor II
    February 4, 2019

    I guess they use more than one ROI SPAD regions, but it is beyond current API

    Visitor II
    February 5, 2019

    I did it! It is very simple.

    Unlike ST I will not keep mysterious silence and will publish the code after some tests.

    Visitor II
    February 5, 2019

    This example illustrates direction recognition with the single VL53L1X TOF sensor. Two Regions Of Interest(ROI) are defined in SPAD sensor array:

     ROI1 ROI2

    0,15___12,15 

     ####----####

     ####----####

     ####----####

     ...

     ####----####

     ####----####

    _____3,0 _____15,0

    Data measurements distance0 and distance1 cyclically readed from both ROIs, switching them on the fly.

    Then STM32duino_Proximity_Gesture library used for event interpretation.

    To suit Arduino requirement I added necessary library description to Pololu vl53l1_api.

    Also, to handle handMustCoverBoth parameter support in STM32duino_Proximity_Gesture library, I had to slightly modify tof_gestures_DIRSWIPE_1.cpp and tof_gestures_DIRSWIPE_1.h. Both libraries are included in this bundle.

    This code is for WEMOS D1 mini Lite, but with board and pins adjustments will work with any Arduino.

    Data outputs to serial @115200 and to OLED. For investigations and adjustments it is suitable to use SerialPlot: https://bitbucket.org/hyOzd/serialplot.

    Files here:

    https://yadi.sk/d/UIIAXFol3P_jXg

    Video here: 

    https://www.youtube.com/watch?v=_ZjAZ7eieNM0690X000006DO9dQAG.jpg0690X000006DO9TQAW.jpg

    Visitor II
    February 6, 2019

    Thanks for sharing your source code. I am using Nucleo - F401RE board with VL53L1X sensor. Is it possible to use this code in stm nucleo board?

    Visitor II
    February 6, 2019

    Sure.

    You can adapt SimpleRanging example code (from STM32CubeExpansion_53L1A1_V2.0.1) to suit the task.

    Visitor II
    February 6, 2019

    Actually my doubt is when the sensor detects something , how we identify its a people or not. This sensor detects anything so how we distinguish them?

    CNievAuthor
    Visitor II
    February 7, 2019

    Thanks for sharing! This is very interesting!

    I understand you made some changes to standard libraries.

    Have you considered submitting a patch so it gets integrated in the library?

    Visitor II
    February 7, 2019

    No, but "Both libraries are included in this bundle."

    Visitor II
    February 11, 2019

    In that people counting video, they have shown that they have specified some person detection distance range. How this range can be obtained?

    Visitor II
    February 11, 2019

    How they did it I do not know as their code is not available.

    In my variant range defined as:

    int tof_gestures_initDIRSWIPE_1(int32_t rangeThreshold_mm, long minSwipeDuration, long maxSwipeDuration, bool handMustCoverBoth, Gesture_DIRSWIPE_1_Data_t *data)

    ST Employee
    April 8, 2019

    Hi,

    The source code is not available yet on www.st.com but will be made available in the coming weeks.​

    If you can't wait please email me : philippe.legeard@st.com

    Visitor II
    April 9, 2019

    Basing on the current ST answer-speed, we could estimate appearing of the source code in the next few years.