Here's an example code to find corners of an object in an image using Canny and Sobel edge detection in MATLAB:
711 chars30 lines
In the code above, we first read the input image and convert it to grayscale. Then, we apply Sobel and Canny edge detection algorithms to the grayscale image. Next, we use the Harris corner detection method on the Sobel image to find the corners. We display the Sobel edges and detected corners on the input image. We then repeat the same process using the FAST corner detection method on the Canny image. Finally, we display the Canny edges and detected corners on the input image.
Note that the choice of threshold values in the edge detection algorithms can greatly affect the resulting corners. You may need to tune these values for your specific image to get the best results.
gistlibby LogSnag