小编Hab*_*bba的帖子

使用git拉出特定版本

我需要来自特定版本项目(SonarQube项目)的源代码,但我无法弄清楚如何从git中提取它.

我已将repo添加为远程(git add remote origin)并从主分支中提取最新版本,但这不是我需要的版本.

我知道我需要的提交是d25bc0e,但当我尝试" git fetch origin master d25bc0e"我得到错误" fatal: couldn't find remote ref d25bc0e".

可能是我做错了,我对Git不太熟悉.

git github

8
推荐指数
1
解决办法
2万
查看次数

使用OpenCV在python中进行形状检测

我正在开发一个项目,我使用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 …
Run Code Online (Sandbox Code Playgroud)

python opencv shapes

5
推荐指数
1
解决办法
1万
查看次数

Python:获取非矩形区域的 GLCM

我一直在使用 skimage 的 SLIC 实现来以超像素分割图像。我想使用 GLCM 从这些超像素中提取附加特征来解决分类问题。这些超像素不是矩形的。在 MATLAB 中,您可以将像素设置为 NaN,它们将被算法忽略(链接)。我可以用它来在超像素周围制作边界框,然后将未使用的像素设置为 NaN。

然而,skimage 中的greycomatrix函数工作方式与 MATLAB 实现并不完全相同。将像素设置为 NaN 时,该函数无法断言检查所有值是否大于 0。

是否有可用的 Python 实现能够处理非矩形 ROI?

python image-processing scikit-image mahotas glcm

2
推荐指数
1
解决办法
2183
查看次数

标签 统计

python ×2

git ×1

github ×1

glcm ×1

image-processing ×1

mahotas ×1

opencv ×1

scikit-image ×1

shapes ×1