1. A method for scanning edges of an object being executed by a processor of a computing device, the method comprising: setting a start point and an end point of the object, and setting a scan direction and a scan distance interval for scanning the edges of the object; determining a current scan point on the edges of the object according to the start point, the scan direction, and the scan distance interval; aiming an image capturing device at the current scan point, wherein the image capturing device is comprised in an image measuring machine connected to the computing device; controlling the image capturing device to move within a predetermined range along a Z-axis of the image measuring machine and capture images of the object, and recording a focal point of the image capturing device corresponding to each of the images; calculating a definition value of each of the images and determining an image with a highest definition value from the images; determining a focal point of the image capturing device corresponding to the image with the highest definition value, and determining coordinates of the current scan point according to the focal point of the image capturing device corresponding to the image with the highest definition value; and determining whether the current scan point arrives at the end point according to the coordinates of the current scan point; obtaining all scan points of the edges of the object if the current scan point arrives at the end point; and forming scanned edges of the object based on all the scan points.