pfnet / PaintsChainer

line drawing colorization using chainer
https://paintschainer.preferred.tech/
MIT License
3.77k stars 557 forks source link

How to convert img to lines? #86

Closed chudanwu closed 7 years ago

chudanwu commented 7 years ago

Hi taizan ! I have read the translation of http://qiita.com/taizan/items/cf77fd37ec3a0bef5d9d you mention that you convert img to line drawing using opencv In img2imgDataset.py , I just found ret, image1 = cv2.threshold( image1, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU) Is it the method you used? if no, I would like to know which method you used and I would also like to know how it works, could you explaint it a little bit?

Thanks a lot!

taizan commented 7 years ago

the code in img2img dose not provide lines. it only add noise to learing. you should make lines previously. you can use opencv or liner_f model to provide line image. if you use opencv, try dilate and absdiff like code in below article. http://www.mathgram.xyz/entry/cv/contour

chudanwu commented 7 years ago

thanks for answering, it seens that the lines is just low level feature but considering the application it works fine.