我需要来自特定版本项目(SonarQube项目)的源代码,但我无法弄清楚如何从git中提取它.
我已将repo添加为远程(git add remote origin)并从主分支中提取最新版本,但这不是我需要的版本.
我知道我需要的提交是d25bc0e,但当我尝试" git fetch origin master d25bc0e"我得到错误" fatal: couldn't find remote ref d25bc0e".
可能是我做错了,我对Git不太熟悉.
我正在开发一个项目,我使用OpenCV来检测形状和颜色.
有5种颜色(红色,绿色,黄色,蓝色和白色)和4种形状(矩形,星形,圆形和心形).我已经能够可靠地辨别颜色,我可以检测形状时使用的图像就像是绘制图像这个 使用此代码.请注意,图像仅用于演示,我的代码中的范围值不适用于这些颜色.
import cv2
import numpy as np
class Shape():
    def __init__(self, color, shape, x, y, approx):
        self.color = color
        self.shape = shape
        self.x = x
        self.y = y
        self.approx = approx
def closing(mask):
kernel = np.ones((7,7),np.uint8) 
closing = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)
return closing
def opening(mask):
    kernel = np.ones((6,6),np.uint8)
    opening = cv2.morphologyEx(mask, cv2.MORPH_OPEN, kernel)
    return opening
#Define Red
lower_red = np.array([0, 90, 60], dtype=np.uint8)
upper_red = np.array([10, 255, 255], dtype=np.uint8)
red = [lower_red, upper_red, 'red']
#Define Green
lower_green …