DIY: Malaysian MySejahtera Risk Status Detector with OpenCV

ABSTRACT

This application note aims to detect personal risk status on the MySejahtera mobile application using a Basler camera combined with OpenCV and Nvidia Jetson Nano. The outcome of this application note was that the system was able to detect the individual risk status while lighting up the LED as an indicator. This application note explains the steps to build your own risk status detection system.

INTRODUCTION

As a result of the pandemic COVID-19, the Malaysian government developed and launched a mobile application for contact tracing purposes known as MySejahtera. In light of the recent surge in the number of cases in Malaysia, many locations only permit individuals with low-risk status to enter their premises.

With this in mind, we have tested and developed a risk status detection system using the Basler Embedded Vision Development Kit where the LED indicator will light up red or green. Red indicates individuals have high-risk status, while green indicates individuals have low-risk status. We hope that by sharing our experience, readers and companies will be able to DIY and have their own risk status detection system and create a safer environment.

OBJECTIVES 

  1. Detect the personal risk status from the MySejahtera mobile application.
  2. Illuminate the LEDs to indicate the risk status (red – high-risk, green – low-risk).

COMPONENT LIST

  • Basler Embedded Vision Development Kit (More information)
  • Components Included:
    1. Camera Model: daA2500-60mci (S-Mount)
    2. Board: Basler BCON for MIPI to Jetson Nano/Xavier NX Developer Board
    3. Lens: Evetar Lens N118B05518W F1.8 f5.5mm 1/1.8″
    4. Cables:
      • FFC cable, 0.2m
      • FFC Cable 15 pins

TECHNIQUE

Step 1: Integration of Basler camera and Python library.

Step 2: Image resizing for template matching function

Step 3: OpenCV cv2.matchTemplate template matching function

Step 4: OpenCV cv2.Canny edge detection function

Step 5: OpenCV cv2.findContours and drawContours function

Step 6: Jetson Nano GPIO integration

MySejahtera Risk Status Detector 2D Setup
MySejahtera Risk Status Detector Setup

RESULT

mysejahtera-sample-picture
mysejahtera-sample-picture-2

LIMITATIONS AND SUGGESTIONS

As with every exercise and study, there is always room for improvement. One of the limitations that we noticed are the rotation and non-affine transformation issues were not taken into consideration in this example. Thus, individuals who wished to use this application will have to bear this in mind.

CONCLUSION

Upon developing this application note, there are a few findings that enabled us to accomplish this exercise. Firstly, we were able to integrate OpenCV with a Basler camera while using the Python programming language. Additionally, we discovered a method to make a standard matching template more flexible and robust by extending it which enabled the standard template to work on multiple scales. Lastly, we figured out the mechanism to control the LEDs by using Jetson Nano onboard GPIO pins.

Download Source code for free

Download Code
How would you implement this application?
Would you like to get a quotation for Basler Embedded Vision Development Kit?