This file contains 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 numpy as np | |
def main(): | |
# 加载原始RGB图像 | |
img_rgb = cv2.imread("test.png", cv2.IMREAD_UNCHANGED) | |
# 加载将要搜索的图像模板 | |
template = cv2.imread('logo.png', cv2.IMREAD_UNCHANGED) |
This file contains 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
g++ -fPIC -D_REENTRANT -std=c++11 -arch x86_64 -c -o attach_x86_64.o attach.cpp | |
g++ -dynamiclib -nostartfiles -arch x86_64 -o attach_x86_64.dylib attach_x86_64.o -lc | |
rm attach_x86_64.o | |
mv attach_x86_64.dylib ../attach_x86_64.dylib | |
g++ -fPIC -D_REENTRANT -std=c++11 -arch i386 -c -o attach_x86.o attach.cpp | |
g++ -dynamiclib -nostartfiles -arch i386 -o attach_x86.dylib attach_x86.o -lc | |
rm attach_x86.o | |
mv attach_x86.dylib ../attach_x86.dylib |