OpenCV(-206:Bad flag (parameter or structure field)) Unrecognized or unsupported array type [How to Solve]

This problem occurred when I ran C + + opencv code. I realized that the mask format I entered was incorrect, not the. PNG or. JPG problem I wrote. The source of the problem may be that CV2. Imread() is loading an empty matrix. Instead of delving into this problem, I will check your input image and mask name and format again. I think this error is a sign that the image cannot be loaded correctly. You need to check your code imread read read problem, whether the file name is correct and whether there is a problem with the file input path. Finally, I changed the way the file path was read

My modification: change the input path in the program parameters to:

The above is my solution to this problem, the correct operation of the modified code.


Read More: