Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

np.hstack has diffrent effect from python #508

Open
xdqa01 opened this issue Feb 17, 2024 · 0 comments
Open

np.hstack has diffrent effect from python #508

xdqa01 opened this issue Feb 17, 2024 · 0 comments

Comments

@xdqa01
Copy link

xdqa01 commented Feb 17, 2024

Windows 10@19044.2364
Dotnet@net8.0-windows,wpf
NumSharp@0.30.0
OpenCvSharp4@4.9.0.20240103
Python@3.12

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());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant