Exploration of automated speed detection in modern Java, starting with the OpenCV JNI bindings and then switching to the FFM API.
- Currently thinking offload to a Function compute service to parallelize across cloud compute.
- Front end CRUD site
mvn clean -Pcomplete package
mvn clean -Pcomplete package -Dmaven.test.skip
java --enable-preview -cp ./target/speedcam-0.1-jar-with-dependencies.jar com.pinealpha.SpeedDetect --in src/main/resources/sample_videos/
java --enable-preview -cp ./target/speedcam-0.1-jar-with-dependencies.jar com.pinealpha.SpeedDetect --in 'src/main/resources/sample_videos/Road Cam 6-7-2025, 2.05.46pm PDT - 6-7-2025, 2.05.46pm PDT.mp4'
Road Cam 6-4-2025, 1.10.33pm PDT - 6-4-2025, 1.10.33pm PDT.mp4
- Road Cam 6-7-2025, 2.05.46pm --> motion frame range should be 61-178 left-to-right
- Road Cam 6-7-2025, 2.09.59pm --> motion frame range should be 72-233 left-to-right
- Road Cam 6-9-2025, 1.01.52pm --> motion frame range should be 74-196 left-to-right
- Road Cam 6-9-2025, 9.57.54am --> motion frame range should be 44-162 left-to-right
- Road Cam 6-7-2025, 2.39.30pm --> motion frame range should be 89-279 right-to-left
- Road Cam 6-9-2025, 7.55.13am --> motion frame range should be 133-249 right-to-left
- Road Cam 6-9-2025, 1.08.44pm --> motion frame range should be 165-351 right-to-left
- Road Cam 6-9-2025, 10.43.09am --> motion frame range should be 66-220 right-to-left
All videos
mvn clean test
Single video
mvn clean test -Dvideo.test.filter=right-to-left-2
Running all tests:
- Total time to run all tests: 1m 26s
- Average time per video (just the video): 8.7 seconds
- We are going to build and run SpeedDetect across some known sample videos and compare the results we get to the "Target Motion Results" listed above
- The files we are going to process are all in /src/main/resources/sample_videos/
- After the full run, let's check the motion results for each one, and compare to the target motion results above. The first motion frame and last motion frame should be within 10 frames of the target results above. If they are, then we can consider that a passing test. If they are not, that is a failed test.
- A rejected video is OK, we won't call that a fail just a "SKIP"