Hi I have the following picture, how to use edge detection to return the result which is equal to 4?
Here are the original image link: https://1drv.ms/u/s!An0pWQPDB_ImjGu_nQGSvG3fUBPS
I think for your example you are rather looking for corner detection like the Harris algorithm. Edge detection would match too many edges.
General information on corner detection: Corner Detection on Wikipedia
And for OpenCV: Harris Corner Detection