Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Here is the code, When Print out the leftimage after convert leftex to mat, it's a white image, and all the pixel values is 205
Texture2D lefttex = new Texture2D(UndistortedImageWidth, UndistortedImageHeight, TextureFormat.RGBA32, false); Texture2D righttex = new Texture2D(UndistortedImageWidth, UndistortedImageHeight, TextureFormat.RGBA32, false); Graphics.CopyTexture(TextureUndistortedDisplayRight, righttex); Graphics.CopyTexture(TextureUndistortedDisplayLeft, lefttex); Mat rightimage = new Mat(TextureUndistortedDisplayRight.height, TextureUndistortedDisplayRight.width, CvType.CV_8UC4); Mat leftimage = new Mat(TextureUndistortedDisplayLeft.height, TextureUndistortedDisplayLeft.width, CvType.CV_8UC4); OpenCVForUnity.ImgcodecsModule.Imgcodecs.imwrite("D:\\eeee.png", leftimage); Utils.texture2DToMat(lefttex, leftimage); Utils.matToTexture2D(leftimage, lefttex); Utils.texture2DToMat(righttex, rightimage); Utils.matToTexture2D(rightimage, righttex); Graphics.CopyTexture(lefttex, TextureUndistortedDisplayLeft); Graphics.CopyTexture(righttex, TextureUndistortedDisplayRight);