This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #----- XOR Patterns -------- | |
| # https://www.reddit.com/r/math/comments/bpfq1w/weird_prime_pattern/ | |
| # https://medium.com/biffures/part-2-the-beauty-of-bitwise-and-or-cdf1d8d87891 | |
| import numpy as np | |
| import cv2 as cv2 | |
| # Width and height of the image | |
| width = 1000 | |
| height = 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import glob | |
| import os | |
| import random | |
| import numpy as np | |
| def create_composite_image(_fg_image , _bg_image): | |
| """ | |
| Creates composite images from a given set of foreground and background images |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The below command will copy all the libraries that are required by an executable | |
| # It runs 'ldd' command on the executable name. | |
| # Replace the <file> with your exec path and <path> with the folder where the libs should be copied. | |
| ldd <file> | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' <path> | |
| # The below command changes the rpath for the exectable to the required path of the copied libraries. | |
| chrpath -r '$ORIGIN/<path>' <file> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <dirent.h> | |
| #include <sys/types.h> | |
| static void list_dir(const char *path) | |
| { | |
| struct dirent *entry; | |
| DIR *dir = opendir(path); | |
| if (dir == NULL) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##Using Android OpenCV-Java and Native C++ | |
| Create a new android Project with Include C++ Support. | |
| Download the android sdk from http://opencv.org/releases.html. | |
| Import OpenCV4Android as a module dependency of your app. In your Android Studio Project, select File -> New -> Import Module.. . Then in the New Module dialog, navigate to the path of OpenCV4Android Java SDK. For instance path is | |
| <Path to Downloads>/opencv-android-sdk/sdk/java . | |
| Go to File -> Project Structure .Select app -> dependencies . Press + and select Module Dependency. Press Ok. | |
| Now we need to add native JNI libraries in our project. These libraries should be added in jniLibs directory. Create a new jniLibs directory in app-> src -> main. | |
| Open the extracted OpenCV SDK directory. Switch to “opencv-android-sdk/sdk/native/libs” directory. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Tested on :- | |
| ARToolKit5-bin-5.3.2r1-Linux-x86_64 | |
| Linux 16.04 | |
| Installation Steps :- | |
| 1. Download and extract the AR-Toolkit from the Official website .(https://archive.artoolkit.org/download-artoolkit-sdk) | |
| 2. Go to <ARToolKit5 Root Directory>/bin and run ./nftSimple | |
| 3. You might get an error regarding missing 'libglut.so' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Function To sort the points | |
| inline void sortPoints(std::vector < cv::Point > &pointList) | |
| { | |
| std::sort(pointList.begin(),pointList.end(),Local()); | |
| } | |
| //Comparator funtion for sorting the points | |
| struct Local { | |
| bool operator () (const cv::Point & p1, const cv::Point & p2) |
NewerOlder