moonfighting / PencilDrawing--python-version

An implentation of PencilDrawing using python
11 stars 4 forks source link

ValueError: operands could not be broadcast together with shapes (668,460) (460,460) #1

Open iairose opened 7 years ago

iairose commented 7 years ago

Traceback (most recent call last): File "./pencil_draw.py", line 181, in res = pencil_drawing(img_path, pencil_texture) File "./pencil_draw.py", line 163, in pencil_drawing S = get_stroke(img, 3, 8) File "./pencil_draw.py", line 44, in get_stroke img_gredient = imX + imY ValueError: operands could not be broadcast together with shapes (668,460) (460,460)

murez commented 6 years ago

I have a sample problem fixing QAQ

murez commented 6 years ago

I have fixed it

first err in the function 'get_stroke' :

imX = np.append(np.absolute(img[:, 0: width - 1] - img[:, 1: width]), np.zeros((height, 1)), axis=1)
imY = np.append(np.absolute(img[0: height - 1, :] - img[1: height, :]), np.zeros((1, width)), axis=0)

second err in the 'function get_eight_directions' :

y = int(half_len - int(round((x + 1 - half_len) * math.tan(math.pi * i / 8))))

some little err QAQ

murez commented 6 years ago

in my opinion this issue can close.

caterZhong commented 5 years ago

can you give the color result code ?

caterZhong commented 5 years ago

the code only can use for picture which width is equal to height, and the result is for from the matlab code