finding shapes based on the appearance change. my first attempt to analyze pictures at low level
Windows 10
Python 3.9.5 pillow 8.2.0
powershell 7.4.2
Please note that I am not using any conventional computer vision algorithm! algorithm are entirely created by me! The advantages of my algorithm are straightforward and intuitive, because for one, I am not using heavy mathmatics.
execute the following and see how it works for yourself!!!
Caution: image format must NOT be JPG!!! JPG does not work! Use PNG instead.
recent update: this is still work in progress.
just run the powershell script
./execute_scripts.ps1
when script asks for directory. input videos/street3/resized
at the another prumpt, min1
when execute_scripts.ps1 finishes. run
py recreate_shapes/trd_stage/obj_shapes.py
go to
shapes\videos\street3\resized\min1\trd_stage\obj_shapes\objects1
py algorithms/fundamental/putpix_into_clgrp.py
original
find_edges.py
examples
-executing on the original produces such great results!
I'll update on this later on.
Original Image
combine_rpt_ptn_shapes.py
great result but big disadvantage is very very slow!!!!
I'll work on it to improve its speed.
the video analysis is all about finding the same shape between frames! sounds boring and tiring which is it is... but I believe computer vision for video is all about that!
- You need frames from video
At least two consecutive frames are needed.
you can use ffmpeg to get frames from the video
example video
street6.mp4
frames of video
frames.mp4
example of video analysis results. just very few example matches of about 200 to 250 matches. I checked every one of the entire matches and all were correct! but for this video only. video that I was previously working on was very difficult one and percentage of correct matches on that was about 97 to 99%. still very high but they have to be 100% because for example you don't want the part of the car to be a part of the wall.
matches.mp4
entire results video
https://www.youtube.com/watch?v=7xaMYHdiYwg
pixel change analysis between video frames ( usually between two consecutive frames from the same video )
original image1 original image2
taking difference between frames above
another example
original image
original image
this script finds large shapes ( shapes with more than 50 pixels ) that did not move to another locations but stayed or moved a little in the next frame.
execution examples
original images
putpix_into_clrgrp.py --minimized colors version--
the results are perfect! works 100%!
this is similar to find_staying_Lshp_btwn_frames.py but what is different is that this finds large shapes even if lots of pixel changes occurred.
execution examples
original images
this script finds small pixels shapes that entirely surrounded by the one large shape. entirely surronded by one large shape means that they are internal shapes within the one large shape.
example
original
execute recreate_internal_s_pixc_shapes.py to see the results
- algorithms/pixch/find_staying_shapes.py
- algorithms/pixch/verify_staying_shapes.py
this is not the end of the project! Now, I am getting closer to first milestone of object detection!
if you like this project, please consider supporting me by sponsoring this project or hire me so I can work on this project for you!

























































