Skip to content

np.hstack has diffrent effect from python #508

@xdqa01

Description

@xdqa01

Windows [email protected]
[email protected],wpf
[email protected]
[email protected]
[email protected]

NumSharp np.hstack(img1,img2,img3)

        var image1 = Cv2.ImRead(FirstImagePath).NotNull().ResizeToStandardSize();
        var image2 = Cv2.ImRead(SecondImagePath).NotNull().ResizeToStandardSize();
        var image3 = Cv2.ImRead(ThirdImagePath).NotNull().ResizeToStandardSize();
        var imageArray = np.hstack(image1.ToNDArray(), image2.ToNDArray(), image3.ToNDArray());
        var image = imageArray.ToMat();
        Cv2.ImShow(WindowName, image);
        FourthImageSource = image.ToBitmapSource();

print

  • img1
  • img2
  • img3

python np.hstack(img1,img2,img3)

    img1 = cv.imread("./static/fllower.jpg")
    img2 = cv.imread("./static/lake.jpg")
    img3 = cv.imread("./static/mountain.jpg")
    img1 = cv.resize(img1, (200, 200))
    img2 = cv.resize(img2, (200, 200))
    img3 = cv.resize(img3, (200, 200))
    imgs = np.hstack([img1, img2, img3])
    cv.imshow("multi_pic", imgs)

print
img1 img2 img3

And,if i use code below,it print like python np.hstack

var imageArray = np.dstack(image1.ToNDArray(), image2.ToNDArray(), image3.ToNDArray());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions