Electronic component positioning method and system based on image processing algorithm
Through image processing algorithms, including local contrast enhancement and convolutional neural network classification models, the problem of low positioning accuracy of electronic components in traditional technology is solved, and precise positioning and efficient identification of small electronic components are achieved.
Patent Information
- Application Number
- CN202410876741.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional electronic component positioning technology is difficult to clearly capture the details of small electronic components, resulting in low recognition accuracy and high misrecognition rate. Existing technologies cannot effectively solve this problem.
Methods based on image processing algorithms, including local contrast enhancement, region growing segmentation, morphological expansion, convolutional neural network classification model and transfer learning technology, are used to extract and classify the boundary features of electronic components and generate their coordinates to locate their locations.
It improves the recognition accuracy and positioning accuracy of electronic components, enhances the recognizability of boundary features of small electronic components, improves the adaptability and generalization ability of the classification model, and ensures the precise positioning of electronic components.
Smart Images

Figure CN118674772A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an electronic component positioning method and system based on an image processing algorithm. Background Art
[0002] Electronic components are the basic physical units that make up electronic devices. They play a key role on circuit boards, enabling circuits to perform specific functions. Electronic components include a variety of different parts, such as resistors, capacitors, transistors, diodes, integrated circuits (ICs), transformers, etc. Each component has its own specific functions and characteristics.
[0003] Electronic component positioning plays a vital role in the circuit design and manufacturing process. Correct component positioning ensures the functionality, efficiency and reliability of the circuit and the performance of the final product. Component positioning directly affects the functional realization of the circuit. Each electronic component needs to be placed in the correct position in the circuit to ensure that the function of the circuit diagram design can be realized. Incorrect positioning may cause the circuit function to fail to meet the standard or completely fail.
[0004] However, in the process of locating electronic components, traditional imaging and recognition technologies may be limited by the resolution of the camera equipment. For particularly small electronic components, it is difficult to clearly capture enough details for effective recognition and positioning. If the features of small electronic components cannot be locally enhanced, it will be difficult for the image recognition algorithm to correctly identify the shape, size and position of the components, which will reduce the recognition accuracy of electronic components and increase the misrecognition rate.
[0005] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention
[0006] In view of the deficiencies in the prior art, the present invention provides an electronic component positioning method and system based on an image processing algorithm, which has the advantage of accurately positioning electronic components, thereby solving the problem of low recognition accuracy of electronic components.
[0007] In order to achieve the above advantages of accurate positioning of electronic components, the specific technical solutions adopted by the present invention are as follows:
[0008] According to one aspect of the present invention, there is provided an electronic component positioning method based on an image processing algorithm, the electronic component positioning method based on an image processing algorithm comprising the following steps:
[0009] S1, collecting a circuit board image, and performing local enhancement processing on a high contrast area in the circuit board image to obtain an optimized circuit board image after local enhancement;
[0010] S2, segmenting and optimizing the circuit board image to obtain local images, and extracting boundary features of electronic components in each segmented local image;
[0011] S3. Build a classification model to classify the boundary features of electronic components, and introduce transfer learning to optimize the classification model;
[0012] S4. Extract feature points on the boundary features of the electronic component, convert them into electronic component coordinates, and locate the position of the electronic component based on the electronic component coordinates.
[0013] Furthermore, collecting the circuit board image and performing local enhancement processing on the high contrast area in the circuit board image to obtain the optimized circuit board image after local enhancement includes the following steps:
[0014] S11, using a camera device to capture a circuit board image, and loading the circuit board image into an image processing software, and combining a high dynamic range synthesis algorithm to generate a circuit board image with a wide dynamic range;
[0015] S12, marking a high contrast area to be enhanced in the circuit board image containing a wide dynamic range by using an image editing technique;
[0016] S13, using a local contrast enhancement algorithm to sequentially perform local enhancement processing and sharpening processing on the marked high contrast areas to obtain an optimized circuit board image after local enhancement.
[0017] Furthermore, segmenting and optimizing the circuit board image to obtain local images, and extracting the boundary features of the electronic components in each segmented local image includes the following steps:
[0018] S21, segmenting the optimized circuit board image after local enhancement using a region growing segmentation algorithm to obtain a segmented local image;
[0019] S22, extracting the boundary features of each electronic component in the segmented local image, and respectively calculating the morphological features of the boundary features of each electronic component;
[0020] S23, comparing the calculation result of the morphological feature with a preset threshold, and dividing the large component boundary feature and the small component boundary feature based on the comparison result;
[0021] S24, presetting the expansion times of the morphological expansion algorithm, and using the morphological expansion algorithm to perform morphological expansion processing on the boundary features of the small component.
[0022] Furthermore, presetting the expansion times of the morphological expansion algorithm and using the morphological expansion algorithm to perform morphological expansion processing on the boundary features of the small component includes the following steps:
[0023] S241, identifying the spatial topological relationship of each pixel in the segmented local image, and establishing an image topological fractal search model based on the spatial topological relationship of each pixel;
[0024] S242, generating target pixel information of small component boundary features using an image topology fractal search model;
[0025] S243, performing expansion calculation on the small component boundary feature based on the target pixel information of the small component boundary feature, and performing clustering processing to remove isolated pixels in the local image after the expansion processing.
[0026] Furthermore, building a classification model to classify the boundary features of electronic components and introducing transfer learning to optimize the classification model includes the following steps:
[0027] S31. Define the loss function for the classification task and use the convolutional neural network as the training environment for the classification model;
[0028] S32, extracting local images to generate training data sets to train the classification model, and using the trained classification model to perform Gaussian filtering and sliding extraction on the local images in sequence;
[0029] S33, segmenting the local images after sliding extraction according to the time series, and marking the position of each local image to form a comprehensive training data set;
[0030] S34, optimizing the classification model using the comprehensive training data set to obtain an optimized classification model after Gaussian filtering, and classifying the boundary features of the electronic components using the optimized classification model;
[0031] S35. In the process of classifying the boundary features of electronic components, the transfer learning technology is used to adjust the parameters of the optimized classification model to adapt to the classification of the boundary features of small components.
[0032] Furthermore, in the process of classifying the boundary features of electronic components, the optimization classification model is adjusted by using transfer learning technology to adapt to the classification of the boundary features of small components, which includes the following steps:
[0033] S351, in the process of classifying the boundary features of the electronic components by optimizing the classification model, using the chaotic map to initialize the network weights of the convolutional neural network;
[0034] S352, optimizing the deep belief network structure for the comprehensive training data set, and using the optimal network structure to pre-train the source domain training set in the comprehensive training data set;
[0035] S353, based on the pre-training of the source domain training set, introducing a preset number of target domain training sets and performing weight tuning through back propagation;
[0036] S354. Migrate the tuned optimal network structure to the optimized classification model to improve the classification ability of the optimized classification model for small component boundary features.
[0037] Furthermore, extracting feature points on the boundary features of the electronic component to convert and generate electronic component coordinates, and locating the position of the electronic component based on the electronic component coordinates includes the following steps:
[0038] S41, extracting feature points of boundary features of electronic components using a corner detection algorithm, and generating a feature descriptor for each feature point;
[0039] S42, calculating the coordinates of each feature point based on the feature descriptor of each feature point, and converting the coordinates of the feature point into an actual position in the optimized circuit board image using a transformation matrix;
[0040] S43, clustering the feature points using a clustering algorithm, and locating the position of each electronic component by optimizing the actual position in the circuit board image.
[0041] Furthermore, extracting feature points of the boundary features of the electronic component using a corner detection algorithm and generating a feature descriptor for each feature point includes the following steps:
[0042] S411, calculating a gradient matrix of a boundary feature of the electronic component, generating a gradient histogram based on the gradient matrix, and calculating a response function of the boundary feature of the electronic component based on the gradient histogram;
[0043] S412, comparing the response function value with a preset threshold, and taking the response function value greater than the preset threshold as a corner point candidate;
[0044] S413, performing non-maximum suppression in the neighborhood of the corner point candidate point, retaining local feature points, and performing feature description on each local feature point to generate a feature descriptor for each feature point.
[0045] Furthermore, the expression of the gradient histogram is:
[0046] h k =∑ (i,j)∈block m ij ·δ(θ ij -θ k );
[0047] In the formula, h k Represents the gradient histogram in the kth direction; m ij is the gradient magnitude of pixel (i, j); θ ijis the gradient direction of the gradient histogram; θ k is the center of the kth direction in the gradient histogram; δ is the Dirac function.
[0048] According to another aspect of the present invention, there is also provided an electronic component positioning system based on an image processing algorithm, the electronic component positioning system based on an image processing algorithm comprises an image enhancement module, a boundary feature extraction module, a boundary feature classification module and an electronic component positioning module;
[0049] An image enhancement module is used to collect a circuit board image and perform local enhancement processing on a high contrast area in the circuit board image to obtain an optimized circuit board image after local enhancement;
[0050] A boundary feature extraction module is used to segment and optimize the circuit board image to obtain local images, and extract boundary features of electronic components in each segmented local image;
[0051] The boundary feature classification module is used to build a classification model to classify the boundary features of electronic components and introduce transfer learning to optimize the classification model;
[0052] The electronic component positioning module is used to extract feature points on the boundary features of the electronic component, convert them into electronic component coordinates, and locate the position of the electronic component based on the electronic component coordinates.
[0053] Compared with the prior art, the present invention provides an electronic component positioning method and system based on image processing algorithm, which has the following beneficial effects:
[0054] (1) The present invention uses a region growing segmentation algorithm to segment the optimized circuit board image after local enhancement, effectively separates each local image, extracts the boundary features of the electronic components in the segmented local images and calculates their morphological features, thereby identifying electronic components of different shapes and sizes through fine morphological analysis, and at the same time performs morphological expansion processing on the boundary features of small components, thereby effectively enhancing the boundary features of small electronic components, ensuring the recognizability of small electronic components in the image, and further improving the precise positioning of electronic components.
[0055] (2) The present invention utilizes a convolutional neural network as a training environment for the classification model, which can efficiently extract and classify the boundary features of electronic components, and optimizes the classification model through a comprehensive training data set, thereby improving the accuracy and reliability of the classification model in practical applications. At the same time, the transfer learning technology is introduced in the process of classifying the boundary features of electronic components to make it adapt to the classification of the boundary features of small components, thereby not only improving the adaptability and generalization ability of the classification model, but also being able to accurately locate the position of electronic components based on various boundary features. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 is a flow chart of an electronic component positioning method based on an image processing algorithm according to an embodiment of the present invention;
[0058] Figure 2 4 is a principle block diagram of an electronic component positioning system based on an image processing algorithm according to an embodiment of the present invention.
[0059] In the figure:
[0060] 1. Image enhancement module; 2. Boundary feature extraction module; 3. Boundary feature classification module; 4. Electronic component positioning module. DETAILED DESCRIPTION
[0061] To further illustrate each embodiment, the present invention provides drawings, which are part of the disclosure of the present invention and are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in the field should be able to understand other possible implementations and advantages of the present invention. The components in the figures are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0062] According to an embodiment of the present invention, a method and system for locating electronic components based on an image processing algorithm are provided.
[0063] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to an electronic component positioning method and system based on an image processing algorithm according to an embodiment of the present invention, the electronic component positioning method based on an image processing algorithm includes the following steps:
[0064] S1. Collecting a circuit board image, and performing local enhancement processing on a high contrast area in the circuit board image to obtain an optimized circuit board image after local enhancement.
[0065] The process of collecting a circuit board image and performing local enhancement processing on a high contrast area in the circuit board image to obtain an optimized circuit board image after local enhancement includes the following steps:
[0066] S11. Use a camera device to capture a circuit board image, load the circuit board image into an image processing software, and combine it with a high dynamic range synthesis algorithm to generate a circuit board image with a wide dynamic range.
[0067] It should be noted that loading the circuit board image into the image processing software and combining the high dynamic range synthesis algorithm to generate a circuit board image with a wide dynamic range includes:
[0068] Load the circuit board image into image processing software, such as HDR (High Dynamic Range imaging) software; use the automatic alignment function of the image processing software to correct the image to ensure that the images at each exposure level are aligned at the pixel level; select the option of synthesizing HDR in the image processing software, including setting the image for synthesis and adjusting parameters such as exposure value, alignment options, etc.; select a tone mapping algorithm to convert the HDR image to a standard dynamic range suitable for display on the display device, and adjust the tone mapping parameters such as brightness, contrast and saturation as needed to achieve the best visual effect.
[0069] S12, marking a high contrast area to be enhanced in the circuit board image containing a wide dynamic range by using an image editing technique;
[0070] S13, using a local contrast enhancement algorithm to sequentially perform local enhancement processing and sharpening processing on the marked high contrast areas to obtain an optimized circuit board image after local enhancement.
[0071] S2. Segment and optimize the circuit board image to obtain local images, and extract boundary features of electronic components in each segmented local image.
[0072] The step of segmenting and optimizing the circuit board image to obtain a local image and extracting the boundary features of the electronic components in each segmented local image includes the following steps:
[0073] S21. Segment the locally enhanced optimized circuit board image using a region growing segmentation algorithm to obtain a segmented local image.
[0074] It should be noted that the optimized circuit board image after local enhancement is segmented using the region growing segmentation algorithm, and the segmented local image includes:
[0075] Select seed points (seed points are the key to the region growing algorithm. Seed points should be selected in areas with strong representativeness and uniform color or grayscale. In the circuit board image, the seed point can be a specific electronic component center or an obvious corner point); use the selected seed point as the starting point to initialize the growth area, traverse each pixel in the image, and decide whether to add it to the current area according to the set growth criteria and perform an iterative process; during the iterative process, continuously add adjacent pixels that meet the conditions to the growth area until no more pixels that meet the conditions can be added; merge adjacent areas with similar characteristics to reduce overly fragmented segmentation results, and evaluate the segmentation results to check whether all electronic components and related areas are accurately segmented.
[0076] S22, extracting the boundary features of each electronic component in the segmented local image, and respectively calculating the morphological features of the boundary features of each electronic component;
[0077] S23, comparing the calculation result of the morphological feature with a preset threshold, and dividing the large component boundary feature and the small component boundary feature based on the comparison result;
[0078] S24, presetting the expansion times of the morphological expansion algorithm, and using the morphological expansion algorithm to perform morphological expansion processing on the boundary features of the small component.
[0079] The process of presetting the expansion times of the morphological expansion algorithm and performing morphological expansion processing on the boundary features of the small component by using the morphological expansion algorithm includes the following steps:
[0080] S241, identifying the spatial topological relationship of each pixel in the segmented local image, and establishing an image topological fractal search model based on the spatial topological relationship of each pixel.
[0081] It should be noted that identifying the spatial topological relationship of each pixel in the segmented local image and establishing an image topological fractal search model based on the spatial topological relationship of each pixel includes:
[0082] S242, generating target pixel information of small component boundary features using an image topology fractal search model;
[0083] S243, performing expansion calculation on the small component boundary feature based on the target pixel information of the small component boundary feature, and performing clustering processing to remove isolated pixels in the local image after the expansion processing.
[0084] S3. Build a classification model to classify the boundary features of electronic components, and introduce transfer learning to optimize the classification model.
[0085] Among them, building a classification model to classify the boundary features of electronic components and introducing transfer learning to optimize the classification model includes the following steps:
[0086] S31. Define the loss function for the classification task and use the convolutional neural network as the training environment for the classification model;
[0087] S32, extracting local images to generate training data sets to train the classification model, and using the trained classification model to perform Gaussian filtering and sliding extraction on the local images in sequence;
[0088] S33, segmenting the local images after sliding extraction according to the time series, and marking the position of each local image to form a comprehensive training data set;
[0089] S34, optimizing the classification model using the comprehensive training data set to obtain an optimized classification model after Gaussian filtering, and classifying the boundary features of the electronic components using the optimized classification model;
[0090] S35. In the process of classifying the boundary features of electronic components, the transfer learning technology is used to adjust the parameters of the optimized classification model to adapt to the classification of the boundary features of small components.
[0091] Among them, in the process of classifying the boundary features of electronic components, the optimization classification model is adjusted by using transfer learning technology to adapt to the classification of the boundary features of small components, which includes the following steps:
[0092] S351, in the process of classifying the boundary features of the electronic components by optimizing the classification model, using the chaotic map to initialize the network weights of the convolutional neural network;
[0093] S352, optimizing the deep belief network structure for the comprehensive training data set, and using the optimal network structure to pre-train the source domain training set in the comprehensive training data set;
[0094] S353, based on the pre-training of the source domain training set, introducing a preset number of target domain training sets and performing weight tuning through back propagation;
[0095] S354. Migrate the tuned optimal network structure to the optimized classification model to improve the classification ability of the optimized classification model for small component boundary features.
[0096] S4. Extract feature points on the boundary features of the electronic component, convert them into electronic component coordinates, and locate the position of the electronic component based on the electronic component coordinates.
[0097] The extraction of feature points on the boundary features of the electronic component to generate electronic component coordinates, and the positioning of the electronic component based on the electronic component coordinates includes the following steps:
[0098] S41, extracting feature points of boundary features of electronic components using a corner detection algorithm, and generating a feature descriptor for each feature point.
[0099] The process of extracting feature points of boundary features of electronic components by using a corner detection algorithm and generating a feature descriptor for each feature point includes the following steps:
[0100] S411 , calculating a gradient matrix of a boundary feature of the electronic component, generating a gradient histogram based on the gradient matrix, and calculating a response function of the boundary feature of the electronic component based on the gradient histogram.
[0101] Among them, the expression of the gradient histogram is:
[0102] h k =Σ (i,j)∈block m in ·δ(θ ij -θ k );
[0103] In the formula, h k represents the gradient histogram in the kth direction; m ij is the gradient magnitude of pixel (i, j); θ ij is the gradient direction of the gradient histogram; θ k is the center of the kth direction in the gradient histogram; δ is the Dirac function.
[0104] S412, comparing the response function value with a preset threshold, and taking the response function value greater than the preset threshold as a corner point candidate;
[0105] S413, performing non-maximum suppression in the neighborhood of the corner point candidate point, retaining local feature points, and performing feature description on each local feature point to generate a feature descriptor for each feature point.
[0106] S42, calculating the coordinates of each feature point based on the feature descriptor of each feature point, and converting the coordinates of the feature point into an actual position in the optimized circuit board image using a transformation matrix.
[0107] It should be noted that calibration data is needed to determine the transformation matrix. For example, if the precise positions of certain points in the circuit board image in the real world are known, the transformation matrix can be calculated using these points. The coordinates of each feature point are calculated based on the feature descriptor of each feature point, and the coordinates of the feature point are converted into the actual position in the optimized circuit board image using the transformation matrix, including:
[0108] The feature point coordinates are mapped to a new coordinate system (e.g., from image coordinates to actual physical positions) through scaling, rotation, and translation transformations. The image coordinates of the feature points are converted into actual world coordinates using the calculated transformation matrix, and the image coordinates of each feature point are mapped to the actual position of the optimized circuit board image. The accuracy of the coordinate transformation is evaluated to ensure that the actual position of the feature point matches the expected position.
[0109] S43, clustering the feature points using a clustering algorithm, and locating the position of each electronic component by optimizing the actual position in the circuit board image.
[0110] like Figure 2 As shown, according to another embodiment of the present invention, there is also provided an electronic component positioning system based on an image processing algorithm, the electronic component positioning system based on an image processing algorithm comprises an image enhancement module 1, a boundary feature extraction module 2, a boundary feature classification module 3 and an electronic component positioning module 4;
[0111] The image enhancement module 1 is used to collect the circuit board image and perform local enhancement processing on the high contrast area in the circuit board image to obtain the optimized circuit board image after local enhancement;
[0112] The boundary feature extraction module 2 is used to segment and optimize the circuit board image to obtain local images, and extract the boundary features of the electronic components in each segmented local image;
[0113] The boundary feature classification module 3 is used to construct a classification model to classify the boundary features of electronic components, and introduce transfer learning to optimize the classification model;
[0114] The electronic component positioning module 4 is used to extract feature points on the boundary features of the electronic component, convert them into electronic component coordinates, and locate the position of the electronic component based on the electronic component coordinates.
[0115] To sum up, with the help of the above-mentioned technical scheme of the present invention, the present invention uses the regional growing segmentation algorithm to segment the optimized circuit board image after local enhancement, effectively separates each local image, extracts the boundary features of the electronic components in the segmented local image and calculates its morphological features, thereby identifying electronic components of different shapes and sizes through fine morphological analysis, and at the same time, performs morphological expansion processing on the boundary features of small components, thereby effectively enhancing the boundary features of small electronic components, ensuring the recognizability of small electronic components in the image, and further improving the precise positioning of electronic components; the present invention uses a convolutional neural network as a training environment for the classification model, which can efficiently extract and classify the boundary features of electronic components, and optimizes the classification model through a comprehensive training data set, thereby improving the accuracy and reliability of the classification model in practical applications, and at the same time, introduces transfer learning technology in the process of classifying the boundary features of electronic components to adapt it to the classification of the boundary features of small components, thereby not only improving the adaptability and generalization ability of the classification model, but also being able to accurately locate the position of electronic components based on various boundary features.
[0116] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An electronic component positioning method based on image processing algorithm, characterized in that: The electronic component positioning method based on the image processing algorithm comprises the following steps: S1, collecting a circuit board image, and performing local enhancement processing on a high contrast area in the circuit board image to obtain an optimized circuit board image after local enhancement; S2, segmenting and optimizing the circuit board image to obtain local images, and extracting boundary features of electronic components in each segmented local image; S3. Build a classification model to classify the boundary features of electronic components, and introduce transfer learning to optimize the classification model; S4. Extract feature points on the boundary features of the electronic component, convert them into electronic component coordinates, and locate the position of the electronic component based on the electronic component coordinates.
2. The electronic component positioning method based on image processing algorithm according to claim 1, characterized in that: The method of collecting the circuit board image and performing local enhancement processing on the high contrast area in the circuit board image to obtain the optimized circuit board image after local enhancement includes the following steps: S11, using a camera device to capture a circuit board image, and loading the circuit board image into an image processing software, and combining a high dynamic range synthesis algorithm to generate a circuit board image with a wide dynamic range; S12, marking a high contrast area to be enhanced in the circuit board image containing a wide dynamic range by using an image editing technique; S13, using a local contrast enhancement algorithm to sequentially perform local enhancement processing and sharpening processing on the marked high contrast areas to obtain an optimized circuit board image after local enhancement.
3. The electronic component positioning method based on image processing algorithm according to claim 2, characterized in that: The segmentation and optimization of the circuit board image to obtain local images and the extraction of boundary features of electronic components in each segmented local image include the following steps: S21, segmenting the optimized circuit board image after local enhancement using a region growing segmentation algorithm to obtain a segmented local image; S22, extracting the boundary features of each electronic component in the segmented local image, and respectively calculating the morphological features of the boundary features of each electronic component; S23, comparing the calculation result of the morphological feature with a preset threshold, and dividing the large component boundary feature and the small component boundary feature based on the comparison result; S24, presetting the expansion times of the morphological expansion algorithm, and using the morphological expansion algorithm to perform morphological expansion processing on the boundary features of the small component.
4. The electronic component positioning method based on image processing algorithm according to claim 3 is characterized in that: The method of presetting the expansion times of the morphological expansion algorithm and performing morphological expansion processing on the boundary features of the small component by using the morphological expansion algorithm comprises the following steps: S241, identifying the spatial topological relationship of each pixel in the segmented local image, and establishing an image topological fractal search model based on the spatial topological relationship of each pixel; S242, generating target pixel information of small component boundary features using an image topology fractal search model; S243, performing expansion calculation on the small component boundary feature based on the target pixel information of the small component boundary feature, and performing clustering processing to remove isolated pixels in the local image after the expansion processing.
5. The electronic component positioning method based on image processing algorithm according to claim 4, characterized in that: The construction of a classification model to classify the boundary features of electronic components and the introduction of transfer learning to optimize the classification model include the following steps: S31. Define the loss function for the classification task and use the convolutional neural network as the training environment for the classification model; S32, extracting local images to generate training data sets to train the classification model, and using the trained classification model to perform Gaussian filtering and sliding extraction on the local images in sequence; S33, segmenting the local images after sliding extraction according to the time series, and marking the position of each local image to form a comprehensive training data set; S34, optimizing the classification model using the comprehensive training data set to obtain an optimized classification model after Gaussian filtering, and classifying the boundary features of the electronic components using the optimized classification model; S35. In the process of classifying the boundary features of electronic components, the transfer learning technology is used to adjust the parameters of the optimized classification model to adapt to the classification of the boundary features of small components.
6. The electronic component positioning method based on image processing algorithm according to claim 5, characterized in that: In the process of classifying the boundary features of electronic components, the method of adjusting the parameters of the optimized classification model by using the transfer learning technology to adapt to the classification of the boundary features of small components includes the following steps: S351, in the process of classifying the boundary features of the electronic components by optimizing the classification model, using the chaotic map to initialize the network weights of the convolutional neural network; S352, optimizing the deep belief network structure for the comprehensive training data set, and using the optimal network structure to pre-train the source domain training set in the comprehensive training data set; S353, based on the pre-training of the source domain training set, introducing a preset number of target domain training sets and performing weight tuning through back propagation; S354. Migrate the tuned optimal network structure to the optimized classification model to improve the classification ability of the optimized classification model for small component boundary features.
7. The electronic component positioning method based on image processing algorithm according to claim 6, characterized in that: The extracting feature points on the boundary features of the electronic components and converting them into electronic component coordinates, and locating the electronic component position based on the electronic component coordinates comprises the following steps: S41, extracting feature points of boundary features of electronic components using a corner detection algorithm, and generating a feature descriptor for each feature point; S42, calculating the coordinates of each feature point based on the feature descriptor of each feature point, and converting the coordinates of the feature point into an actual position in the optimized circuit board image using a transformation matrix; S43, clustering the feature points using a clustering algorithm, and locating the position of each electronic component by optimizing the actual position in the circuit board image.
8. The electronic component positioning method based on image processing algorithm according to claim 7, characterized in that: The method of extracting feature points of boundary features of electronic components by using a corner detection algorithm and generating a feature descriptor for each feature point comprises the following steps: S411, calculating a gradient matrix of a boundary feature of the electronic component, generating a gradient histogram based on the gradient matrix, and calculating a response function of the boundary feature of the electronic component based on the gradient histogram; S412, comparing the response function value with a preset threshold, and taking the response function value greater than the preset threshold as a corner point candidate; S413, performing non-maximum suppression in the neighborhood of the corner point candidate point, retaining local feature points, and performing feature description on each local feature point to generate a feature descriptor for each feature point.
9. The electronic component positioning method based on image processing algorithm according to claim 8, characterized in that: The expression of the gradient histogram is: h k =∑ (i,j)∈block m ij ·δ(θ ij -θ k ); In the formula, h k Represents the gradient histogram in the kth direction; m ij is the gradient magnitude of pixel (i, j); θ ij is the gradient direction of the gradient histogram; θ k is the center of the kth direction in the gradient histogram; δ is the Dirac function.
10. An electronic component positioning system based on an image processing algorithm, used to implement the electronic component positioning method based on an image processing algorithm as described in any one of claims 1 to 9, characterized in that: The electronic component positioning system based on the image processing algorithm includes an image enhancement module, a boundary feature extraction module, a boundary feature classification module and an electronic component positioning module; The image enhancement module is used to collect the circuit board image and perform local enhancement processing on the high contrast area in the circuit board image to obtain the optimized circuit board image after local enhancement; The boundary feature extraction module is used to segment and optimize the circuit board image to obtain local images, and extract the boundary features of the electronic components in each segmented local image; The boundary feature classification module is used to construct a classification model to classify the boundary features of electronic components, and introduce transfer learning to optimize the classification model; The electronic component positioning module is used to extract feature points on the boundary features of the electronic component, convert them into electronic component coordinates, and locate the position of the electronic component based on the electronic component coordinates.
