https://github.com/flatypus/fltkbadapple
https://github.com/flatypus/fltkbadapple
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/flatypus/fltkbadapple
- Owner: flatypus
- Created: 2022-11-18T06:03:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-18T20:47:51.000Z (over 3 years ago)
- Last Synced: 2025-01-12T20:28:26.356Z (over 1 year ago)
- Language: Python
- Size: 61.5 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bad Apple!! but on FLTK
Four steps:
1. Take any black and white video, blur it to remove rough edges, and convert into plain black and white. Then black and white => 3d array of 1s and 0s. At this point I cached the data as binary data with pickle.
2. Load in the cached data and run an algorithm through every frame that converts the pixels into the least rectangles such that the rectangles cover all the pixels. This definitely isn't the most optimal algorithm, but it works for my purposes. Then cache the data again. Do this twice, targetting the black and white pixels separately.
3. Loop through the frames, and all the rectangles for that frame. If there are more white rectangles than black rectangles, render the black windows as "background" and the white rectangles on top as "foreground".
4. If a rectangle was created the last frame that already exists, don't delete it and save some time. Delete all unused windows. Screenshot after the windows are created.
[
](https://www.youtube.com/watch?v=coyzbo8uWcs)
[Link to the video](https://www.youtube.com/watch?v=coyzbo8uWcs)