I want to find the corners of the image attached.
I tried finding the canny edges to make it easier as I was only left with the plank edges but Im not sure this is the best approach.( maybe drawing straight lines through the fainted edges and then find corners but I dont know how I could do it)
I am looking to find the 2 edges of this wooden plank

Code is:
import numpy as np
from matplotlib import pyplot as plt
from scipy import ndimage
from skimage import filter
import cv2
img = cv2.imread('/.../plank5.jpg',0)
edges11 = cv2.Canny(img,100,200)
edges22 = cv2.Canny(img,380,460)
plt.subplot(131)
plt.imshow(img,cmap='gray')
plt.axis('off')
plt.title('Gray Image', fontsize=20)
plt.subplot(132)
plt.imshow(edges11,cmap = 'gray')
plt.axis('off')
plt.title('Lower MinVal', fontsize=20)
plt.subplot(133)
plt.imshow(edges22,cmap = 'gray')
plt.axis('off')
plt.title('Higher MinVal', fontsize=20)
plt.subplots_adjust(wspace=0.02, hspace=0.02, top=0.9,
bottom=0.02, left=0.02, right=0.98)
plt.show()
↧