opencv - line detection (detect grid) from image
20:15 14 May 2019

I want to extract grid from image, to be able to measure "things" on other picture taken from the same camera. the distance between each square is 1 meter. I can detect lines (not perfect).

I need help to get cleaner lines, and also to get the intersection points coords in pixel, as an array.

here the processed image

enter image description here

and a screenshot of the result

enter image description here

Here my code

 const cv2 = require('opencv4nodejs');
    let image1 = cv2.imread('./mypicture.jpg')
    let gray=image1.bgrToGray()
    let dst = gray.canny(500, 800,3)
    let lines= dst.houghLines(2, Math.PI/180.0, 150);
    let points = [];
    let isLine=(pt1,pt2,maxX=2851,maxY=10)=>{
        return Math.abs(pt1.x - pt2.x ){
        return points.some((point)=>{
            return Math.abs(point.x-pt.x)
javascript node.js opencv computer-vision