diff --git a/README.md b/README.md new file mode 100644 index 0000000..6fb2796 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +This repository contains all files for the Image recognition course of HU Electrical Engineering year 3. + +--- + +Arne van Iterson +Tom Selier \ No newline at end of file diff --git a/md/notes.md b/md/notes.md new file mode 100644 index 0000000..e69de29 diff --git a/md/nuts.md b/md/nuts.md new file mode 100644 index 0000000..229a75b --- /dev/null +++ b/md/nuts.md @@ -0,0 +1,18 @@ +### Jullie gaan noten herkennen + +Hoe de neuk? Nut. +1. Hoe gaan we de noten herkennen (beeld, smaak, geluid, text)? + - Beeldherkenning lol +2. Wat zijn de visuele kenmerken van de noten? + - Vorm, kleur, textuur, grootte +3. Hoeveel noten willen we herkennen + - Qua type, hoeveel verschillende noten + - Qua tijd, hoeveel noten tegelijkertijd +4. Wat is de achtergrond +5. Met wat voor camera worden de noten bekeken +6. Is de noot verwerkt + +De deelvragen moeten sequentieel zijn + + +Wij moeten presenteren volgende week diff --git a/res/trees/accasia_sq1_original.png b/res/trees/accasia_sq1_original.png new file mode 100644 index 0000000..b07095e Binary files /dev/null and b/res/trees/accasia_sq1_original.png differ diff --git a/res/trees/berk_sq1_original.png b/res/trees/berk_sq1_original.png new file mode 100644 index 0000000..59bb7a9 Binary files /dev/null and b/res/trees/berk_sq1_original.png differ diff --git a/res/trees/eik2_sq1_original.png b/res/trees/eik2_sq1_original.png new file mode 100644 index 0000000..ea23a7f Binary files /dev/null and b/res/trees/eik2_sq1_original.png differ diff --git a/res/trees/eik_sq1_original.png b/res/trees/eik_sq1_original.png new file mode 100644 index 0000000..5dd00b2 Binary files /dev/null and b/res/trees/eik_sq1_original.png differ diff --git a/res/trees/els_sq1_original.png b/res/trees/els_sq1_original.png new file mode 100644 index 0000000..6164b50 Binary files /dev/null and b/res/trees/els_sq1_original.png differ diff --git a/res/trees/es_sq1_original.png b/res/trees/es_sq1_original.png new file mode 100644 index 0000000..e18d9dc Binary files /dev/null and b/res/trees/es_sq1_original.png differ diff --git a/res/trees/esdoorn_sq1_original.png b/res/trees/esdoorn_sq1_original.png new file mode 100644 index 0000000..dac8f80 Binary files /dev/null and b/res/trees/esdoorn_sq1_original.png differ diff --git a/res/trees/linde_sq1_original.png b/res/trees/linde_sq1_original.png new file mode 100644 index 0000000..9aad421 Binary files /dev/null and b/res/trees/linde_sq1_original.png differ diff --git a/res/trees/plataan1_sq1_original.png b/res/trees/plataan1_sq1_original.png new file mode 100644 index 0000000..5ae39d4 Binary files /dev/null and b/res/trees/plataan1_sq1_original.png differ diff --git a/res/trees/plataan2_sq1_original.png b/res/trees/plataan2_sq1_original.png new file mode 100644 index 0000000..49a0184 Binary files /dev/null and b/res/trees/plataan2_sq1_original.png differ diff --git a/src/adj.py b/src/adj.py new file mode 100644 index 0000000..e7c2eaa --- /dev/null +++ b/src/adj.py @@ -0,0 +1,44 @@ +import cv2 +import numpy as np + +blur = 3 +canny_low = 255 +canny_high = 50 + +def on_change(value): + pass + +img = cv2.imread("./res/trees/berk_sq1_original.png") +img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) + +width = int(img.shape[1] * 40 / 100) +height = int(img.shape[0] * 40 / 100) +dim = (width, height) + +# resize image +img = cv2.resize(img, dim, interpolation = cv2.INTER_AREA) + +cv2.imshow('frame', img) + +cv2.createTrackbar('Contrast', 'frame', 0, 25, on_change) +cv2.createTrackbar('Canny low', 'frame', 0, 1000, on_change) +cv2.createTrackbar('Canny high', 'frame', 0, 1000, on_change) + +while(1): + # get data from trackbars + blur = cv2.getTrackbarPos('Blur rate', 'frame') + canny_low = cv2.getTrackbarPos('Canny low', 'frame') + canny_high = cv2.getTrackbarPos('Canny high', 'frame') + + # Canny Edge Detection + edges = cv2.Canny(image=img, threshold1=canny_low, threshold2=canny_high) + + # Display Canny Edge Detection Image + cv2.imshow("Canny Edge Detection", edges) + + # wait for escape + k = cv2.waitKey(5) & 0xFF + if k == 27: + break + +cv2.destroyAllWindows() \ No newline at end of file diff --git a/src/suite.py b/src/suite.py new file mode 100644 index 0000000..e69de29 diff --git a/src/tree_edge.py b/src/tree_edge.py new file mode 100644 index 0000000..c68fd6d --- /dev/null +++ b/src/tree_edge.py @@ -0,0 +1,47 @@ +import cv2 + +# Read the original image +img = cv2.imread("./res/trees/berk_sq1_original.png") + +# Convert to graycsale +img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) + +width = int(img_gray.shape[1] * 40 / 100) +height = int(img_gray.shape[0] * 40 / 100) +dim = (width, height) + +# resize image +resized = cv2.resize(img_gray, dim, interpolation = cv2.INTER_AREA) + +# Display original image +cv2.imshow("Original", resized) + +# Blur the image for better edge detection +img_blur = cv2.GaussianBlur(resized, (3, 3), 0) + +# Sobel Edge Detection +sobelx = cv2.Sobel( + src=img_blur, ddepth=cv2.CV_64F, dx=1, dy=0, ksize=5 +) # Sobel Edge Detection on the X axis +sobely = cv2.Sobel( + src=img_blur, ddepth=cv2.CV_64F, dx=0, dy=1, ksize=5 +) # Sobel Edge Detection on the Y axis +sobelxy = cv2.Sobel( + src=img_blur, ddepth=cv2.CV_64F, dx=1, dy=1, ksize=5 +) # Combined X and Y Sobel Edge Detection +# Display Sobel Edge Detection Images +cv2.imshow("Sobel X", sobelx) +cv2.imshow("Sobel Y", sobely) +cv2.imshow("Sobel X Y using Sobel() function", sobelxy) + +# Canny Edge Detection +edges = cv2.Canny( + image=resized, threshold1=150, threshold2=250 +) # Canny Edge Detection +# Display Canny Edge Detection Image +cv2.imshow("Canny Edge Detection", edges) +cv2.waitKey(0) + +cv2.destroyAllWindows() + +## Sift \ No newline at end of file