Skip to content

Incorrect type of dilate and erode function parameters #1330

@saurabh-git-dev

Description

@saurabh-git-dev

I was trying to use the dilate function and erode with all parameters.

I believe the iteration parameter type should be an integer type in DilateWithParams. Currently it's BorderType.

gocv/imgproc.go

Lines 282 to 296 in a84799d

func DilateWithParams(src Mat, dst *Mat, kernel Mat, anchor image.Point, iterations, borderType BorderType, borderValue color.RGBA) error {
cAnchor := C.struct_Point{
x: C.int(anchor.X),
y: C.int(anchor.Y),
}
bv := C.struct_Scalar{
val1: C.double(borderValue.B),
val2: C.double(borderValue.G),
val3: C.double(borderValue.R),
val4: C.double(borderValue.A),
}
return OpenCVResult(C.DilateWithParams(src.p, dst.p, kernel.p, cAnchor, C.int(iterations), C.int(borderType), bv))
}

and in ErodeWithParams borderType parameter should be "BorderType" instead of int.

gocv/imgproc.go

Lines 344 to 351 in a84799d

func ErodeWithParams(src Mat, dst *Mat, kernel Mat, anchor image.Point, iterations, borderType int) error {
cAnchor := C.struct_Point{
x: C.int(anchor.X),
y: C.int(anchor.Y),
}
return OpenCVResult(C.ErodeWithParams(src.p, dst.p, kernel.p, cAnchor, C.int(iterations), C.int(borderType)))
}

I am using the latest gocv version, v0.42.0.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions