how calculate length of detected line in image openCV Numpy - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: how calculate length of detected line in image openCV Numpy (/thread-19046.html) |
how calculate length of detected line in image openCV Numpy - taomihiranga - Jun-11-2019 I coding for detect lines in simple blueprint image and calculate full length of detected lines i coded using opencv detect lines in image. i don't know how get detect lines and how calculate length. this is my current code import cv2 import numpy as np import matplotlib from matplotlib.pyplot import imshow from matplotlib import pyplot as plt # white color mask img = cv2.imread(filein) #converted = convert_hls(img) image = cv2.cvtColor(img,cv2.COLOR_BGR2HLS) lower = np.uint8([0, 200, 0]) upper = np.uint8([255, 255, 255]) white_mask = cv2.inRange(image, lower, upper) # yellow color mask lower = np.uint8([10, 0, 100]) upper = np.uint8([40, 255, 255]) yellow_mask = cv2.inRange(image, lower, upper) # combine the mask mask = cv2.bitwise_or(white_mask, yellow_mask) result = img.copy() cv2.imshow("mask",mask) what functions should i use how identify and measure lines |