0
이미지를 회색 음영으로 열고, numpy 플로트 배열로 변환하고, 많은 수학 연산을 수행 한 다음 정규화하고이를 이진으로 변환하는 코드가 있습니다. 이미지 (픽셀 당 1 비트)를 다시 디스크에 저장합니다 (PNG 파일).이미지를 float 배열로 변환하고 .NET에서 다시 변환합니다.
비슷한 작업을 수행하기 위해 .NET 클래스 (선호)를 사용해야합니까?
im = Image.open(in_name)
a = numpy.asarray(im.convert('L'), dtype=float) ## implicit conversion to grayscale
## lots of element-wise arithmetical operations with 'a'
## and other similar-shaped arrays from other images
out_im = Image.fromarray(a.astype('uint8')).convert('1')
out_im.save(out_name)