Bug in Documentation Code
I was reading through the OpenCV tutorial for image scanning when I ran into a peculiar line of code (link):
// accept only char type matrices
CV_Assert(I.depth() != sizeof(uchar));
This code partially works because I.depth()
returns CV_8U
(which is 0), while sizeof(uchar)
returns 1. If an array of another type is passed in though, the code will fail unless (coincidentally) I.depth()
returns 1.
Here is what I recommend replacing these lines with:
// accept only char type matrices
CV_Assert(I.depth() == CV_8U);
By the way, I found that the above code was used correctly here: http://docs.opencv.org/doc/tutorials/core/mat-mask-operations/mat-mask-operations.html#the-basic-method.
Could you provide a documentation fix through a pull request? More info here. Thanks in advance!
@StevenPuttemans may i provide a documentation fix through a pull request http://docs.opencv.org/master/db/da5/...
yeah go ahead and add the PR link here!