Lyr3x / Roode

A reliable smart home people counter based on VL53L1X and ESPHome
The Unlicense
149 stars 43 forks source link

Rework ROI detection #36

Open Lyr3x opened 2 years ago

Lyr3x commented 2 years ago

The ROI detection needs to be reworked. It should find the best ROI settings defined by distance and target surface size.

Lyr3x commented 2 years ago

I need to test this thoroughly. I am not sure right now if this will improve things or make them worse. From my latest findings I think the ROI size itself does not matter as much as the target surface material and sensor alignment.

Lyr3x commented 2 years ago

I will remove the rewrite from the v1.3 milestone and will only fix the current implementation. This topic needs further research and in depth testing with various feedback loops.

Lyr3x commented 2 years ago

I implemented a fairly simple change to produce one of the following ROIs

I am not sure right now if that helps in all scenarios and I need to do more testing. Feedback is much appreciated!

Lyr3x commented 2 years ago

ROI center settings must be reworked too as there are three different situations where the ROI center points need to be set. Currently the center is not working properly everywhere

CarsonF commented 2 years ago

New schema suggestion

cv.Optional("roi", default={"height": 16, "width": 6}): cv.Any(
    cv.one_of("auto"),  # formerly "roi calibration"
    cv.Schema({
        cv.Optional("height", default=16): cv.int_range(min=4, max=16),
        cv.Optional("width", default=6): cv.int_range(min=4, max=16),
    })
),

Maybe default switches to auto once the implementation is deemed better