At long last, some Japanese researchers have created an intelligent automatic sliding door. No longer must you wait patiently for the door to slowly judder open; no more must you be frustrated by doors accidentally opening as you walk by them. This intelligent door (video embedded below) even has the ability to match the size of the opening depending on the number of people walking towards it — and if it detects someone running towards it, it slides open at max speed. Yes, this is this glorious realization of the Star Trek sliding door that opens just in time for you to cross the threshold. (But no, sadly, it doesn’t make a whoosh sound. At least not yet…)

To be honest, given just how common automatic doors have become, and how awful they are in operation, I’m amazed that it took this long for some researchers to devise a better solution. Current automatic sliding doors are incredibly dumb things that generally only have two functions: If someone or something triggers the infrared sensor in front of the door, it opens — and if someone triggers the infrared sensor across the door’s threshold, it will stay open so that no one gets crushed. Because pretty much anything can trigger the infrared sensor, it’s usually pointed down at a fairly sharp angle so that only people standing near the door will open it — which is what causes the sometimes-agonizing delay of waiting for the door to open wide enough for you to enter. Another big problem is people walking across the face of the door without intending to walk through it, which can be very annoying and a big waste of heat/cold.

The solution, as you can probably imagine, is equipping an automatic door with a much more complex sensor — and that’s exactly what researchers at Japan’s University of Electro-Communications and Hokuyo Automatic Co. have done. They’ve basically taken a normal automatic sliding door, and outfitted it with a 3D time-of-flight Kinect-like sensor. This sensor, coupled with some computer vision algorithms, can detect and track people near the door. If it senses that you’re walking towards the door, it times the opening perfectly for your arrival at the aperture — if it senses that you’re running towards the door, it opens much faster. If there’s a large group of people walking towards the door, it opens all the way — and if you’re merely walking by the door, it stays closed. Clever stuff.

According to IEEE Spectrum, this isn’t just some lab-based tech demo either — the sensor was designed to work in total darkness and bright sunlight, and the computer vision software can compensate for bad weather and other forms of interference. The caveat, though, is that the sensor — in its current form — would add around $1000 to the cost of an automatic sliding door. That might sound like a lot, but commercial sliding doors are already very expensive (think thousands of dollars), and the cost of electronics always comes down rapidly. Plus, given how much heating/AC energy would be saved by an intelligent sliding door, and the increased happiness of customers, I suspect the $1000 would pay for itself rather quickly.

So, there you go. The Star Trek dream of having a sliding door always open at exactly the right time for you to pass through it, making you feel like some kind of omnipotent deity, is suddenly very close to reality.

The research, “Development of Intelligent Automatic Door System,” was presented last week at the 2014 IEEE International Conference on Robotics and Automation (ICRA) in Hong Kong.