We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I known Cv2.Split can complete this funtion,but some time,we have to use pointer convert to r,g,b channel,like this
Mat image = Cv2.ImRead("E:\\animal.jpg"); int out_h = image.Height; int out_w = image.Width; int channel_step = out_h * out_w; Mat rmat =new Mat(out_h, out_w, MatType.CV_32FC1, image.CvPtr); Mat gmat = new Mat(out_h, out_w, MatType.CV_32FC1, image.CvPtr+channel_step); Mat bmat = new Mat(out_h, out_w, MatType.CV_32FC1, image.CvPtr+2 * channel_step); rmat *= 255f; gmat *= 255f; bmat *= 255f; Cv2.ImShow("R",rmat); Cv2.ImShow("G", gmat); Cv2.ImShow("B", bmat); Cv2.WaitKey(0); Cv2.DestroyAllWindows();
but the code can not run well,how modify it to work normally?
The text was updated successfully, but these errors were encountered:
You should first consider using Cv2.Split(), but you may find the following page helpful for other methods: https://stackoverflow.com/questions/21619609/split-channels-from-rgb-array-in-c-without-opencv
Sorry, something went wrong.
No branches or pull requests
I known Cv2.Split can complete this funtion,but some time,we have to use pointer convert to r,g,b channel,like this
but the code can not run well,how modify it to work normally?
The text was updated successfully, but these errors were encountered: