A image library combines OpenCV and NumSharp together. SharpCV
returns Mat
object with NDArray
supported, which makes it easier to do data manipulation like slicing.
Install OpenCV prebuild binary
PM> Install-Package OpenCvSharp4.runtime.win
PM> Install-Package SharpCV
using static SharpCV.Binding;
// convert to black-white image
var img = cv2.imread("solar.jpg");
var gray = cv2.cvtColor(img, ColorConversionCodes.COLOR_RGB2GRAY);
var (ret, binary) = cv2.threshold(gray, 0, 255, ThresholdTypes.THRESH_BINARY | ThresholdTypes.THRESH_TRIANGLE);
cv2.imshow("black-white", binary);
cv2.waitKey(0);