共享功能-传递变量

时间:2019-01-08 19:12:12

标签: vb.net

我无法使用以下功能:

Public Shared Function VerificaEPessoaSingularObrigatorio(idRegisto As Long) As Boolean
        Return RepositorioEntidadesRegistadas.ObtemTipoEntidadeApenasSingular(ByRef BDContexto, idRegisto)
    End Function

我必须将BDContexto传递给函数“ ObtemTipoEntidadeApenasSingular”,但是它具有以下错误:“ BC30201:期望表达。”

您知道错误可能是什么吗?

1 个答案:

答案 0 :(得分:1)

删除参数中的ByRef。那应该在方法定义中。

kernel_0 = np.array((
        [-1, -1, -1],
        [-1, 1, -1],
        [-1, 1, -1]), dtype="int")

kernel_1 = np.array((
        [-1, -1, -1],
        [-1, 1, -1],
        [1,-1, -1]), dtype="int")

kernel_2 = np.array((
        [-1, -1, -1],
        [1, 1, -1],
        [-1,-1, -1]), dtype="int")

kernel_3 = np.array((
        [1, -1, -1],
        [-1, 1, -1],
        [-1,-1, -1]), dtype="int")

kernel_4 = np.array((
        [-1, 1, -1],
        [-1, 1, -1],
        [-1,-1, -1]), dtype="int")

kernel_5 = np.array((
        [-1, -1, 1],
        [-1, 1, -1],
        [-1,-1, -1]), dtype="int")

kernel_6 = np.array((
        [-1, -1, -1],
        [-1, 1, 1],
        [-1,-1, -1]), dtype="int")

kernel_7 = np.array((
        [-1, -1, -1],
        [-1, 1, -1],
        [-1,-1, 1]), dtype="int")

kernel = np.array((kernel_0,kernel_1,kernel_2,kernel_3,kernel_4,kernel_5,kernel_6, kernel_7))
output_image = np.zeros(input_image.shape)
for i in np.arange(8):
    out = cv2.morphologyEx(input_image, cv2.MORPH_HITMISS, kernel[i,:,:])
    output_image = output_image + out

return output_image

if show == 1:
    show_image = np.reshape(np.repeat(input_image, 3, axis=1),(input_image.shape[0],input_image.shape[1],3))*255
    show_image[:,:,1] = show_image[:,:,1] -  output_image *255
    show_image[:,:,2] = show_image[:,:,2] -  output_image *255
    plt.imshow(show_image)