Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Analyze an image #1

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions bin/analyze.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import cv2

from lib.analyzer import ImageAnalyzer

def main():
analyzer = ImageAnalyzer()

no_mallet = cv2.imread("no_mallet.jpg")
if analyzer.has_mallet(no_mallet):
print("Error: Found mallet when there is no mallet")
return

yes_mallet = cv2.imread("yes_Mallet.jpg")
if not analyzer.has_mallet(yes_mallet):
print("Error: Could not detect mallet")
return


main()
6 changes: 6 additions & 0 deletions lib/analyzer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import cv2

class ImageAnalyzer:
def has_mallet(self, frame: cv2.Mat) -> bool:
# TODO: Check for mallets
return False
Binary file added no_mallet.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added yes_mallet.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.