Monday, February 17, 2025

[Traffic Detection] Progress so far, and next integration

Steps
Input Sample Data
Hough Circle method


nal frame image from the video is initially converted to grayscale image and then blurred 
Next Integration

Importing a 2014 Android Project from GitHub [Edit Later]

Yes, it worked, and yes, I had errors importing back

Sunday, January 3, 2021

Linux Achievement Certificate

 A quick blog about how I am finished with 2 Linux courses, and only 1 course away from gaining a certificate. Although I believe that it's pretty much similar to a participation ribbon, it's still nice to have it as a good job to finish the classes. 

Tuesday, April 7, 2020

[Rant] I hate it whenever I want to start a fun tutorial and I'm already stuck at step 1.

I started a python keylogger and I was so stuck on why my code doesn't record the inputted keys. And, it's not the code. It's only 5 measly lines of code. Turns out I needed to go to my computer settings to allow security to recognize that PyCharm is safe to record my keys.

BOOOOOOO

In general, coding tutorials has always been the only tutorials where I stop at step 1. You don't see cooking tutorials stop me at step 1, haha.

Friday, September 28, 2018

Traffic: Should I move or not? (OpenCV + Android) Pseudocode and Algorithms

Story Behind the Project
I complained to my good friends, who can tolerate my late night bombardment, about how I needed a project to keep my mind running productively and busy, aside from exercise and actually working on my real tasks that are much more rewarding later on (e.g. practice technical interviews, clean up my portfolio). I wanted work, where I could look forward to every return home.

My friend said that he'd be ready to test my app, so I guess I'll have to create the app, and do my best to stick to that.

I surely want to test out my app. Although I am not a fan of driving, I've been in the back seat long enough to know that not all traffic lights are perfect and can be a dreadful patience and discipline tester in the same spot for 5+ minutes. This includes sitting in traffic for quite, where we might as well nap there, too.

That's enough to catch at least 25% of a power nap.

Every stopping moment, the app starts finding traffic lights and detects another car movement to check whether you should press the gas pedal or not. The app should also allow you to exit and still run in the background so you can do simple tasks such as check e-mails and playing music. And, shouldn't use so much battery life.

Car Movement Detection
As much as I want to train my own haar cascade, I am impatient and want a running prototype (also this is not even paid and out of learning interest) so I'm going to copy this project: https://www.geeksforgeeks.org/opencv-python-program-vehicle-detection-video-frame/

Or, I can do HSV segmentation: https://www.researchgate.net/publication/251423714_Vehicle_Detection_at_Night_Based_on_TailLight_Detection

American Traffic Lights
There are light patterns for American traffic lights. The light sequence is red, then green to go, and green, flashing yellow, and then red to stop. And, it's vertical rows of 3 circles.

Also, this is a good read: https://autottblog.wordpress.com/programming-the-car/opencv/

Traffic Light and Color Detection
Find 3 circles that are red, yellow, and green in a vertical row, and calculate the distance between those circles to determine if it is a traffic light. By converting the image to HSV to find the 3 circles and its distance.

Pseudocode and Algorithm for Traffic Light Detection
Thanks, researchers, for making it easy for me: https://www.researchgate.net/publication/300581967_Traffic_Light_Recognition_System_for_People_with_Color_Blindness/download

Basically, segment frames into HSV then LOTS AND LOTS of tweaking the threshold. They made a nice flowchart in there. Thank goodness.




Tuesday, July 10, 2018

[Resume Website] A Possible Software Security Issue

This is my first time working on websites.

I am supposed to work on HTML, CSS, and Javascript. I am still astonished till this day on how great this non-profit organization has established itself. I have 1 edit, that needs to be finished so I can see this as a security vulnerability in any websites.

Noticed how "<dev/Mission> looks like a HTML code. On my website, I had the title as "dev/Mission" 

the orange highlight of "dev/Mission"

I tried to type "<dev/Mission>" in the HTML; yet, it still considered as a typo. 

How is this a vulnerability?

"HTML injection is an attack that is similar to Cross-site Scripting (XSS). While in the XSS vulnerability the attacker can inject and execute Javascript code, the HTML injection attack only allows the injection of certain HTML tags. When an application does not properly handle user-supplied data, an attacker can supply valid HTML code, typically via a parameter value, and inject their own content into the page. This attack is typically used in conjunction with some form of social engineering, as the attack is exploiting a code-based vulnerability and a user's trust.

Attack scenario (OWASP)

A possible attack scenario is demonstrated below:
  • Attacker discovers injection vulnerability and decides to use an HTML injection attack
  • Attacker crafts malicious link, including his injected HTML content, and sends it to a user via email
  • The user visits the page due to the page being located within a trusted domain
  • The attacker's injected HTML is rendered and presented to the user asking for a username and password
  • The user enters a username and password, which are both sent to the attackers' server"
- https://www.acunetix.com/vulnerabilities/web/html-injection

A cool volunteer named Francis Li mentioned in Slack that a way to edit it to look like "<dev/Mission>" instead of "dev/Mission" is using HTML escape entities (https://dev.w3.org/html5/html-author/charref)

I haven't looked too much into it, but I would consider this possibly a software security issue if I was running a major company that may save lives. Because there are creative people in this world who can make anything into reality.

Even if I was wrong, it's pretty cool that I learned a snippet about HTML injection.

Thursday, June 14, 2018

[Android Studio Errors] Face Alarm App

Problem
Camera2Renderer had an error. I forget what it was since I already fixed it. But basically it had so many missing a variables that stemmed from there.
Solution
Change the project structure for the compile sdk version because they added hardware in a different version.
https://stackoverflow.com/questions/36204781/error-package-android-hardware-camera2-does-not-exist-opencv

Problem
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAXM must be updated (version 1.1.1 < 6.0.1).

Solution
??

Conclusion
I hate to leave errors unsolved, and I'm not sure if I'll continue this project. I hate to leave this project unfinished because of my anger issues with android development. I can say that I am leaving this project at a pause.