Skip to content

Instantly share code, notes, and snippets.

View NullYing's full-sized avatar
🎯
Focusing

白月秋见心 NullYing

🎯
Focusing
View GitHub Profile
@NullYing
NullYing / gist:45f3247ff51c2b27e5caebae8212fc31
Last active February 13, 2019 07:56
带有alpha通道的模板匹配(局限性:只能匹配从图中截取的某一部分)
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)
@NullYing
NullYing / compile_mac.sh
Last active April 29, 2022 09:44
修正pycharm在macos m1的arm python无法调试
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