Find the corners of an object

asked 2016-05-26 10:28:51 -0500

TheBadai gravatar image

updated 2019-10-09 20:07:31 -0500

supra56 gravatar image

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

image description

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()
edit retag flag offensive close merge delete

Comments

2

please spare us duplicate questions

berak gravatar imageberak ( 2016-05-26 11:08:17 -0500 )edit

Hi Berak,

This question has been similarly asked but not successfully answered. I would be enormously grateful if someone could give a hand on this. My academic life depends on it.

Kindly

Jacob

TheBadai gravatar imageTheBadai ( 2016-05-27 04:45:40 -0500 )edit
3

My academic life depends on it. - geez...

LorenaGdL gravatar imageLorenaGdL ( 2016-05-27 04:54:45 -0500 )edit