Available/free parking space detection image analysis algorithm
Show older comments
I'm working on a project with a jpg file attached, can you help?
5 Comments
Mehmed Saad
on 12 May 2020
have a look at regionprops and edge in MATLAB help
Walter Roberson
on 12 May 2020
Some other people have discussed this in the past.
Mehmed Saad
on 13 May 2020
“You cannot, at the very same time, be grateful and unhappy, or ungrateful and happy.”
― Mokokoma Mokhonoana
Image Analyst
on 17 Jul 2021
You seem to have detached your JPG image file.
Accepted Answer
More Answers (2)
Image Analyst
on 12 May 2020
0 votes
Look up the prior posts like Walter suggested. One way might be to have a template setup (like a binary image mask with a bunch of rectangles). Then you have one image for a completely empty lot, measure the MeanIntensity with regionprops() for each space. Then do the same with your test image and see if the mean intensities are significantly different enough. You could also subtract the background from the test image and see how many blobs there are and if any blob centroid is contained within a template rectangle.
MUHAMMAD BILAL
on 24 Nov 2021
0 votes
So this code only works for the 3 images you attached? I need to run this code on three differnent images other than this. Can anyone provide me 3 images other than attached ones.
11 Comments
Image Analyst
on 24 Nov 2021
Who cares what images other people have? The only ones that matter are the ones for your parking lot. So just use them and make templates from them. My code should then work if you have the right template image.
MUHAMMAD BILAL
on 25 Nov 2021
Glad you replied. Sir can u suggest me some code for masking like the one you used for your image.
Walter Roberson
on 25 Nov 2021
What difficulty did you encounter using the code he already posted, just changing the file names?
MUHAMMAD BILAL
on 25 Nov 2021
He is using test images. He applied masking in one of the image. I just want to know about masking he applied?
Walter Roberson
on 25 Nov 2021
What about the masking do you want to know, or what about the masking is failing for you?
He is not computing the mask image. He (someone) went out and took a picture when there were no cars, and that is the mask image.
Cars block out the floor, so the code looks for places that do not look like the image with no cars, and which are sufficiently large to be interesting. That code is going to stay the same even if you have a completely different garage layout.
Image Analyst
on 25 Nov 2021
Honestly I just used a photo-editing program (Photoshop) to paint white wherever there was a parking space, and black wherever it was not a space. That was easiest for me. You can write a program to do it in MATLAB if you want (using drawpolygon and poly2mask) but a paint program is easier.
MUHAMMAD BILAL
on 25 Nov 2021
Great. Thanks for your time and responding back to me. Actually i am using your code for my project. But project require 2 set of images. I have used the one's you attached. I am looking for 3 more images like yours. Thanks again.
Image Analyst
on 25 Nov 2021
Just do a Google image search for "parking lot overhead", or something like that, to get similar images.
MUHAMMAD BILAL
on 25 Nov 2021
Thanks for your time sir.
Sudhish
on 23 Nov 2024
hey did you get a dataset for this? @MUHAMMAD BILAL
Image Analyst
on 23 Nov 2024
I'm presuming if it's really his project, that he has a camera looking down on the parking lot that he wants to inspect, and snaps photos several times a day. Isn't that what you have, @Sudhish. If not, and it's some class project, then the class should provide you with a set of input images. Or else collect them yourself.
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



