danielbob32 / ParkingSpace

YOLOv8 based parking detection system using a RTSP camera.
https://danielbob32.github.io/PSweb/
Apache License 2.0
6 stars 0 forks source link

Inquiry About How the Program Works #2

Closed firecoolman closed 2 weeks ago

firecoolman commented 2 weeks ago

Hello, daniebob32

I am currently learning how to replace videos with my own and would like to recognize parking spots based on my images. After reading your webpage, I have a few questions regarding the technical details:

How are the Masked images, Probability frames, Raw images, and Segmented images generated? Thank you for your time and assistance.

Due to my limited English proficiency, I mostly use GPT to translate what I want to say. Please forgive me if there is any offense.

Best regards,

danielbob32 commented 2 weeks ago

Regarding your question, the app uses a YOLOv8 segmentation model that produces frames with segmented cars on them. Raw images are simply snapshots of the video footage, and we use them to create a probability map. If we apply some image processing operations to the raw images to reduce them to a grayscale binary image (where cars are indicated in white and void areas in black), and then sum and average a large number of these images, we can produce a probability map. This map will indicate the areas where parking is most likely available.

The logic behind this is that the more a spot on the ground is occupied by a car, the higher the probability that it is a valid parking space. The masked images are segmented images that have also undergone an image processing operation to create a binary map, where a car is indicated in white. Now, if we invert this image and apply logical operations on it alongside the probability map, the result will be a frame that indicates the free spaces—white spots representing areas available for parking, but only within legitimate parking areas.

This process is done for each frame, and various parameters can be tweaked to ultimately determine whether a "detected spot" is large enough to fit a car.

I hope this explanation helps!

firecoolman commented 2 weeks ago

Thank you very much for your help. I will try to see if I can implement this in my parking system.