diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/DCT-Computer-Vision.iml b/.idea/DCT-Computer-Vision.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/DCT-Computer-Vision.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a3bce28 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b1509c0..6ace4ca 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -147,14 +147,11 @@ - + - + diff --git a/Arjun:Josh Sliding window.py b/Arjun-Josh Sliding window.py similarity index 100% rename from Arjun:Josh Sliding window.py rename to Arjun-Josh Sliding window.py diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..17601be --- /dev/null +++ b/setup.sh @@ -0,0 +1,10 @@ +sudo snap install pycharm-professional --classic +sudo apt install python3.8 +sudo apt install python3-pip +pip3 install opencv-python +sudo apt-get install cmake +pip3 install apriltag +pip3 install matplotlib +sudo apt-get install git +read -p "Link to forked git repository? " gitrepo +git clone $gitrepo diff --git a/test.py b/test.py new file mode 100644 index 0000000..74c7e05 --- /dev/null +++ b/test.py @@ -0,0 +1,30 @@ +import apriltag +import cv2 +import os +import numpy as np +# gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) +# slide a window across the image +def reader(detector, img, file_name): + tag_list = [] + global img2 + for y in range(0, img.shape[0], 350): + for x in range(0, img.shape[1], 350): + result, img2 = detector.detect(img[y:y + 450, x:x + 450], return_image=True) + if (len(result) != 0) and all(result) not in tag_list: + tag_list.append(result) + cv2.imwrite("Outputs/"+file_name+".output.jpg", img2) + return tag_list +if __name__ == '__main__': + fail = [] + detector = apriltag.Detector() + directory = "data/Track 10-22/" + for f in os.listdir(directory): + file = directory+f + print(file) + img = cv2.imread(file, cv2.IMREAD_GRAYSCALE) + tag_list = reader(detector, img, file) + if(len(tag_list)==0): + fail.append(file) + print(tag_list) + cv2.destroyAllWindows() + print(fail) \ No newline at end of file