The invention discloses a PCB
copper-clad circuit skeleton contour extraction method based on an improved spur removal
algorithm, and the method comprises the steps: searching eight neighborhoods of a pixel point, recording the pixel point according with a
cross point principle as a
cross point, and putting the
cross point into a set Cross; setting the pixel value at the acquired cross point Cross from 1 to 0, putting all separated
branch skeletons into a set Branchs, selecting a skeleton of which the Length feature is greater than Length from the skeleton set Branchs, and putting the selected skeleton into a set
Trunk_Skeletion; selecting a
trunk Trunk0 in the
Trunk_Skeletion, calculating the tangential direction T1 of an end point of the
trunk Trunk0, setting Cross0 corresponding to the end point from 0 to 1, traversing the Branchs, calculating the tangential direction of a
branch near the end point, and if the tangential direction and the T1 form an angle of 180 degrees, merging the
branch to obtain a new
trunk Trunk0; traversing elements in the Trunk_Skeletion, repeating the operation in the step S3, and finally obtaining a plurality of trunk skeleton lines Trunk0, Trunk1, Trunk2...; S4, combining the Trunk 0, the Trunk 1, the Trunk 2 and the like obtained in the step S4, and obtaining the whole main skeleton Main_Skeletion. According to the extraction method, the outline of the PCB circuit skeleton can be effectively extracted.