私はPythonが初めてで、次のコードを実行しようとしていますが、次のエラーが発生します:
im[:,:,0] = f
ValueError: could not broadcast input array from shape (700,900,3) into shape (700,900)
誰かがそれを手伝ってくれますか?
img = numpy.zeros((700, 900))
row_idx = 160
curve = []
count = 0
for i in range(0, 900):
contour.append((row_idx, i))
values, num_values = get_values(curve);
a = imread('20091016_seg1_26_18245948_1chop.png')
f = numpy.rot90(a, 2)
f = numpy.rot90(a, 2)
size_vec = numpy.shape(img)
im = numpy.zeros((size_vec[0],size_vec[1], 3));
im[:,:,0] = f
im[:,:,1] = f
im[:,:,2] = f
for i in range(0, num_values):
im[values[i].y, values[i].x, 0] = 0.0
im[values[i].y, values[i].x, 1] = 1.0
im[values[i].y, values[i].x, 2] = 0.0
imsave('OUTPUT.png', im)
(セミコロンを削除)