Identification method and device, electronic equipment, storage medium and computer program product

By obtaining the color information and images of the coaxial line, adjusting the color contrast to generate suitable images, filtering the target pixel points to determine the end length, solving the problem of large errors in traditional manual recognition of coaxial line, and achieving efficient automatic recognition and installation.

CN120356193APending Publication Date: 2025-07-22BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410090722.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-22
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The traditional coaxial line recognition method relies on manual identification of long and short ends, which has problems such as large error and low efficiency. Especially in automatic installation based on machine vision, it is difficult to accurately distinguish the color and end length of the coaxial line.

Method used

By obtaining the color information of the object to be identified and taking images, adjusting the image using color contrast, generating saturation or chrominance images, filtering target pixel points, determining the end length, and automatically identifying the length of the coaxial line.

Benefits of technology

It reduces manual identification errors, improves the accuracy and efficiency of coaxial end recognition, and supports automated installation processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120356193A_ABST
    Figure CN120356193A_ABST
Patent Text Reader

Abstract

The invention relates to an identification method and device, electronic equipment, a storage medium and a computer program product. The identification method comprises the following steps: acquiring color information of a to-be-identified object; acquiring a shot image for shooting the to-be-recognized object; and based on the color information of the to-be-identified object and the shot image, identifying the end part of the to-be-identified object. According to the embodiment of the invention, the end part of the to-be-recognized object can be intelligently recognized, and the recognition efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image recognition technology, and in particular, to a recognition method and device, an electronic device, a storage medium, and a computer program product. Background Art

[0002] Intelligent manufacturing is a human-machine integrated intelligent system composed of intelligent machines and human experts, which conducts intelligent activities during the manufacturing process. Intelligent robots are multi-joint manipulators and multi-degree-of-freedom machine devices widely used in the industrial field, with a certain degree of automation and are widely applied in various industrial fields. For the recognition of traditional coaxial cables, manual identification of the long end and short end of the coaxial cable is used for subsequent installation, which has problems such as being prone to errors and low efficiency. However, there are difficulties in automatically installing coaxial cables based on intelligent robots in terms of distinguishing the color of the coaxial cable and the length of the ends based on machine vision. Summary of the Invention

[0003] To overcome the problems in the related art, the present disclosure provides a recognition method and device, an electronic device, a storage medium, and a computer program product, which can achieve intelligent recognition based on the object to be recognized and improve the recognition efficiency.

[0004] According to the first aspect of the embodiments of the present disclosure, a recognition method is provided, which at least includes:

[0005] Obtain the color information of the object to be recognized;

[0006] Obtain a captured image of the object to be recognized;

[0007] Based on the color information of the object to be recognized and the captured image, recognize the end of the object to be recognized.

[0008] In some embodiments, the recognizing the end of the object to be recognized based on the color information of the object to be recognized and the captured image includes:

[0009] Determine the color contrast based on the color information of the object to be recognized and the color information of the image background in the captured image;

[0010] Adjust the captured image based on the color contrast to obtain an adjusted image corresponding to the color contrast;

[0011] Based on the adjusted image, recognize the end of the object to be recognized.

[0012] In some embodiments, the adjusting the captured image based on the color contrast to obtain an adjusted image corresponding to the color contrast includes:

[0013] When the color contrast is greater than a preset threshold, adjust the saturation of the captured image to obtain a saturation image;

[0014] When the color contrast is less than or equal to the preset threshold, adjust the color lightness of the captured image to obtain a color lightness image.

[0015] In some embodiments, the identifying the end of the object to be identified based on the adjusted image includes:

[0016] Screen each pixel point in the adjusted image to obtain target pixel points;

[0017] Based on the coordinates of the target pixel points, determine the end length of the object to be identified;

[0018] Based on the end length of the object to be identified, identify the end of the object to be identified

[0019] In some embodiments, the screening each pixel point in the adjusted image to obtain target pixel points includes:

[0020] Obtain the average gray value of multiple pixel points in the image background of the adjusted image;

[0021] Compare the gray value of each pixel point in the adjusted image with the average gray value respectively, and use the multiple pixel points whose gray value is greater than the average gray value as the target pixel points.

[0022] In some embodiments, the object to be identified includes a coaxial cable; the determining the end length of the object to be identified based on the coordinates of the target pixel points includes:

[0023] When the adjusted image is a saturation image, divide the pixel area surrounded by the target pixel points based on the shape of the coaxial cable to obtain a first target area; based on the coordinates of the target pixel points at the edge position in the first target area, determine the length of the first target area in the extending direction of the first target area; use the length of the first target area in the extending direction of the first target area as the end length of the object to be identified;

[0024] and / or,

[0025] When the adjusted image is a chromatic lightness image, based on the terminal shape of the coaxial line and the shape of the grounding ring of the coaxial line, divide the pixel region surrounded by the target pixel points to obtain a second target region corresponding to the terminal shape and a third target region corresponding to the shape of the grounding ring; based on the second target region and the third target region, determine the end length of the object to be recognized.

[0026] In some embodiments, the determining the end length of the object to be recognized based on the second target region and the third target region includes:

[0027] In the image coordinate system of the chromatic lightness image, obtain a first angle between the extension line of the second target region and the horizontal axis in the image coordinate system and a second angle between the extension line of the third target region and the horizontal axis;

[0028] When the absolute value of the difference between the first angle and the second angle is less than or equal to a preset angle threshold, determine the end length of the object to be recognized based on the coordinates of the central pixel point of the second target region and the coordinates of the central pixel point of the third target region;

[0029] When the absolute value of the difference between the first angle and the second angle is greater than the preset angle threshold, obtain the intersection point of the extension line of the second target region and the extension line of the third target region, and determine the end length of the object to be recognized based on the coordinates of the pixel point corresponding to the intersection point.

[0030] In some embodiments, the determining the end length of the object to be recognized based on the coordinates of the pixel point corresponding to the intersection point includes:

[0031] Based on the coordinates of the pixel point corresponding to the intersection point and the coordinates of the central pixel point of the second target region, obtain a first distance from the intersection point to the central pixel point of the second target region;

[0032] Based on the coordinates of the pixel point corresponding to the intersection point and the coordinates of the central pixel point of the third target region, obtain a second distance from the intersection point to the central pixel point of the third target region;

[0033] Based on the first distance and the second distance, determine the end length of the object to be recognized.

[0034] In some embodiments, determining the end length of the object to be recognized based on the first distance and the second distance includes: subtracting half of the length of the second target area in the extension direction of the second target area and the length of the third target area in the extension direction of the third target area from the sum of the first distance and the second distance, and using the result as the end length of the object to be recognized.

[0035] In some embodiments, the object to be recognized is a coaxial cable; recognizing the end of the object to be recognized based on the end length of the object to be recognized includes:

[0036] When the end length of the coaxial cable is greater than a preset length threshold, recognizing the end of the coaxial cable as the long end of the coaxial cable;

[0037] When the end length of the coaxial cable is less than or equal to the preset length threshold, recognizing the end of the coaxial cable as the short end of the coaxial cable.

[0038] In some embodiments, the method further includes:

[0039] Based on the recognition result of recognizing the end of the object to be recognized, controlling the installation device of the object to be recognized to install the object to be recognized in an electronic device.

[0040] According to a second aspect of the embodiments of the present disclosure, there is provided an identification device, including at least:

[0041] An information acquisition module, configured to acquire color information of an object to be recognized;

[0042] An image acquisition module, configured to acquire a captured image of the object to be recognized;

[0043] An identification module, configured to recognize the end of the object to be recognized based on the color information of the object to be recognized and the captured image.

[0044] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including at least:

[0045] A processor;

[0046] A memory for storing instructions executable by the processor;

[0047] Wherein, the processor is configured to execute the recognition method described in the first aspect above.

[0048] According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium, including:

[0049] When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the recognition method described in the first aspect above.

[0050] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product including a computer program or instructions, which, when executed by a processor, implement the steps of the recognition method described in the first aspect above.

[0051] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0052] In the embodiments of the present disclosure, color information of an object to be recognized is obtained, a captured image of the object to be recognized is obtained, and based on the color information of the object to be recognized and the captured image of the object to be recognized, the end of the object to be recognized is recognized. In this way, in the embodiments of the present disclosure, through the color information of the object to be recognized and the captured image of the object to be recognized, the end of the object to be recognized can be automatically recognized without manual recognition of the end of the object to be recognized, reducing errors caused by manual recognition, and thus being able to achieve intelligent recognition based on the object to be recognized and improving the efficiency of recognizing the end of the object to be recognized.

[0053] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0055] Figure 1 is a flowchart showing a recognition method according to an exemplary embodiment.

[0056] Figure 2 is a schematic diagram showing an object to be recognized being photographed according to an exemplary embodiment.

[0057] Figure 3 is a schematic diagram of a coaxial cable according to an exemplary embodiment.

[0058] Figure 4 is a schematic diagram of a saturation image according to an exemplary embodiment.

[0059] Figure 5 is a schematic diagram of a saturation image showing a first target area according to an exemplary embodiment.

[0060] Figure 6 is a schematic diagram of a color lightness image according to an exemplary embodiment.

[0061] Figure 7 It is a schematic diagram of a chromatic lightness image showing a second target area and a third target area according to an exemplary embodiment.

[0062] Figure 8 It is a structural block diagram of an identification device according to an exemplary embodiment.

[0063] Figure 9 It is a structural block diagram of an electronic device according to an exemplary embodiment. Detailed implementation manners

[0064] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all the implementation manners consistent with the present disclosure. On the contrary, they are merely examples of an identification method and device, an electronic device, a storage medium, and a computer program product consistent with some aspects of the present disclosure as detailed in the appended claims.

[0065] An embodiment of the present disclosure proposes an identification method. Figure 1 It is a schematic flowchart of an identification method according to an exemplary embodiment, as Figure 1 shown, the identification method includes the following steps:

[0066] S101. Obtain the color information of the object to be identified;

[0067] S102. Obtain a captured image of the object to be identified;

[0068] S103. Identify the end of the object to be identified based on the color information of the object to be identified and the captured image.

[0069] In an embodiment of the present disclosure, the identification method can be applied to fields such as an automated production line, an intelligent robot, and security monitoring. Exemplarily, when the identification method is applied to an automated production line, the identification device can identify the end of the object to be identified to perform automated installation of the object to be identified; when the identification method is applied to an intelligent robot, the intelligent robot can identify the end of the object to be identified to carry the object to be identified; when the identification method is applied to security monitoring, the monitoring device can identify the end of the object to be identified to screen the object to be identified.

[0070] Exemplarily, when the recognition method is applied to an automated production line, the recognition device can obtain the color information of the object to be recognized and the captured image of the object to be recognized. Based on the color information of the object to be recognized, image processing is performed on the captured image, and then the end of the object to be recognized is recognized to install the corresponding end of the object to be recognized.

[0071] In step S101, the color information of the object to be recognized can be obtained indirectly or directly. The embodiments of the present disclosure do not limit this.

[0072] Exemplarily, in one embodiment, the color information of the object to be recognized can be obtained by recognizing a color image of the object to be recognized; in another embodiment, the color information of the object to be recognized corresponding to the serial number can be obtained by scanning the serial number of the object to be recognized. Here, the serial number and color information of the object to be recognized can be bound in advance, and when the serial number of the object to be recognized is obtained, the corresponding color information can be obtained through the binding relationship.

[0073] Among them, the color information of the object to be recognized includes colors such as black, white, or blue. The embodiments of the present disclosure do not limit this.

[0074] In step S102, to capture an image of the object to be recognized, a color camera can be used in cooperation with an external light source to capture the object to be recognized. Exemplarily, a color camera can be used, and the open-hole surface light can be used as the external light source for cooperation in shooting. In this way, the color camera can obtain a color captured image, and the open-hole surface light source can provide a more uniform shooting light source, making the imaging of the object to be recognized clearer.

[0075] Among them, when using a color camera to take pictures, Figure 2 is a schematic diagram of shooting an object to be recognized shown according to an exemplary embodiment. As Figure 2 shown, the color camera 30 captures the object to be recognized 10 through the open-hole surface light plate 20. Here, the distance between the object to be recognized and the color camera can be set according to actual situations such as the volume of the object to be recognized and the camera focal length. The embodiments of the present disclosure do not limit this. Exemplarily, the distance between the object to be recognized and the color camera is within the range of 150 mm to 250 mm.

[0076] It should be noted that the captured image of the object to be recognized is in the RGB color mode. The RGB color mode is a color standard in the manufacturing industry. RGB represents the colors corresponding to the red, green, and blue channels. Different colors can be obtained by changing the three color channels of red (R), green (G), and blue (B) and their superposition with each other. Exemplarily, the superposition of red and green can produce yellow, the superposition of red and blue can produce purple, and the superposition of green and blue can produce cyan.

[0077] In step S103, based on the color information of the object to be recognized and the captured image, the recognition of the end of the object to be recognized can be direct recognition or indirect recognition.

[0078] Exemplarily, in one embodiment, it can be to recognize the end of the object to be recognized in the captured image; in another embodiment, based on the color information of the object to be recognized and the captured image, the captured image is adjusted in different ways to obtain an adjusted image, and the end of the object to be recognized is recognized based on the adjusted image.

[0079] Exemplarily, in one embodiment, it can be to adjust the saturation of the captured image to obtain a saturation image; in another embodiment, it can be to adjust the chroma lightness of the captured image to obtain a chroma lightness image.

[0080] In the embodiments of the present disclosure, the recognition of the end of the object to be recognized includes: recognizing one or more ends of the object to be recognized. Exemplarily, in one embodiment, when recognizing one end of the object to be recognized, only the color information of the object to be recognized and the captured image obtained by photographing one end of the object to be recognized can be acquired; in another embodiment, when recognizing multiple ends of the object to be recognized, the color information of the object to be recognized and the captured image obtained by photographing the object to be recognized including each end can be acquired.

[0081] Among them, the recognition of the end of the object to be recognized can be to recognize the characteristics of the end of the object to be recognized. Exemplarily, in one embodiment, it can be to recognize the shape of the object to be recognized based on the color information of the object to be recognized and the captured image. Here, the end of the object to be recognized can be a rectangle, a circle, a triangle, etc.; in another embodiment, it can also be to recognize the length of the end of the object to be recognized based on the color information of the object to be recognized and the captured image. The embodiments of the present disclosure do not limit this.

[0082] It should be noted that after recognizing the end of the object to be recognized, the recognition result can be output. The recognition result includes information such as the type, end shape, end position, or length of the end of the object to be recognized. The embodiments of the present disclosure do not limit this.

[0083] In the embodiments of the present disclosure, color information of an object to be recognized is obtained, a captured image of the object to be recognized is obtained, and based on the color information of the object to be recognized and the captured image of the object to be recognized, the end part of the object to be recognized is recognized. In this way, in the embodiments of the present disclosure, through the color information of the object to be recognized and the captured image of the object to be recognized, the end part of the object to be recognized can be automatically recognized without manually recognizing the end part of the object to be recognized, reducing the error caused by manual recognition, and thus being able to achieve intelligent recognition based on the object to be recognized and improving the efficiency of recognizing the object to be recognized.

[0084] In one embodiment, the recognizing the end part of the object to be recognized based on the color information of the object to be recognized and the captured image includes:

[0085] Determining a color contrast based on the color information of the object to be recognized and the color information of the image background in the captured image;

[0086] Adjusting the captured image based on the color contrast to obtain an adjusted image corresponding to the color contrast;

[0087] Recognizing the end part of the object to be recognized based on the adjusted image.

[0088] In the embodiments of the present disclosure, obtaining the color information of the image background in the captured image includes: extracting the color information of the image background from the captured image, and determining the color contrast by comparing the color information of the object to be recognized and the image background. Here, the color contrast refers to the degree of difference between the gray levels of the object to be recognized and the image background.

[0089] It can be understood that the color contrast between the color of the object to be recognized and the color of the image background is inversely proportional to the difficulty of distinguishing the object to be recognized and the image background.

[0090] Exemplarily, when the color contrast between the color of the object to be recognized and the color of the image background is smaller, the color difference between the object to be recognized and the image background is smaller, and it is more difficult to distinguish the object to be recognized and the image background; when the color contrast between the color of the object to be recognized and the color of the image background is larger, the color difference between the object to be recognized and the image background is larger, and it is easier to distinguish the object to be recognized and the image background.

[0091] In the embodiments of the present disclosure, adjusting the captured image based on the color contrast includes: converting the RGB channels of the captured image to HSV channels. Here, the HSV channels are a way of representing colors using hue (H), saturation (S), and value (V).

[0092] Among them, obtaining an adjustment image corresponding to the color contrast includes: a single-channel image generated based on the captured image. Exemplarily, the single-channel image generated based on the captured image includes an H-channel image, an S-channel image, or a V-channel image. Here, since the single-channel image is a grayscale image, it makes the adjustment image more conducive to subsequent image processing.

[0093] It should be noted that for identifying the end part of the object to be recognized based on the adjustment image, in one embodiment, it may be to identify the end part of the object to be recognized based on the H-channel image; in another embodiment, it may be to identify the end part of the object to be recognized based on the S-channel image; in still another embodiment, it may be to identify the end part of the object to be recognized based on the V-channel image.

[0094] In the embodiments of the present disclosure, the captured image is adjusted based on the color contrast to obtain an adjustment image, so that different colors of objects to be recognized correspond to different recognition methods; and, the end part of the object to be recognized is recognized based on the adjustment image. The adjustment image is more conducive to image processing, and the efficiency of recognizing the end part of the object to be recognized is improved.

[0095] In one embodiment, the adjusting the captured image based on the color contrast to obtain an adjustment image corresponding to the color contrast includes:

[0096] When the color contrast is greater than a preset threshold, adjust the saturation of the captured image to obtain a saturation image;

[0097] When the color contrast is less than or equal to the preset threshold, adjust the lightness of the captured image to obtain a lightness image.

[0098] In the embodiments of the present disclosure, when the color contrast is greater than the preset threshold, the color contrast gap between the object to be recognized and the image background in the captured image is large, and the object to be recognized can be more easily divided from the captured image between the object to be recognized and the image background. Therefore, obtaining the corresponding saturation image based on the captured image can improve the efficiency of recognizing the end part of the object to be recognized when the color contrast is greater than the preset threshold.

[0099] Similarly, when the color contrast is less than or equal to the preset threshold, the color contrast gap between the object to be recognized and the image background in the captured image is small, and it is difficult to recognize the end part of the object to be recognized based on the saturation image. When there are other colors at the edge position of the end part of the object to be recognized, based on the lightness image, it is easier to divide the object to be recognized and the image background from the captured image. Therefore, obtaining the corresponding lightness image based on the captured image can improve the efficiency of recognizing the end part of the object to be recognized when the color contrast is less than or equal to the preset threshold.

[0100] In the embodiments of the present disclosure, the preset threshold can be obtained through the color contrast between the color information of the object to be recognized and the color information of the image background, and the embodiments of the present disclosure do not limit this.

[0101] In the case where the color contrast is less than the preset threshold, adjusting the saturation of the captured image to obtain a saturation image includes: converting the RGB channels of the captured image into saturation channels to generate a saturation image.

[0102] It can be understood that obtaining a saturation image can reduce the interference of the image background on the recognition of the object to be recognized and reduce the possibility of misrecognition.

[0103] In the case where the color contrast is greater than or equal to the preset threshold, adjusting the lightness of the captured image to obtain a lightness image includes: converting the RGB channels of the captured image into lightness channels to generate a lightness image.

[0104] It can be understood that obtaining a lightness image makes the parts with large color contrast in the object to be recognized more prominent and enhances the recognition effect of the object to be recognized.

[0105] In the embodiments of the present disclosure, for different color contrast situations, different adjustment methods are adopted to more flexibly generate adjusted images, thereby improving the accuracy of recognizing the object to be recognized.

[0106] In one embodiment, recognizing the end of the object to be recognized based on the adjusted image includes:

[0107] Screening each pixel point in the adjusted image to obtain target pixel points;

[0108] Based on the coordinates of the target pixel points, determining the end length of the object to be recognized;

[0109] Based on the end length of the object to be recognized, recognizing the end of the object to be recognized.

[0110] In the embodiments of the present disclosure, each pixel point in the adjusted image is screened based on screening conditions to obtain target pixel points. Exemplarily, the screening conditions include the gray value, saturation, or lightness of the pixel points, etc. The embodiments of the present disclosure do not limit this.

[0111] Based on the coordinates of the target pixel points, the end length of the object to be recognized is determined. That is, in the image coordinate system of the adjusted image, based on the coordinates of the target pixel points at different positions in the target pixel points, the end length of the object to be recognized is calculated. Exemplarily, when the end of the object to be recognized is parallel to the horizontal axis of the image coordinate system of the adjusted image, and the distance between the first target pixel point and the second target pixel point corresponds to the end length of the object to be recognized, the horizontal axis coordinate of the first target pixel point minus the horizontal axis coordinate of the second target pixel point is the end length of the object to be recognized.

[0112] In the embodiments of the present disclosure, when the object to be recognized has multiple ends and the lengths of each end are different, based on the end lengths of the object to be recognized, the ends of the object to be recognized can be recognized. Exemplarily, the object to be recognized includes a first end with a first length and a second end with a second length. When the end of the object to be recognized is recognized as the first length, the end of the object to be recognized is the first end; when the end of the object to be recognized is recognized as the second length, the end of the object to be recognized is the second end.

[0113] In the embodiments of the present disclosure, by screening each pixel point in the adjusted image to obtain the target pixel points, the target pixel points corresponding to the ends of the object to be recognized can be accurately obtained in the adjusted image, reducing the interference of background information; and, based on the coordinates of the target pixel points, the lengths of the ends of the object to be recognized are determined, providing accurate length information for the subsequent recognition of the ends of the object to be recognized.

[0114] In one embodiment, the screening of each pixel point in the adjusted image to obtain the target pixel points includes:

[0115] Obtaining the average gray value of a plurality of the pixel points in the image background of the adjusted image;

[0116] Comparing the gray value of each pixel point in the adjusted image with the average gray value respectively, and taking the plurality of pixel points with the gray value greater than the average gray value as the target pixel points.

[0117] In the embodiments of the present disclosure, obtaining the average gray value of a plurality of the pixel points in the image background of the adjusted image includes: selecting a pixel region corresponding to the image background in the adjusted image, calculating the gray value of each pixel point in the pixel region corresponding to the image background, and calculating the average gray value of the pixel region; or, selecting a plurality of pixel regions corresponding to the image background in the adjusted image, calculating the gray value of each pixel point in the plurality of pixel regions, and calculating the average gray value.

[0118] Wherein, when the pixel point is black, the gray value is 0, and when the pixel point is white, the gray value is 255. That is, the average gray value is in the range of 0 to 50, and the embodiments of the present disclosure do not limit this.

[0119] It should be noted that when the adjusted image is a saturation image, the average gray value of multiple pixel points in the image background of the saturation image is obtained, and the gray value of each pixel point in the saturation image is compared with the average gray value respectively. Multiple pixel points with gray values greater than the average gray value are used as the target pixel points. When the adjusted image is a lightness image, the average gray value of multiple pixel points in the image background of the lightness image is obtained, and the gray value of each pixel point in the lightness image is compared with the average gray value respectively. Multiple pixel points with gray values greater than the average gray value are used as the target pixel points.

[0120] In the embodiments of the present disclosure, each pixel point in the adjusted image is traversed, and the gray value of each pixel point is compared with the average gray value. If the gray value of the pixel point is greater than the average gray value, the pixel point is marked as a target pixel point.

[0121] It should be noted that the target pixel points generated by different adjusted images are different. Exemplarily, when the adjusted image is a saturation image, the gray value of each pixel point in the saturation image is compared with the average gray value respectively. Multiple pixel points with gray values greater than the average gray value are used as the first target pixel points. When the adjusted image is a lightness image, the gray value of each pixel point in the saturation image is compared with the average gray value respectively. Multiple pixel points with gray values greater than the average gray value are used as the second target pixel points.

[0122] Among them, the coordinates and quantities of the first target pixel points and the second target pixel points in the adjusted image are different.

[0123] In the embodiments of the present disclosure, by calculating the average gray value of the gray values of multiple pixel points in the image background, the gray value difference between the image background and the object to be recognized can be highlighted, which helps to reduce the recognition interference of the image background and improve the accuracy of recognizing the end of the object to be recognized.

[0124] In one embodiment, the object to be recognized includes a coaxial cable; determining the end length of the object to be recognized based on the coordinates of the target pixel points includes:

[0125] In the case where the adjusted image is a saturation image, the pixel region surrounded by the target pixel points is divided based on the shape of the coaxial cable to obtain a first target region; based on the coordinates of the target pixel points at the edge position in the first target region, the length of the first target region in the extending direction of the first target region is determined; the length of the first target region in the extending direction of the first target region is used as the end length of the object to be recognized;

[0126] and / or,

[0127] When the adjusted image is a chroma value image, based on the terminal shape of the coaxial cable and the shape of the grounding ring of the coaxial cable, divide the pixel region surrounded by the target pixel points to obtain a second target region corresponding to the terminal shape and a third target region corresponding to the shape of the grounding ring; based on the second target region and the third target region, determine the end length of the object to be recognized.

[0128] In the embodiments of the present disclosure, when the adjusted image is a saturation image, since the ends of the coaxial cable are of the same color, the first target region can be corresponding to the ends of the coaxial cable, and the end length of the coaxial cable is determined by determining the length of the first target region in the extension direction of the first target region.

[0129] Figure 3 is a schematic diagram of a coaxial cable shown according to an exemplary embodiment, as Figure 3 shown, the end of the coaxial cable 111 can be composed of the part of the coaxial cable 111 between the terminal 112 and the grounding ring 113 in the coaxial cable 111. Among them, the terminal and the grounding ring are made of metal materials, so the terminal and the grounding ring are gold or silver, etc. The color of the coaxial cable includes blue, white or black.

[0130] In the embodiments of the present disclosure, the color of the image background is black, and the color contrast between the coaxial cable in blue or white and the image background is greater than a preset threshold, so a saturation image is generated based on the captured image.

[0131] Figure 4 is a schematic diagram of a saturation image shown according to an exemplary embodiment, as Figure 4 shown, the target pixel points obtained based on the saturation image include the pixel points corresponding to the coaxial cable 111 between the terminal 112 and the grounding ring 113, and the pixel points corresponding to the mechanical jaws clamping the coaxial cable 111 in the saturation image.

[0132] It can be understood that the coaxial cable is linear and rectangular in shape, and the pixel region surrounded by the target pixel points is divided based on the shape of the coaxial cable to obtain a first target region.

[0133] Figure 5 is a schematic diagram of a saturation image showing the first target region shown according to an exemplary embodiment, as Figure 5 shown, the first target region corresponds to the part of the coaxial cable 111 between the terminal 112 and the grounding ring 113 in the coaxial cable 111, and the part of the coaxial cable between the grounding ring 113 and the mechanical jaws.

[0134] Also, since the end of the coaxial cable is on the left side in the saturation image, based on the coordinates of the target pixel points on the left side in the first target area, the first target area corresponding to the part of the coaxial cable from the terminal to the grounding ring in the coaxial cable can be filtered out.

[0135] In the embodiments of the present disclosure, based on the first target area corresponding to the part of the coaxial cable from the terminal to the grounding ring in the coaxial cable, the coordinates of the target pixel points on the left side and the coordinates of the target pixel points on the right side in the first target area can be obtained, and the length of the first target area in the extending direction of the first target area can be determined.

[0136] Exemplarily, when the coordinates of the target pixel points on the left side in the first target area are (x1, y1) and the coordinates of the target pixel points on the right side in the first target area are (x2, y2), the length of the first target area in the extending direction of the first target area is

[0137] It can be understood that the first target area corresponding to the part of the coaxial cable from the terminal to the grounding ring in the coaxial cable is used as the end length of the coaxial cable.

[0138] In the embodiments of the present disclosure, in the case where the image is adjusted to a saturation image, dividing the pixel area enclosed by the target pixel points based on the shape of the coaxial cable to obtain the first target area can improve the accuracy of identifying the end of the coaxial cable.

[0139] In the embodiments of the present disclosure, in the case where the image is adjusted to a lightness image, the color of the image background is black, and the color contrast between the black coaxial cable and the image background is less than or equal to a preset threshold. Therefore, a lightness image is generated based on the captured image.

[0140] Wherein, since the terminals of the coaxial cable are of the same color and the grounding ring of the coaxial cable is of the same color, the second target area can be corresponding to the terminals of the coaxial cable, and the third target area can be corresponding to the grounding ring of the coaxial cable. The end length of the coaxial cable is determined by determining the length between the second target area and the third target area.

[0141] Figure 6 is a schematic diagram of a lightness image shown according to an exemplary embodiment, as Figure 6 shown, the target pixel points obtained based on the lightness image include the pixel points corresponding to the terminal 113, the pixel points corresponding to the grounding ring 112, and the pixel points corresponding to the mechanical gripper clamping the coaxial cable 111 in the lightness image.

[0142] It can be understood that the terminals and the grounding ring are linear and similar to a rectangle. Based on the shapes of the terminals and the grounding ring, the pixel area enclosed by the target pixel points is divided to obtain a second target area corresponding to the shape of the terminals and a third target area corresponding to the shape of the grounding ring.

[0143] Figure 7 It is a schematic diagram of a chromatic lightness image showing a second target area and a third target area according to an exemplary embodiment. As Figure 7 shown, the second target area corresponds to the part of the terminal 112 in the coaxial line 111 in the chromatic lightness image, and the third target area corresponds to the part of the grounding ring 113 in the coaxial line 111 in the chromatic lightness image.

[0144] In the embodiments of the present disclosure, since the coaxial line between the terminal and the grounding ring corresponds to the end of the coaxial line, therefore, the end length of the coaxial line can be determined based on the second target area and the third target area.

[0145] It can be understood that since the coaxial line has straight and bent situations, different methods are used to determine the end length of the coaxial line in different situations.

[0146] In one embodiment, determining the end length of the object to be recognized based on the second target area and the third target area includes:

[0147] In the image coordinate system of the chromatic lightness image, obtain a first angle between the extension line of the second target area and the horizontal axis in the image coordinate system and a second angle between the extension line of the third target area and the horizontal axis;

[0148] When the absolute value of the difference between the first angle and the second angle is less than or equal to a preset angle threshold, determine the end length of the object to be recognized based on the coordinates of the central pixel point of the second target area and the coordinates of the central pixel point of the third target area;

[0149] When the absolute value of the difference between the first angle and the second angle is greater than the preset angle threshold, obtain the intersection point of the extension line of the second target area and the extension line of the third target area, and determine the end length of the object to be recognized based on the coordinates of the pixel point corresponding to the intersection point.

[0150] Exemplarily, in the image coordinate system of the chromatic lightness image, obtain a first angle r1 between the extension line of the second target area and the horizontal axis in the image coordinate system, and obtain a second angle r2 between the extension line of the third target area and the horizontal axis.

[0151] It can be understood that when |r1 - r2| is less than or equal to the preset angle threshold, the part of the coaxial line between the terminal and the grounding ring of the coaxial line is straight. Here, the preset angle threshold can be set according to the actual situation. Exemplarily, the preset angle threshold can be in the range of 3 degrees to 10 degrees, and the embodiments of the present disclosure do not limit this.

[0152] In one embodiment, when the coaxial line between the terminal of the coaxial line and the grounding ring is straight, determining the end length of the object to be recognized based on the coordinates of the central pixel point of the second target area and the coordinates of the central pixel point of the third target area includes:

[0153] Based on the coordinates of the central pixel point of the second target area and the coordinates of the central pixel point of the third target area, determine the length between the two central pixel points;

[0154] Subtract half of the length of the second target area in the extension direction of the second target area and the length of the third target area in the extension direction of the third target area from the length between the two central pixel points, and use it as the end length of the object to be recognized.

[0155] It can be understood that when the coaxial line between the terminal and the grounding ring is straight, the length from the central pixel point of the second target area to the central pixel point of the third target area includes: the length from the central pixel point of the terminal to the edge of the terminal, the length of the coaxial line between the terminal and the grounding ring, and the length from the edge of the grounding ring to the central pixel point of the grounding ring.

[0156] Therefore, subtracting half of the length of the second target area in the extension direction of the second target area and the length of the third target area in the extension direction of the third target area from the length between the two central pixel points can obtain the length of the coaxial line between the terminal and the grounding ring, that is, the length of the end of the coaxial line.

[0157] In the embodiments of the present disclosure, by using the coordinates of the central pixel point of the second target area and the coordinates of the central pixel point of the third target area, the length of the end of the coaxial line is obtained when the coaxial line between the terminal and the grounding ring is straight, which improves the accuracy of identifying the length of the end of the coaxial line.

[0158] It can be understood that when |r1 - r2| is greater than the preset angle threshold, the coaxial line between the terminal of the coaxial line and the grounding ring is bent.

[0159] In another embodiment, when the coaxial line between the terminal of the coaxial line and the grounding ring is bent, determining the end length of the object to be recognized based on the coordinates of the pixel point corresponding to the intersection point includes:

[0160] Based on the coordinates of the pixel point corresponding to the intersection point and the coordinates of the central pixel point of the second target area, obtain the first distance from the intersection point to the central pixel point of the second target area;

[0161] Based on the coordinates of the pixel point corresponding to the intersection point and the coordinates of the central pixel point of the third target area, obtain a second distance from the intersection point to the central pixel point of the third target area;

[0162] Based on the first distance and the second distance, determine the end length of the object to be recognized.

[0163] It can be understood that the first distance includes: the length from the central pixel point of the terminal to the edge of the terminal and the length from the edge of the terminal to the intersection point; the second distance includes: the length from the intersection point to the edge of the grounding ring and the length from the edge of the grounding ring to the central pixel point of the grounding ring.

[0164] In one embodiment, the determining the end length of the object to be recognized based on the first distance and the second distance includes: subtracting half of the length of the second target area in the extension direction of the second target area and the length of the third target area in the extension direction of the third target area from the sum of the first distance and the second distance, as the end length of the object to be recognized.

[0165] Therefore, subtracting half of the length of the second target area in the extension direction of the second target area and the length of the third target area in the extension direction of the third target area from the sum of the first distance and the second distance can obtain the sum of the length from the edge of the terminal to the intersection point and the length from the intersection point to the edge of the grounding ring.

[0166] It can be understood that the intersection point corresponds to the bending point of the coaxial cable. The sum of the length from the edge of the terminal to the intersection point and the length from the intersection point to the edge of the grounding ring is approximately equal to the length of the bent coaxial cable between the terminal and the grounding ring, that is, the length of the end of the coaxial cable.

[0167] In the embodiments of the present disclosure, by using the intersection point coordinates, the first distance, and the second distance, when the coaxial cable between the terminal and the grounding ring is bent, the length of the end of the coaxial cable is obtained, improving the accuracy of identifying the length of the end of the coaxial cable.

[0168] In one embodiment, the object to be recognized is a coaxial cable; based on the end length of the object to be recognized, the recognition of the end of the object to be recognized includes:

[0169] When the end length of the coaxial cable is greater than a preset length threshold, recognize the end of the coaxial cable as the long end of the coaxial cable;

[0170] When the end length of the coaxial cable is less than or equal to the preset length threshold, recognize the end of the coaxial cable as the short end of the coaxial cable.

[0171] In the embodiments of the present disclosure, the coaxial cable includes a long end and a short end, and both the long end and the short end of the coaxial cable include a grounding ring and a terminal. Moreover, the distance from the terminal to the grounding ring in the long end of the coaxial cable is greater than the distance from the terminal to the grounding ring in the short end of the coaxial cable, that is, the length of the end portion in the long end of the coaxial cable is greater than the length of the end portion in the short end of the coaxial cable.

[0172] Therefore, a length threshold can be preset, and the long end or the short end of the coaxial cable can be determined based on the comparison result between the length of the end portion of the coaxial cable and the preset length threshold. That is, when the length of the end portion of the coaxial cable is greater than the preset length threshold, the end portion of the coaxial cable is identified as the long end of the coaxial cable; when the length of the end portion of the coaxial cable is less than or equal to the preset length threshold, the end portion of the coaxial cable is identified as the short end of the coaxial cable.

[0173] Among them, the length threshold can be set according to the long end and the short end of the coaxial cable, and the embodiments of the present disclosure do not limit this. Exemplarily, when the long end of the coaxial cable is 15 millimeters and the short end of the coaxial cable is 10 millimeters, the preset length threshold can be set within the range of 11 millimeters to 14 millimeters, and the embodiments of the present disclosure do not limit this.

[0174] In the embodiments of the present disclosure, identifying the long end or the short end of the coaxial cable based on the length of the end portion of the coaxial cable improves the efficiency of identifying the end portion of the coaxial cable.

[0175] In one embodiment, obtaining the color information of the object to be identified includes: obtaining the color information of the object to be identified by identifying a color image having the object to be identified; or, obtaining the color information of the object to be identified corresponding to the serial number by scanning the serial number of the object to be identified.

[0176] In the embodiments of the present disclosure, the step of obtaining the color information of the object to be identified by identifying a color image having the object to be identified includes: photographing the object to be identified to obtain a color image of the object to be identified; extracting the color information of the object to be identified from the color image of the object to be identified.

[0177] It should be noted that each pixel of the color image has three channels, respectively representing the RGB three components, and the respective value ranges of the three components are all from 0 to 255. Combining these three components can obtain more color representation methods. For example, combining red and green can produce yellow, combining red and blue can produce purple, and combining green and blue can produce cyan. Extracting the color information of the object to be identified is to obtain the values of the RGB three components.

[0178] In the embodiments of the present disclosure, the steps of obtaining the color information of the object to be recognized corresponding to the serial number by scanning the serial number of the object to be recognized include: extracting the serial number and color information bound to the object to be recognized; transporting the object to be recognized to the corresponding scanning position for scanning to obtain the serial number of the object to be recognized; and obtaining the color information of the object to be recognized based on the color information corresponding to the serial number.

[0179] Among them, the serial number of the object to be recognized may be a serial number corresponding to the color of the object to be recognized. Exemplarily, when the object to be recognized is a coaxial cable, the blue coaxial cables may be the same first serial number, the white coaxial cables may be the same second serial number, and the black coaxial cables may be the same third serial number.

[0180] It should be noted that scanning the object to be recognized to obtain the serial number may be by scanning the QR code on the object to be recognized, or by recognizing the code on the object to be recognized. The embodiments of the present disclosure do not limit this.

[0181] In the embodiments of the present disclosure, obtaining the color information of the object to be recognized based on the color image of the object to be recognized can more flexibly distinguish the color of the object to be recognized; obtaining the color information of the corresponding object to be recognized based on the serial number can improve the efficiency of obtaining the color information of the object to be recognized. In this way, it provides a basis for subsequent recognition of the end of the object to be recognized.

[0182] In one embodiment, the method further includes:

[0183] Based on the recognition result of recognizing the end of the object to be recognized, controlling the installation device of the object to be recognized to install the object to be recognized in the electronic device.

[0184] Among them, the above-mentioned electronic device may be a wearable electronic device and a mobile terminal device. The mobile terminal device includes a mobile phone, a notebook or a tablet computer, and the wearable electronic device includes a smart watch or smart glasses. The embodiments of the present disclosure do not limit this.

[0185] In the embodiments of the present disclosure, different ends of the object to be recognized need to be installed in different positions in the electronic device. Therefore, based on the recognition result of recognizing the end of the object to be recognized, the installation device is controlled to install the object to be recognized in the electronic device.

[0186] It should be noted that in the automated production process, the digital twin intelligent factory management system controls the installation device to install the object to be recognized. Exemplarily, the recognition device uploads the recognition result of the end of the device to be recognized to the digital twin intelligent factory management system, and the digital twin intelligent factory management system sends a control instruction to the installation device, and the installation device installs the object to be recognized into the electronic device in response to the control instruction.

[0187] Among them, the digital twin intelligent factory management system includes an Internet of Things platform and a device management system, which are used to strengthen information management and services, clearly master the production and sales process, improve the controllability of the production process, reduce the manual intervention on the production line, instantaneously and correctly collect production line data, and rationally arrange production plans and production progress.

[0188] In an embodiment of the present disclosure, when the object to be recognized is a coaxial cable, the ends of the coaxial cable include a long end and a short end. Based on the recognition result of recognizing the ends of the coaxial cable, the installation device installs the short end of the coaxial cable at the corresponding position on the main board of the electronic device, and installs the long end of the coaxial cable at the corresponding position on the daughter board of the electronic device.

[0189] In an embodiment of the present disclosure, based on the recognition result of recognizing the ends of the object to be recognized, the installation device of the object to be recognized is controlled to install the object to be recognized in the electronic device. In this way, the errors caused by manual recognition and manual installation are reduced, and the efficiency and accuracy of installing the device to be recognized are improved.

[0190] Figure 8 It is a structural block diagram of an identification device provided according to an exemplary embodiment. As Figure 8 shown, the identification device 700 provided in the embodiment of the present disclosure may include:

[0191] An information acquisition module 1001, configured to acquire color information of the object to be recognized;

[0192] An image acquisition module 1002, configured to acquire a captured image of the object to be recognized;

[0193] An identification module 1003, configured to identify the ends of the object to be recognized based on the color information of the object to be recognized and the captured image.

[0194] In some embodiments, the identification module is further configured to determine a color contrast based on the color information of the object to be recognized and the color information of the image background in the captured image; adjust the captured image based on the color contrast to obtain an adjusted image corresponding to the color contrast; and identify the ends of the object to be recognized based on the adjusted image.

[0195] In some embodiments, the identification module is further configured to adjust the saturation of the captured image to obtain a saturation image when the color contrast is greater than a preset threshold; and adjust the lightness of the captured image to obtain a lightness image when the color contrast is less than or equal to the preset threshold.

[0196] In some embodiments, the recognition module is further configured to screen each pixel point in the adjusted image to obtain target pixel points; determine the end length of the object to be recognized based on the coordinates of the target pixel points; and recognize the end of the object to be recognized based on the end length of the object to be recognized.

[0197] In some embodiments, the recognition module is further configured to obtain the average gray value of multiple pixel points in the image background of the adjusted image; compare the gray value of each pixel point in the adjusted image with the average gray value respectively, and use the multiple pixel points whose gray value is greater than the average gray value as the target pixel points.

[0198] In some embodiments, the object to be recognized includes a coaxial cable; the recognition module is further configured to, when the adjusted image is a saturation image, divide the pixel region enclosed by the target pixel points based on the shape of the coaxial cable to obtain a first target region; determine the length of the first target region in the extending direction of the first target region based on the coordinates of the target pixel points at the edge position in the first target region; use the length of the first target region in the extending direction of the first target region as the end length of the object to be recognized; and / or, when the adjusted image is a lightness image, divide the pixel region enclosed by the target pixel points based on the terminal shape of the coaxial cable and the shape of the grounding ring of the coaxial cable to obtain a second target region corresponding to the terminal shape and a third target region corresponding to the shape of the grounding ring; determine the end length of the object to be recognized based on the second target region and the third target region.

[0199] In some embodiments, the recognition module is further configured to obtain a first included angle between the extension line of the second target region and the horizontal axis in the image coordinate system of the lightness image and a second included angle between the extension line of the third target region and the horizontal axis; when the absolute value of the difference between the first included angle and the second included angle is less than or equal to a preset angle threshold, determine the end length of the object to be recognized based on the coordinates of the central pixel point of the second target region and the coordinates of the central pixel point of the third target region; when the absolute value of the difference between the first included angle and the second included angle is greater than the preset angle threshold, obtain the intersection point of the extension line of the second target region and the extension line of the third target region, and determine the end length of the object to be recognized based on the coordinates of the pixel point corresponding to the intersection point.

[0200] In some embodiments, the recognition module is further configured to obtain a first distance from the intersection point to the central pixel point of the second target area based on the coordinates of the pixel point corresponding to the intersection point and the coordinates of the central pixel point of the second target area; obtain a second distance from the intersection point to the central pixel point of the third target area based on the coordinates of the pixel point corresponding to the intersection point and the coordinates of the central pixel point of the third target area; and determine the end length of the object to be recognized based on the first distance and the second distance.

[0201] In some embodiments, the object to be recognized is a coaxial cable; the recognition module is further configured to, when the end length of the coaxial cable is greater than a preset length threshold, recognize the end of the coaxial cable as the long end of the coaxial cable; and when the end length of the coaxial cable is less than or equal to the preset length threshold, recognize the end of the coaxial cable as the short end of the coaxial cable.

[0202] In some embodiments, the recognition device further includes:

[0203] A control module, configured to control the installation device of the object to be recognized to install the object to be recognized in the electronic device based on the recognition result of recognizing the end of the object to be recognized.

[0204] Figure 9 is a structural block diagram of an electronic device shown according to an exemplary embodiment. For example, the electronic device 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0205] Referring to Figure 9 , the electronic device 900 may include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input / output (I / O) interface 912, a sensor component 914, and a communication component 916.

[0206] The processing component 902 generally controls the overall operation of the electronic device 900, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.

[0207] The memory 904 is configured to store various types of data to support the operations on the electronic device 900. Examples of such data include at least one of the following: instructions for any application or method operating on the electronic device 900, contact data, phone book data, messages, pictures, and videos. The memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0208] The power supply component 906 provides power for various components of the electronic device 900. The power supply component 906 can include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 900.

[0209] The multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the electronic device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.

[0210] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC). When the electronic device 900 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio signals. The received audio signals can be further stored in the memory 904 or transmitted via the communication component 916. In some embodiments, the audio component 910 further includes a speaker for outputting audio signals.

[0211] The I / O interface 912 provides an interface between the processing component 902 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power button, and a lock button.

[0212] The sensor component 914 includes one or more sensors for providing status assessments of various aspects of the electronic device 900. For example, the sensor component 914 can detect the on / off state of the electronic device 900, the relative positioning of components, such as the display and keypad of the electronic device 900. The sensor component 914 can also detect a change in the position of the electronic device 900 or a component in the electronic device 900, the presence or absence of user contact with the electronic device 900, the orientation or acceleration / deceleration of the electronic device 900, and the temperature change of the electronic device 900. The sensor component 914 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 914 can also include a light sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor component 914 can further include at least one of the following, but is not limited to: an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, and a temperature sensor.

[0213] The communication component 916 is configured to facilitate communication between the electronic device 900 and other devices in a wired or wireless manner. The electronic device 900 can access a communication standard-based wireless network, such as Wi-Fi, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0214] In an exemplary embodiment, the electronic device 900 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0215] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including executable instructions or a computer program, and the above instructions or computer program can be executed by a processor 920 of the electronic device 900 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, Random Access Memory (RAM), Compact Disc Read-Only Memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0216] A non - transitory computer - readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables a first device to execute an identification method, the method comprising: obtaining color information of an object to be identified; obtaining a captured image of the object to be identified; and identifying an end portion of the object to be identified based on the color information of the object to be identified and the captured image.

[0217] Embodiments of the present disclosure provide a computer program product, which includes: a computer program or executable instructions, and the computer program or executable instructions are stored in a computer - readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer - readable storage medium, and the processor executes the computer program or executable instructions, enabling the computer device to execute any one of the above - mentioned identification methods of the embodiments of the present disclosure.

[0218] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0219] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A recognition method, characterized in that, The method includes: Obtaining color information of an object to be recognized; Obtaining a captured image of the object to be recognized; Based on the color information of the object to be recognized and the captured image, identifying the end part of the object to be recognized.

2. The recognition method according to claim 1, wherein The identifying the end part of the object to be recognized based on the color information of the object to be recognized and the captured image includes: Determining a color contrast based on the color information of the object to be recognized and the color information of the image background in the captured image; Adjusting the captured image based on the color contrast to obtain an adjusted image corresponding to the color contrast; Based on the adjusted image, identifying the end part of the object to be recognized.

3. The recognition method according to claim 2, characterized in that The adjusting the captured image based on the color contrast to obtain an adjusted image corresponding to the color contrast includes: When the color contrast is greater than a preset threshold, adjusting the saturation of the captured image to obtain a saturation image; When the color contrast is less than or equal to the preset threshold, adjusting the lightness of the captured image to obtain a lightness image.

4. The recognition method according to claim 2, characterized in that, The identifying the end part of the object to be recognized based on the adjusted image includes: Screening each pixel point in the adjusted image to obtain target pixel points; Based on the coordinates of the target pixel points, determining the end length of the object to be recognized; Based on the end length of the object to be recognized, identifying the end part of the object to be recognized.

5. The recognition method according to claim 4, characterized in that The screening each pixel point in the adjusted image to obtain target pixel points includes: Obtaining the average gray value of a plurality of pixel points in the image background of the adjusted image; Comparing the gray value of each pixel point in the adjusted image with the average gray value respectively, and taking the plurality of pixel points with gray values greater than the average gray value as the target pixel points.

6. The recognition method according to claim 4, characterized in that, The object to be recognized includes a coaxial cable; the determining the end length of the object to be recognized based on the coordinates of the target pixel points includes: When the adjusted image is a saturation image, dividing the pixel region enclosed by the target pixel points based on the shape of the coaxial cable to obtain a first target region; based on the coordinates of the target pixel points at the edge position in the first target region, determining the length of the first target region in the extending direction of the first target region; taking the length of the first target region in the extending direction of the first target region as the end length of the object to be recognized; And / or, When the adjusted image is a lightness image, dividing the pixel region enclosed by the target pixel points based on the terminal shape of the coaxial cable and the shape of the grounding ring of the coaxial cable to obtain a second target region corresponding to the terminal shape and a third target region corresponding to the shape of the grounding ring; Based on the second target region and the third target region, determining the end length of the object to be recognized.

7. The recognition method according to claim 6, wherein The determining the end length of the object to be recognized based on the second target region and the third target region includes: In the image coordinate system of the color lightness image, obtain a first included angle between the extension line of the second target area and the horizontal axis in the image coordinate system and a second included angle between the extension line of the third target area and the horizontal axis. When the absolute value of the difference between the first included angle and the second included angle is less than or equal to a preset angle threshold, determine the end length of the object to be recognized based on the coordinates of the central pixel point of the second target area and the coordinates of the central pixel point of the third target area. When the absolute value of the difference between the first included angle and the second included angle is greater than the preset angle threshold, obtain the intersection point of the extension line of the second target area and the extension line of the third target area, and determine the end length of the object to be recognized based on the coordinates of the pixel point corresponding to the intersection point.

8. The method according to claim 7, wherein The determining the end length of the object to be recognized based on the coordinates of the pixel point corresponding to the intersection point includes: Based on the coordinates of the pixel point corresponding to the intersection point and the coordinates of the central pixel point of the second target area, obtain a first distance from the intersection point to the central pixel point of the second target area. Based on the coordinates of the pixel point corresponding to the intersection point and the coordinates of the central pixel point of the third target area, obtain a second distance from the intersection point to the central pixel point of the third target area. Based on the first distance and the second distance, determine the end length of the object to be recognized.

9. The recognition method according to claim 4, characterized in that, The object to be recognized is a coaxial cable. Based on the end length of the object to be recognized, the recognition of the end of the object to be recognized includes: When the end length of the coaxial cable is greater than a preset length threshold, recognize the end of the coaxial cable as the long end of the coaxial cable. When the end length of the coaxial cable is less than or equal to the preset length threshold, recognize the end of the coaxial cable as the short end of the coaxial cable.

10. The recognition method according to any one of claims 1 to 9, characterized in that The method further includes: Based on the recognition result of the recognition of the end of the object to be recognized, control the installation device of the object to be recognized to install the object to be recognized in an electronic device.

11. An identification device, characterized in that, The device includes: An information acquisition module configured to acquire color information of an object to be recognized. An image acquisition module configured to acquire a captured image of the object to be recognized. A recognition module configured to recognize the end of the object to be recognized based on the color information of the object to be recognized and the captured image.

12. An electronic device, characterized in that, Includes: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the recognition method according to any one of claims 1 to 10.

13. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is enabled to execute the recognition method according to any one of claims 1 to 10.

14. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, the steps of the recognition method according to any one of claims 1 to 10 are implemented.