Line extraction code based on opencv