<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Razvan Tataru on Medium]]></title>
        <description><![CDATA[Stories by Razvan Tataru on Medium]]></description>
        <link>https://medium.com/@razvantataru?source=rss-42facdb89a8d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4wY04upx3ZO2TMoJ.</url>
            <title>Stories by Razvan Tataru on Medium</title>
            <link>https://medium.com/@razvantataru?source=rss-42facdb89a8d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:58:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@razvantataru/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Improving road safety for cyclists with a Raspberry PI]]></title>
            <link>https://medium.com/@razvantataru/improving-road-safety-for-cyclists-with-a-raspberry-pi-846831981518?source=rss-42facdb89a8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/846831981518</guid>
            <category><![CDATA[hardware]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[road-safety]]></category>
            <category><![CDATA[bicycles]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Razvan Tataru]]></dc:creator>
            <pubDate>Wed, 18 Jan 2023 08:40:55 GMT</pubDate>
            <atom:updated>2023-01-18T08:40:55.328Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yF8DYDy4BKZgPpjdqqmklQ.png" /></figure><p>Cycling as a mode of transportation has several advantages. Cycling is becoming more popular, thanks to the healthier lifestyle and improved bike efficiency in crowded cities. Although cycling is a well-liked and environmentally friendly form of transportation, it can be risky when sharing the road with automobiles. This article will cover the causes, mechanisms, and preventative measures of accidents that occur in this scenario.</p><h3><strong>Hidden risks for Cyclists in Cities</strong></h3><p>In addition to pedestrians, cyclists are the second-deadliest form of mobility in cities. The biggest drawback of this mode of transportation is how dangerous it is to bicycle.</p><p>Due to the public perception of cycling as risky, people are increasingly viewing bicycles as a fun activity instead of a mode of transportation. Bicycle safety measures are becoming increasingly widespread due to the trends showing significant growth in bicycle use worldwide.</p><ul><li>Around 25,600 individuals died in traffic accidents in the EU in 2016.</li><li>8% of all fatal traffic accidents in EU nations occurred while riding a bicycle in 2016.</li></ul><p>As the cyclist is frequently concealed in the driver’s unseen area, which is the portion of the vehicle’s side that the driver cannot view through the side mirror or the back window, this is a recurring problem. Other cars may potentially block the cyclist’s view.</p><p>Because of this, an accident may happen if the driver does not notice the cyclist before it is too late. This could result in the rider suffering severe injuries or perhaps dying, as well as causing harm to the car.</p><p>The primary reason for this kind of accident is careless driving. The majority of bicycle collisions occur when the rider loses control of the bicycle and falls. Local governments can stop these accidents by creating a more dependable riding infrastructure, such as dedicated roadways and distinct bike lanes. The majority of the time, drivers do not have enough vision of bikers or do not spot them quickly enough. Other causes include drivers or cars that run red lights or cyclists who don’t give priority.</p><h3>Dooring accidents</h3><p>When a car door opens into a bicyclist’s course, the incident is known as a “dooring accident.” These mishaps happen when the driver or a passenger of a parked car opens the door into the path of a bike heading toward them, resulting in a collision. The rider may sustain severe injuries.</p><p>The fact that dooring accidents frequently occur abruptly and at high speeds is one of the main factors contributing to their extreme danger to cyclists. Given their potentially high rates of speed, cyclists might not have enough time to react or steer clear of the open door. Additionally, bikers may be more prone to sustain serious injuries in an accident with a car door. Dooring accidents are dangerous due to several factors, they frequently take place in cities with dense populations of both cars and bicycles. This raises the risk of several collisions and injuries that a bicycle will run into an open car door.</p><h3><strong>Presenting a Low-Cost, AI-Powered Safety System for Cyclists</strong></h3><p>The method makes use of a Raspberry Pi Zero board, a reasonably priced device that can be easily configured to carry out a wide range of tasks. In this instance, a camera and the Raspberry Pi board are selected to collect footage of a car’s side mirror. The board is connected to one of the existing car’s electronic keys and prevents dooring accidents by locking the doors if an accident is predicted.</p><p>This approach is relatively easy to put into practice.</p><ul><li>A Raspberry Pi board and a camera are first acquired, then they are attached to the car’s onboard computer / electronic access key.</li><li>Then, a Pi Camera records the side mirror regularly and the stream is sent to an image recognition model to find a cyclist.</li><li>The Raspberry Pi board alerts the car’s onboard computer when a bicycle is seen in the side mirror, and the car’s left/right doors are then momentarily locked as a result.</li><li>This stops the driver from unintentionally unlocking the door and running into the cyclist.</li></ul><p>As it encourages drivers to be more conscious of their vicinity and stops them from unintentionally opening their doors to approaching bicycles, this approach has the potential to significantly lower incidents involving cyclists. Additionally, it is accessible to a broad spectrum of people due to its low cost, simplicity of implementation, and ability to be combined with existing automobiles. The detection system creates a more secure environment for commuting cyclists, which will encourage more people to use bicycles as a healthier form of transportation. Using a specialized camera sensor, the safety system records the sides and rear of the road. A neural network algorithm then analyses the video feed to identify approaching bikers and, in an emergency, locks the driver’s door. The Raspberry Pi Model 3 device is used to construct the computing device.</p><h3>Some Implementation details</h3><figure><img alt="A high level design scheme" src="https://cdn-images-1.medium.com/max/376/0*g3G0idRIVFfnRwnV" /></figure><p>The device is linked to a remote control that has been modified, which will issue a signal to the central locking system, quickly closing the corresponding door and avoiding a dooring accident between the rider and the driver. The following frameworks and tools were used to develop the device:</p><ul><li><a href="https://mxnet.apache.org/versions/1.9.1/">Apache</a> MXNet deep learning framework.</li><li><a href="https://opencv.org/">OpenCV</a> computer vision library.</li><li><a href="https://pypi.org/project/RPi.GPIO/">GPIO</a> framework for connecting with physical pins.</li></ul><p><strong><em>Hardware</em></strong></p><figure><img alt="Raspberry Pi Camera V1.2" src="https://cdn-images-1.medium.com/max/335/0*nDaWmDiI4V_IgdbP" /></figure><p>The remote control unit works with a 5V in order to activate the required circuit, which transmits the signal to the central locking unit, but the Raspberry Pi only provides 3V on all pins. Two relays were added between the Raspberry Pi and the remote-control unit, one for the unlock trigger and one for the lock trigger. The relays are connected to a 5V source, but the circuit is not closed until a 3V current is received in the other pin. The Raspberry Pi sends the 3V current to the relay, which activates, sending a 5V current to the desired button on the remote control unit.</p><figure><img alt="Wiring scheme for the hardware device" src="https://cdn-images-1.medium.com/max/695/0*-Pck3HNhFRtijwJX" /></figure><p><strong><em>Software</em></strong></p><p>The camera and recognition models both run as python processes but are independent of each other. The camera module continuously checks the stream and saves image snapshots every t milliseconds. The recognition module checks the latest data available and sends a lock notification to the central locking system if a bicycle was detected.</p><p>The main part of the detection module is the <em>predict()</em> method which returns top N predictions. Before running the recognition model, the image is cleared using OpenCV Python API.</p><pre>def predict (self, filename, mod, synsets, N=5):<br>  tic = time.time()<br>  img = cv2.cvtColor (cv2.imread(filename), cv2.COLOR_BGR2RGB)<br>  if img is None:<br>    return None<br><br>  img = cv2.resize (img, (224, 224))<br>  img = np.swapaxes (img, 0, 2)<br>  img = np.swapaxes (img, 1, 2)<br>  img = img[np.newaxis, :]<br>  self.logger.info(&quot;Image pre-processed with OpenCV API in {}&quot;.format(str(time.time()-tic)))<br>  toc = time.time()<br>  <br>  mod.forward(self.Batch([mx.nd.array(img)]))<br>  prob = self.mod.get_outputs()[0].asnumpy ()<br>  prob = np.squeeze (prob)<br>  self.logger.info(&quot;forward pass in ()&quot;. format (str(time.time()-toc)))<br>  <br>  topN = []<br>  arr = np.argsort(prob)[::-1]<br>  for i in arr[0:N]:<br>    topN.append((prob[i], self.synsets[i]))<br>  return topN</pre><p>Due to the embedded nature of the Raspberry Pi devices, a web interface was also created such that users of the system are able to unlock the car in case of an emergency malfunction of the device and to check the logging history of the device.</p><p><strong><em>Testing and results</em></strong></p><p>The image recognition model was tested for moving speeds less than 30km/h. The precision during the testing phase was ~85%. The accuracy significantly decreases as the speed of the vehicle increases. Due to the low frame rate and quality of the low-cost raspberry pi camera, high accuracy cannot be ensured for large relative speeds. However, the main purpose of the device is to prevent dooring accidents, which happen when the car is actually stopped.</p><h3>Conclusion</h3><p>Many people steer clear of riding bicycles to the office out of fear for their safety. This article’s objective was to develop an idea for a product that would enable millions of bicycle riders to prevent dooring collisions without the need for protective gear.</p><p>The Dooring Safety System with Cyclist Detection will one day be included in the car’s stock hardware and serve as a global remedy for dooring accidents thanks to the ongoing development of the car’s processing capacity and the improvement in object recognition algorithms.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=846831981518" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>