Component selection method, device, computer equipment and storage medium
Through image recognition and contour extraction technology, the image coordinate points and distances are obtained by synchronous belt-type selection diagrams, and the component model is automatically determined, which solves the problems of low efficiency and poor accuracy of component selection in the existing technology, achieving high efficiency , accurate selection process.
Patent Information
- Application Number
- CN202011547169.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2040-12-24
AI Technical Summary
In the prior art, the component selection efficiency is low, the naked eye recognition method is cumbersome and inaccurate, and it cannot meet the needs of automation equipment, resulting in complex selection and poor accuracy.
By obtaining the synchronous belt type selection diagram, extracting the target contour, obtaining image coordinate points, calculating distances, determining component models based on distances, and using image recognition and contour extraction technology to reduce manual intervention errors and improve selection efficiency.
It realizes automation of component selection, improves selection efficiency and accuracy, and reduces the risk of errors caused by manual intervention.
Smart Images

Figure CN114677317B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automation equipment, and in particular to a component selection method, device, computer equipment and storage medium. Background Art
[0002] With the development of automation equipment technology, the demand for automation equipment in various fields has increased. The efficiency of component selection of equipment affects the equipment development cycle. The current component selection method is that engineers rely on naked eye recognition images (for example, non-linear curve graphs, i.e. synchronous belt type selection graphs) based on parameters to select the corresponding model or select based on manual experience; among them, the selection method of naked eye recognition is extremely cumbersome in the process of automatic calculation and selection, and cannot be recognized in batches, resulting in low selection accuracy and unable to meet the needs of automatic counting and selection.
[0003] However, in the current automatic calculation selection method, it is necessary to manually query the selection diagram and determine the selection result of the synchronous belt according to the power and speed, which makes the component selection operation complicated. Summary of the invention
[0004] Based on this, it is necessary to provide a component selection method, device, computer equipment and storage medium that can improve the efficiency of component selection in response to the above technical problems.
[0005] A component selection method, the method comprising:
[0006] Get the synchronous belt type selection diagram for selection;
[0007] Extracting a target profile representing component models in the synchronous belt type selection diagram;
[0008] Obtaining image coordinate points corresponding to component selection parameters; the image coordinate points are obtained based on the coordinates of the synchronous belt type selection diagram and the image coordinate conversion;
[0009] Determine a first distance between the image coordinate point and each of the target contours;
[0010] A target contour corresponding to the component is determined from the target contour according to each of the first distances to obtain a model of the component.
[0011] In one embodiment, the obtaining of image coordinate points corresponding to component selection parameters, wherein the image coordinate points are obtained based on the coordinates of the synchronous belt type selection diagram and the image coordinate conversion, includes:
[0012] Obtaining logarithmic coordinate points of component selection parameters in the coordinates of the synchronous belt selection diagram;
[0013] The logarithmic coordinate points are sequentially subjected to logarithmic coordinate transformation and affine matrix transformation to obtain image coordinate points in the image coordinates.
[0014] In one embodiment, before determining the distance between the image coordinate point and each of the target contours, the method further includes:
[0015] Determine an outer contour formed by each of the target contours;
[0016] Calculating a second distance between the image coordinate point and the outer contour;
[0017] When the second distance is greater than a second preset distance, the step of determining the first distance between the image coordinate point and each of the target contours is performed.
[0018] In one embodiment, determining the target contour corresponding to the component from the target contour according to each of the first distances to obtain the model of the component includes:
[0019] Determine the positional relationship between the image coordinate point and each of the target contours according to each of the first distances;
[0020] When the positional relationship is a preset positional relationship, determining a target first distance with a maximum value from the first distances satisfying the preset positional relationship, and acquiring a contour area of the target contour corresponding to the target first distance;
[0021] The model of the component is obtained according to the contour area.
[0022] In one embodiment, the step of obtaining a synchronous belt type selection diagram for selection includes:
[0023] Obtain the original drawing of synchronous belt type selection for selection;
[0024] The synchronous belt type selection original image is subjected to grayscale processing and binarization processing in sequence to obtain a synchronous belt type selection image for selection.
[0025] In one embodiment, the method further comprises:
[0026] The original image of the synchronous belt type selection is subjected to grayscale processing and binarization processing in sequence to obtain a binarized image;
[0027] When it is detected that the contour lines in the binary image are discontinuous, the binary image is sequentially subjected to dilation and erosion operations to obtain a synchronous belt type selection diagram for type selection.
[0028] In one embodiment, extracting the target profile representing the component model in the synchronous belt type selection diagram includes:
[0029] Extract all contours in the synchronous belt type selection diagram;
[0030] Determining the contour area of each of the contours according to the moment of each of the contours;
[0031] Delete the contours whose contour area is smaller than the preset area to obtain the target contour that represents the component model.
[0032] A component selection device, the device comprising:
[0033] A first acquisition module is used to acquire a synchronous belt type selection diagram for selection;
[0034] An extraction module, used for extracting a target profile representing a component model in the synchronous belt type selection diagram;
[0035] A second acquisition module is used to acquire image coordinate points corresponding to component selection parameters; the image coordinate points are obtained by converting the coordinates of the synchronous belt type selection diagram and the image coordinates;
[0036] A calculation module, used for determining a first distance between the image coordinate point and each of the target contours;
[0037] A selection module is used to determine the target contour corresponding to the component from the target contour according to each of the first distances, and obtain the model of the component.
[0038] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0039] Get the synchronous belt type selection diagram for selection;
[0040] Extracting a target profile representing component models in the synchronous belt type selection diagram;
[0041] Obtaining image coordinate points corresponding to component selection parameters; the image coordinate points are obtained based on the coordinates of the synchronous belt type selection diagram and the image coordinate conversion;
[0042] Determine a first distance between the image coordinate point and each of the target contours;
[0043] A target contour corresponding to the component is determined from the target contour according to each of the first distances to obtain a model of the component.
[0044] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0045] Get the synchronous belt type selection diagram for selection;
[0046] Extracting a target profile representing component models in the synchronous belt type selection diagram;
[0047] Obtaining image coordinate points corresponding to component selection parameters; the image coordinate points are obtained based on the coordinates of the synchronous belt type selection diagram and the image coordinate conversion;
[0048] Determine a first distance between the image coordinate point and each of the target contours;
[0049] A target contour corresponding to the component is determined from the target contour according to each of the first distances to obtain a model of the component.
[0050] The above-mentioned component selection method, device, computer equipment and storage medium obtain a synchronous belt type selection diagram for selection; identify the synchronous belt type selection diagram, and extract the target contour representing the component model in the synchronous belt type selection diagram; determine the target contour corresponding to the component from the target contour according to each first distance by the image coordinate point representing the selection parameter of the component, and obtain the model of the component; that is, obtain the target contour by performing image recognition and contour extraction on the synchronous belt type selection diagram; obtain the corresponding image coordinate point by coordinate conversion, and determine the type of component by identifying according to the distance between the image coordinate point and each target contour, thereby reducing the risk of errors caused by manual intervention in the selection process and improving the efficiency of component selection. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 An application environment diagram of a component selection method in an embodiment;
[0052] Figure 2 A schematic diagram of a process flow of a component selection method in an embodiment;
[0053] Figure 3 A schematic diagram of a synchronous belt type selection diagram in an embodiment;
[0054] Figure 4 A schematic diagram of a target profile of a synchronous belt type selection diagram in one embodiment;
[0055] Figure 5 A schematic diagram of determining pixel coordinates of an image in one embodiment;
[0056] Figure 6 A schematic flow chart of a method for preprocessing a synchronous belt type selection diagram in one embodiment;
[0057] Figure 7It is a schematic diagram of a binary image of an original image of synchronous belt type selection in an example;
[0058] Figure 8a A schematic diagram of a dilated image in one example is shown. Figure 8b Shown is a schematic diagram of a corrosion image in one example;
[0059] Fig. 9 is a flow chart of a component selection method in another embodiment;
[0060] Fig.10 A schematic diagram showing an application interface of a component selection method in an embodiment;
[0061] Fig.11 is a structural block diagram of a component selection device in an embodiment;
[0062] Fig.12 is a structural block diagram of a component selection device in another embodiment;
[0063] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0065] The component selection method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 obtains the synchronous belt type selection diagram for selection from the server; extracts the target contour representing the component model in the synchronous belt type selection diagram; obtains the image coordinate point corresponding to the component selection parameter; the image coordinate point is obtained based on the coordinate and image coordinate conversion of the synchronous belt type selection diagram; determines the first distance between the image coordinate point and each target contour; determines the target contour corresponding to the component from the target contour according to each first distance, and obtains the model of the component. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers.
[0066] In one embodiment, Figure 2 As shown in the figure, a method for selecting components is provided. Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0067] Step 202, obtaining a synchronous belt type selection diagram for selection.
[0068] The synchronous belt type selection chart is a nonlinear curve chart used to select components. The horizontal axis of the synchronous belt type selection chart can be used to represent the design power of the component (unit: kilowatt KW), and the vertical axis can be used to represent the small wheel speed (unit: r / min). The same type of component has corresponding different small wheel speeds and different design powers. Figure 3 As shown, different color areas represent different component models, including 3M, 5M, 8M, 8K or 14K, 14M, 20M, 14 or 20K; 3M model components exist at 3500r / min, 1750r / min, 1160r / min and 870r / min.
[0069] Specifically, the terminal obtains the synchronous belt type selection RGB image for selection from the selection server, performs grayscale processing on the synchronous belt type selection RGB image, and obtains a grayscale image. For example, the terminal performs grayscale processing on the synchronous belt type selection RGB by calling the grayscale processing method imgGray=cv2.cvtColor(imgRGB,cv2.COLOR_BGR2GRAY) in the pyOpenCV function. Among them, R, G, and B represent the pixel values of the red, green, and blue channels respectively. The methods for converting RGB images into grayscale images include floating-point algorithm (for example, grayscale Gray = R*0.3+G*0.59+B*0.11), integer method (for example, grayscale Gray = (R*30+G*59+B*11) / 100), shift method (for example, grayscale Gray = (R*76+G*151+B*28)>>8, shifting the color by 8 pixel values), average method (for example, grayscale Gray = (R+G+B) / 3) and taking only green (for example, grayscale Gray = G) method, etc.
[0070] Step 204: extracting a target profile representing a component model in the synchronous belt type selection diagram.
[0071] The target contour refers to the area where the component model is in the synchronous belt type selection diagram, that is, the inner contour.
[0072] Specifically, the terminal searches for each target contour in turn by calling the contour search function findContours in the pyOpenCV function library, for example, contours, hierarchy = cv2.findContours(imgErode, cv2.RETR_LIST, cv2.CHAIN_APPROX_NONE); the moment of each target contour is obtained by the contour moment acquisition function moments (M = cv2.moments(contour)), and the contour area of each target contour is calculated according to the moment of each target contour, that is, the moment area calculation function contourArea (area = cv2.contourArea(contour)) is called. There is a corresponding relationship between the contour area and the model of the component. Optionally, the obtained target contour is drawn by the drawing function and displayed on the display interface of the terminal. Figure 4 As shown in FIG. 1 , in one embodiment, each target contour is searched in turn to obtain a schematic diagram of the target contour, and the corresponding relationship between the contour area and the model of the component is obtained as follows:
[0073] 3M inner contour (Contour3M) area: 36808.5;
[0074] 5M inner contour area (Contour5M): 11413.0;
[0075] Contour area in the intersection of 5M and 8M (Contour5 / 8M): 17319.0;
[0076] Contour area in the 8M intersection region (Contour8M): 26040.0;
[0077] Contour area in the intersection of 8M and 14M (Contour8 / 14M): 22916.5;
[0078] 14M inner contour area (Contour14M): 25008.0;
[0079] Contour area in the intersection of 14M and 20M (Contour14 / 20M): 12172.5;
[0080] 20M inner contour area (Contour20M): 25919.5;
[0081] The outer contour of the entire area formed by the contours of each target wheel (ContourOut): 179463.5.
[0082] Step 206, obtaining image coordinate points corresponding to component selection parameters.
[0083] Among them, the selection parameters include the power and speed of the components.
[0084] The image coordinate points are obtained based on the coordinates of the synchronous belt type selection diagram and the image coordinate conversion. That is, the coordinates corresponding to the component selection parameters in the synchronous belt type selection diagram are logarithmic coordinate points, which are unevenly distributed. The logarithmic coordinate points in the synchronous belt type selection diagram are logarithmic coordinate converted to obtain the converted coordinate points; according to the corresponding relationship between the converted coordinate points and the corresponding image pixel coordinate points, the affine matrix of the coordinate conversion is determined; the logarithmic coordinate points in the synchronous belt type selection diagram are calculated by the affine matrix to obtain uniformly distributed image coordinate points. For example, the horizontal coordinate (power) and vertical coordinate (speed) in the synchronous belt type selection diagram are logarithmic coordinate points. The horizontal coordinate and vertical coordinate are transformed into logarithmic coordinates, that is, the horizontal coordinate: XTrans=log10(X)+1; the vertical coordinate: YTrans=log10(Y)–1; get the transformation coordinate TransCoor; select three points (0.1, 10), (100, 10), (0.1, 10000) from the "power-speed" coordinate axis of the synchronous belt type selection diagram, according to the horizontal coordinate: XTrans=log10( X)+1; the vertical coordinate: YTrans=log10(Y)–1, the corresponding transformation coordinates TransCoor are (0,0), (3,0), (0,3), the three points can be selected arbitrarily, or they can be determined by the maximum area of the area determined by the three points; by calling the image pixel coordinate function, that is, by hovering the mouse over (0,0), (3,0), (0,3), the corresponding image pixel coordinates are (66,391), (522,391) and (66,34), as shown in Figure 5 As shown; according to the corresponding relationship of the coordinates, the affine matrix transM is determined, that is, transM can be expressed as:
[0085] pts1=np.float32([[0,0],[3,0],[0,3]])
[0086] pts2=np.float32([[66,391],[522,391],[66,34]])
[0087] transM=cv2.getAffineTransform(pts1,pts2)
[0088] Specifically, the input component selection parameters (power and speed) are obtained, and the transformed coordinate points are obtained by performing logarithmic coordinate transformation on the logarithmic coordinate points representing the selection parameters; the transformed coordinate points are affine transformed by an affine matrix to obtain the image coordinate points corresponding to the component selection parameters.
[0089] Step 208: Determine a first distance between the image coordinate point and each target contour.
[0090] Specifically, the terminal calculates the first distance between the image coordinate point and each target contour (countour) by calling the calculation function cv2.pointPolygonTest in the OpenCV function. For example, the coordinates of the image coordinate point are (XImg, YImg), and the coordinate values are assigned to the calculation function, that is,
[0091] for contour in contours:
[0092] Distance=cv2.pointPolygonTest(countour,(XImg,YImg),True)
[0093] The first distance between each target contour and the image pixel point is obtained according to the return value of the function.
[0094] Step 210: determine the target contour corresponding to the component from the target contour according to each first distance, and obtain the model of the component.
[0095] Specifically, the positional relationship between the image coordinate point and each target contour is determined according to each first distance, and the target contour corresponding to the component is determined from the target contour according to the positional relationship to obtain the model of the component; the positional relationship includes inside the contour, outside the contour and on the contour, etc., inside the contour indicates that the input selection parameters meet the selection conditions of the synchronous belt type selection diagram, outside the contour and on the contour indicate that the input selection parameters do not meet the selection conditions of the synchronous belt type selection diagram; when the image coordinate point is inside the contour, the first distances corresponding to the image coordinate point in the contour are sorted in descending order, the first distance with the largest value is determined as the target first distance, and the component model corresponding to the target first distance is determined as the component model.
[0096] Among them, the position relationship judgment includes judging each returned first distance Distance and a first preset distance. The preset value can be but is not limited to 0. When the first distance is greater than the preset value, the image coordinate point is within the contour, that is, when Distance>0, it indicates that the point is in the contour; when the first distance is equal to the preset value, the image coordinate point is on the contour, that is, when Distance=0, it indicates that the point is on the contour; when the first distance is less than the preset value, the image coordinate point is outside the contour, that is, when Distance<0, it indicates that the point is outside the contour.
[0097] In the above-mentioned component selection method, a synchronous belt type selection diagram for selection is obtained; the synchronous belt type selection diagram is identified, and a target contour representing the component model in the synchronous belt type selection diagram is extracted; a first distance between an image coordinate point representing the selection parameters of the component and each target contour is determined; a target contour corresponding to the component is determined from the target contour according to each first distance, and the component model is obtained; that is, the target contour is obtained by performing image recognition and contour extraction on the synchronous belt type selection diagram; the corresponding image coordinate point is obtained by coordinate conversion, and the type of component is determined by identifying the distance between the image coordinate point and each target contour, thereby reducing the risk of errors caused by manual intervention in the selection process and improving the efficiency of component selection.
[0098] In one embodiment, Figure 6 As shown in FIG. 1 , a method for preprocessing a synchronous belt type selection diagram is provided, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0099] Step 602, obtaining a synchronous belt type selection original drawing for type selection; different colors of the synchronous belt type selection original drawing represent different types of components.
[0100] The original image for selecting the synchronous belt type may be an RGB image, and the same color in the original image for selecting the synchronous belt type may represent different component types.
[0101] Step 604, grayscale processing and binarization processing are performed on the original image of the synchronous belt type selection in sequence to obtain a binarized image.
[0102] The binarization process refers to processing the grayscale image according to a preset threshold value, filtering out non-target contours (for example, grid lines and characters in the synchronous belt type selection diagram), and obtaining a clear target contour. The preset threshold value may be, but is not limited to, 140.
[0103] Specifically, the terminal performs grayscale processing on the synchronous belt type selection RGB by calling the grayscale processing method imgGray=cv2.cvtColor(imgRGB,cv2.COLOR_BGR2GRAY) in the pyOpenCV function to obtain a grayscale image; and calls the debinarization function threshold() in the pyOpenCV function to perform debinarization processing on the grayscale image to obtain a binary image, for example, Figure 7 As shown, it is a binary image of the original image of synchronous belt type selection in an example.
[0104] Step 606: When it is detected that the contour lines in the binary image are discontinuous, the binary image is sequentially subjected to dilation and erosion operations to obtain a synchronous belt type selection diagram for type selection.
[0105] The dilation operation refers to dilating the image by setting the kernel size to make the target contour in the image continuous and ensure the separation between the non-target contour and the target contour, thereby obtaining a dilated image. The set kernel size (kernel) can be, but is not limited to, 3*3, and the dilation function is the dilate() function of the pyOpenCV function.
[0106] The erosion operation refers to restoring the contour information in the dilated image by setting the kernel size to obtain an image with clear and continuous contours (ImgErode). In this embodiment, the kernel size of the erosion operation is the same as the kernel size of the dilation operation, and the erosion function is the erode() function of the pyOpenCV function.
[0107] Specifically, when the contour lines in the binary image are detected to be discontinuous, based on the set kernel size of 3*3, the dilate() function of the pyOpenCV function is called to dilate the binary image to obtain a dilated image, and the erode() function of the pyOpenCV function is called to erode the dilated image to obtain an image with clear contours and continuity. Figure 8a The following is a dilated image of an example. Figure 8b Shown is an erosion image from one example.
[0108] In the above-mentioned preprocessing method for the synchronous belt type selection diagram, the obtained synchronous belt type selection original image is subjected to grayscale processing and binarization processing in sequence to reduce the interference of color on the identification of component types; when discontinuity of contour lines in the binary image is detected, the binary image is subjected to dilation and corrosion operations in sequence to ensure that the target contour of the synchronous belt type selection diagram is clear and the integrity of the contour information is ensured, thereby improving the accuracy of the terminal's recognition of the synchronous belt type selection image, thereby shortening the component selection cycle.
[0109] In another embodiment, Fig. 9 As shown in the figure, a method for selecting components is provided. Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0110] Step 902, obtaining the original drawing of the synchronous belt type selection for selection.
[0111] Among them, the color of the original drawing of the synchronous belt type selection indicates the model of the component, and the same color can correspond to components of different models.
[0112] Step 904, grayscale processing and binarization processing are performed on the original synchronous belt type selection image in sequence to obtain a synchronous belt type selection image for selection.
[0113] Step 906, grayscale processing and binarization processing are performed on the original image of the synchronous belt type selection in sequence to obtain a binarized image.
[0114] Step 908: When it is detected that the contour lines in the binary image are discontinuous, the binary image is sequentially subjected to dilation and erosion operations to obtain a synchronous belt type selection diagram for type selection.
[0115] Step 910: extracting a target profile representing a component model in a synchronous belt type selection diagram.
[0116] Specifically, all contours in the synchronous belt type selection diagram are extracted; the contour area of each contour is determined according to the moment of each contour; the contours with a contour area smaller than a preset area are deleted to obtain the target contour representing the component model, that is, all contours in the synchronous belt type selection diagram are searched in turn by calling the contour search function findContours in the pyOpenCV function library, the moment of each contour is obtained by the contour moment acquisition function, the contour area of each contour is calculated according to the moment of each contour, and the contours with a contour area smaller than a preset area are deleted to obtain the target contour representing the component model. The preset area can be but is not limited to 9000; by deleting the contours with a contour area smaller than the preset area, white noise and text information in the image can be removed, thereby improving the image recognition accuracy.
[0117] Step 912, obtaining image coordinate points corresponding to component selection parameters.
[0118] Specifically, the logarithmic coordinate points of the component selection parameters in the coordinates of the synchronous belt selection diagram are obtained; the logarithmic coordinate points are sequentially transformed by logarithmic coordinate conversion and affine matrix conversion to obtain image coordinate points in image coordinates. For example, the logarithmic coordinate points corresponding to the obtained selection parameters power and speed are (XIn, YIn), and the logarithmic coordinate points are transformed by logarithmic coordinate conversion to obtain the conversion coordinates (xLg, yLg), and (xLg, yLg) are transformed by the affine matrix transM to obtain the image coordinate points (XImg, YImg).
[0119] Among them, the logarithmic coordinate transformation can be expressed by the following formula:
[0120] xLg=np.log10(xIn)+1
[0121] yLg=np.log10(yIn)-1
[0122] The method to calculate the image coordinate points through the affine matrix is as follows:
[0123] pts=np.float32([xLg,yLg]).reshape([-1,2])
[0124] pts=np.hstack([pts,np.ones([len(pts),1])]).T
[0125] target_point=np.dot(transM,pts)
[0126] XImg=target_point[0][0]
[0127] YImg=target_point[1][0]
[0128] Step 914, determining the outer contour formed by the target contours, and calculating the second distance between the image coordinate point and the outer contour.
[0129] Step 916: when the second distance is greater than the second preset distance, determine the first distance between the image coordinate point and each target contour.
[0130] Among them, the second preset distance can be but is not limited to 0. The positional relationship between the image coordinate point and the outer contour is determined according to each second distance. When the second distance is greater than the second preset distance, it means that the input selection parameters meet the selection conditions of the synchronous belt type selection diagram, and the first distance between the image coordinate point and each target contour is determined.
[0131] Step 918: determine the target contour corresponding to the component from the target contour according to each first distance, and obtain the model of the component.
[0132] Specifically, the positional relationship between the image coordinate point and each target contour is determined according to each first distance; when the positional relationship is a preset positional relationship, the target first distance with the largest value is determined from the first distances that satisfy the preset positional relationship, and the contour area of the target contour corresponding to the target first distance is obtained; and the model of the component is obtained according to the contour area.
[0133] Optionally, in one embodiment, by identifying the color range values of corresponding areas of different models in the synchronous belt type selection diagram (for example, the RGB values of a color image or the grayscale values of a grayscale image), a target contour representing the component model in the synchronous belt type selection diagram is extracted, and the image coordinate points corresponding to the component selection parameters are obtained. The positional relationship between the image coordinate points and each target contour is determined according to each first distance, and the target contour corresponding to the component is determined from the target contour according to the positional relationship. The color range value within the target contour is obtained, and the model of the component is determined according to the color range value, thereby achieving the effect of automatically identifying the selection image, determining the selection parameters, and improving the efficiency of component selection.
[0134] Optionally, in one embodiment, for an application scenario of component selection, a component selection method is applied, and the display interface includes upper-level output parameters, parameter input of the current-level unit, selection parameters and current-level transmission unit component options, large gear options and small gear options. According to the parameter input of the current-level transmission unit (for example, reference width, small pulley coefficient, reference power, driving wheel pitch diameter and driven wheel pitch diameter), calculation is performed to determine the selection parameters, and appropriate component models are displayed in the current-level transmission unit component options, large gear options and small gear options according to the selection parameters; the corresponding components can be viewed by clicking View Technical Manual and View Model, such as Fig.10 shown.
[0135] In the above-mentioned component selection method, the synchronous belt type selection diagram is obtained by grayscale processing, grayscale image binarization, expansion operation and corrosion operation on the synchronous belt type selection original image; by extracting the target contour in the synchronous belt type selection diagram and determining the affine matrix between the coordinate axis of the selection diagram and the image coordinates, the input selection parameters are converted into coordinates and the model of the component is automatically identified and determined, that is, the curve contour in the selection diagram is identified by image processing, the area contained in each curve is divided, and the logarithmic coordinates of the query parameters are mapped to the image coordinates through the affine transformation of the coordinates, and then the corresponding selection area is automatically determined through the input selection parameters, so as to achieve the effect of automatically identifying the selection image, determining the selection parameters and improving the efficiency of component selection.
[0136] It should be understood that although Figure 2 , Figure 5 and Fig. 9 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 , Figure 5 and Fig. 9 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0137] In one embodiment, Fig.10 As shown, a device for selecting components is provided, including: a first acquisition module 1002, an extraction module 1004, a second acquisition module 1006, a calculation module 1008 and a selection module 1010, wherein:
[0138] The first acquisition module 1002 is used to acquire a synchronous belt type selection diagram for selection.
[0139] The extraction module 1004 is used to extract the target profile representing the component model in the synchronous belt type selection diagram.
[0140] The second acquisition module 1006 acquires the image coordinate points corresponding to the component selection parameters; the image coordinate points are obtained by converting the coordinates of the synchronous belt selection diagram and the image coordinates.
[0141] The calculation module 1008 is used to determine the first distance between the image coordinate point and each target contour.
[0142] The selection module 1010 is used to determine the target contour corresponding to the component from the target contour according to each first distance, and obtain the model of the component.
[0143] In the above-mentioned component selection device, a synchronous belt type selection diagram for selection is obtained; the synchronous belt type selection diagram is identified, and a target contour representing the component model in the synchronous belt type selection diagram is extracted; a first distance between an image coordinate point representing the selection parameter of the component and each target contour is determined; a target contour corresponding to the component is determined from the target contour according to each first distance, and the component model is obtained; that is, the target contour is obtained by performing image recognition and contour extraction on the synchronous belt type selection diagram; the corresponding image coordinate point is obtained by coordinate conversion, and the type of component is determined by identifying according to the distance between the image coordinate point and each target contour, thereby reducing the risk of errors caused by manual intervention in the selection process and improving the efficiency of component selection.
[0144] In another embodiment, Fig.11 As shown, a component selection device is provided, which includes, in addition to a first acquisition module 1002, an extraction module 1004, a second acquisition module 1006, a calculation module 1008 and a selection module 1010, a coordinate conversion module 1012, a judgment module 1014, an image processing module 1016 and a deletion module 1018, wherein:
[0145] The second acquisition module 1006 is also used to obtain the logarithmic coordinate points of the component selection parameters in the coordinates of the synchronous belt selection diagram;
[0146] The coordinate transformation module 1012 is used to perform logarithmic coordinate transformation and affine matrix transformation on the logarithmic coordinate points in sequence to obtain image coordinate points in image coordinates.
[0147] The calculation module 1008 is also used to determine the outer contour formed by each target contour; calculate the second distance between the image coordinate point and the outer contour; when the second distance is greater than the second preset distance, execute the step of determining the first distance between the image coordinate point and each target contour.
[0148] The judgment module 1014 is used to determine the positional relationship between the image coordinate point and each target contour according to each first distance; when the positional relationship is a preset positional relationship, determine the target first distance with the largest value from the first distances that satisfy the preset positional relationship, and obtain the contour area of the target contour corresponding to the target first distance.
[0149] The selection module 1010 is also used to obtain the model of the component according to the outline area.
[0150] The first acquisition module 1002 is also used to acquire the original image of the synchronous belt type selection for selection.
[0151] The image processing module 1016 is used to perform grayscale processing and binarization processing on the original image of the synchronous belt type selection in sequence to obtain a synchronous belt type selection image for selection.
[0152] The image processing module 1016 is also used to perform grayscale processing and binarization processing on the original image of the synchronous belt type selection in sequence to obtain a binary image; when it is detected that the contour lines in the binary image are discontinuous, the binary image is sequentially expanded and eroded to obtain a synchronous belt type selection diagram for selection.
[0153] The extraction module 1004 is also used to extract all contours in the synchronous belt type selection diagram.
[0154] The calculation module 1008 is further configured to determine the contour area of each contour according to the moment of each contour.
[0155] The deletion module 1018 is used to delete the contours whose contour area is smaller than the preset area to obtain the target contour representing the component model.
[0156] In one embodiment, a synchronous belt type selection map is obtained by grayscale processing, grayscale image binarization, dilation operation, and erosion operation on the original synchronous belt type selection map; by extracting the target contour in the synchronous belt type selection map and determining the affine matrix between the coordinate axes of the selection map and the image coordinates, the input selection parameters are converted into coordinates and the models of components are automatically identified and determined, that is, the curve contours in the selection map are identified by image processing, the area contained in each curve is divided, and the logarithmic coordinates of the query parameters are mapped to the image coordinates through the affine transformation of the coordinates, and then the corresponding selection area is automatically determined through the input selection parameters, so as to achieve the effects of automatically identifying the selection image, determining the selection parameters, and improving the efficiency of component selection.
[0157] For the specific definition of the component selection device, please refer to the definition of the component selection method above, which will not be repeated here. Each module in the above-mentioned component selection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0158] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.13 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a component selection method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0159] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0160] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0161] Get the synchronous belt type selection diagram for selection;
[0162] Extract the target profile representing the component model in the synchronous belt type selection diagram;
[0163] Obtain the image coordinate points corresponding to the component selection parameters; the image coordinate points are obtained based on the coordinates of the synchronous belt selection diagram and the image coordinate conversion;
[0164] Determine a first distance between the image coordinate point and each target contour;
[0165] The target contour corresponding to the component is determined from the target contour according to each first distance to obtain the model of the component.
[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0167] Get the logarithmic coordinate points of the component selection parameters in the coordinates of the synchronous belt selection diagram;
[0168] The logarithmic coordinate points are sequentially subjected to logarithmic coordinate transformation and affine matrix transformation to obtain image coordinate points in image coordinates.
[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0170] Determine the outer contour formed by each target contour;
[0171] Calculate the second distance between the image coordinate point and the outer contour;
[0172] When the second distance is greater than the second preset distance, the step of determining the first distance between the image coordinate point and each target contour is performed.
[0173] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0174] Determine the positional relationship between the image coordinate point and each target contour according to each first distance;
[0175] When the positional relationship is a preset positional relationship, determining a target first distance with the largest value from the first distances satisfying the preset positional relationship, and obtaining a contour area of the target contour corresponding to the target first distance;
[0176] Get the component model based on the outline area.
[0177] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0178] Obtain the original drawing of synchronous belt type selection for selection;
[0179] The original synchronous belt type selection image is subjected to grayscale processing and binarization processing in sequence to obtain a synchronous belt type selection image for selection.
[0180] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0181] The original image of the synchronous belt type selection is subjected to grayscale processing and binarization processing in sequence to obtain a binarized image;
[0182] When it is detected that the contour lines in the binary image are discontinuous, the binary image is sequentially subjected to dilation and erosion operations to obtain a synchronous belt type selection diagram for type selection.
[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0184] Extract all contours in the synchronous belt type selection diagram;
[0185] Determine the contour area of each contour according to the moment of each contour;
[0186] Delete the contours whose contour area is smaller than the preset area to obtain the target contour that represents the component model.
[0187] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0188] Get the synchronous belt type selection diagram for selection;
[0189] Extract the target profile representing the component model in the synchronous belt type selection diagram;
[0190] Obtain the image coordinate points corresponding to the component selection parameters; the image coordinate points are obtained based on the coordinates of the synchronous belt selection diagram and the image coordinate conversion;
[0191] Determine a first distance between the image coordinate point and each target contour;
[0192] The target contour corresponding to the component is determined from the target contour according to each first distance to obtain the model of the component.
[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0194] Get the logarithmic coordinate points of the component selection parameters in the coordinates of the synchronous belt selection diagram;
[0195] The logarithmic coordinate points are sequentially subjected to logarithmic coordinate transformation and affine matrix transformation to obtain image coordinate points in image coordinates.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] Determine the outer contour formed by each target contour;
[0198] Calculate the second distance between the image coordinate point and the outer contour;
[0199] When the second distance is greater than the second preset distance, the step of determining the first distance between the image coordinate point and each target contour is performed.
[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0201] Determine the positional relationship between the image coordinate point and each target contour according to each first distance;
[0202] When the positional relationship is a preset positional relationship, determining a target first distance with the largest value from the first distances satisfying the preset positional relationship, and obtaining a contour area of the target contour corresponding to the target first distance;
[0203] Get the component model based on the outline area.
[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0205] Obtain the original drawing of synchronous belt type selection for selection;
[0206] The original synchronous belt type selection image is processed in grayscale and binarized in sequence to obtain a synchronous belt type selection image for selection.
[0207] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0208] The original image of the synchronous belt type selection is subjected to grayscale processing and binarization processing in sequence to obtain a binarized image;
[0209] When it is detected that the contour lines in the binary image are discontinuous, the binary image is sequentially subjected to dilation and erosion operations to obtain a synchronous belt type selection diagram for type selection.
[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0211] Extract all contours in the synchronous belt type selection diagram;
[0212] Determine the contour area of each contour according to the moment of each contour;
[0213] Delete the contours whose contour area is smaller than the preset area to obtain the target contour that represents the component model.
[0214] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0215] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0216] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A component selection method, characterized in that: The method comprises: Get the synchronous belt type selection diagram for selection; Extracting the inner contour representing the component model in the synchronous belt type selection diagram; Obtaining the logarithmic coordinate points of the component selection parameters in the coordinates of the synchronous belt type selection diagram; the component selection parameters include the power and rotation speed of the components; Performing logarithmic coordinate transformation and affine matrix transformation on the logarithmic coordinate point in sequence to obtain an image coordinate point in image coordinates; Determine a first distance between the image coordinate point and each of the inner contours; Determine the positional relationship between the image coordinate point and each of the inner contours according to each of the first distances; The inner contour corresponding to the component is determined from the inner contour according to the positional relationship to obtain the model of the component.
2. The method according to claim 1, characterized in that Before determining the first distance between the image coordinate point and each of the inner contours, the method further includes: Determine an outer contour formed by the inner contours; Calculating a second distance between the image coordinate point and the outer contour; When the second distance is greater than a second preset distance, the step of determining the first distance between the image coordinate point and each of the inner contours is performed.
3. The method according to claim 1, characterized in that Determining the inner contour corresponding to the component from the inner contour according to the positional relationship to obtain the model of the component includes: When the positional relationship is a preset positional relationship, determining a target first distance with the largest value from the first distances satisfying the preset positional relationship, and acquiring a contour area of an inner contour corresponding to the target first distance; The model of the component is obtained according to the contour area.
4. The method according to claim 1, characterized in that: The step of obtaining a synchronous belt type selection diagram for selection includes: Obtain the original drawing of synchronous belt type selection for selection; The synchronous belt type selection original image is subjected to grayscale processing and binarization processing in sequence to obtain a synchronous belt type selection image for selection.
5. The method according to claim 4, characterized in that The method further comprises: The original image of the synchronous belt type selection is subjected to grayscale processing and binarization processing in sequence to obtain a binarized image; When it is detected that the contour lines in the binary image are discontinuous, the binary image is sequentially subjected to dilation and erosion operations to obtain a synchronous belt type selection diagram for type selection.
6. The method according to claim 1, characterized in that The step of extracting the inner contour representing the component model in the synchronous belt type selection diagram includes: Extract all contours in the synchronous belt type selection diagram; Determining the contour area of each of the contours according to the moment of each of the contours; Delete the contours whose contour area is smaller than the preset area to obtain the inner contour representing the component model.
7. The method according to claim 1, characterized in that The step of extracting the inner contour representing the component model in the synchronous belt type selection diagram includes: By identifying the color range values of the corresponding areas of different models in the synchronous belt type selection diagram, the inner contour representing the component model in the synchronous belt type selection diagram is extracted.
8. A component selection device, characterized in that: The device comprises: A first acquisition module is used to acquire a synchronous belt type selection diagram for selection; An extraction module, used for extracting the inner contour representing the component model in the synchronous belt type selection diagram; A second acquisition module is used to obtain the logarithmic coordinate points of the component selection parameters in the coordinates of the synchronous belt type selection diagram; the component selection parameters include the power and rotation speed of the components; A coordinate transformation module, used for sequentially performing logarithmic coordinate transformation and affine matrix transformation on the logarithmic coordinate point to obtain an image coordinate point in image coordinates; A calculation module, used for determining a first distance between the image coordinate point and each of the inner contours; A selection module is used to determine the positional relationship between the image coordinate point and each of the inner contours according to each of the first distances; determine the inner contour corresponding to the component from the inner contour according to the positional relationship, and obtain the model of the component.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Measurement method and device for extension length of sunken area in edge of circular work piece towards circle center
CN108844471A
BOM type selection method and device, electronic device and storage medium
CN110502533A