Color Recognition Method, Device, Equipment and Storage Medium

By displaying images in electronic devices, responding to area selection and enlargement operations, the magnification ratio is automatically determined and the pixel color is identified, which solves the problem of inconvenience among color blind people or those with weak colors, and achieves efficient and accurate color recognition.

CN113963181BActive Publication Date: 2025-08-01BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111300836.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-04
Publication Date
2025-08-01
Estimated Expiration
2041-11-04

AI Technical Summary

Technical Problem

Color blind people or people with weak colors find it difficult to distinguish some of the colors in the natural spectrum in real life, which leads to inconvenience in life.

Method used

By displaying the image to be identified, the candidate area is determined in response to the area selection operation, the candidate area image is enlarged, the target color of the pixel point is recognized and output, and the magnification ratio is automatically determined by electronic devices to improve the color recognition accuracy.

Benefits of technology

The accuracy of color recognition results can be improved without the need for color blindness correction devices, reduce hardware costs, adapt to different user groups, and improve color recognition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113963181B_ABST
    Figure CN113963181B_ABST
Patent Text Reader

Abstract

The present disclosure provides a color recognition method, apparatus, device, and storage medium, relating to the technical field of image processing, and particularly to artificial intelligence technology. The specific implementation solution is as follows: display an image to be recognized; in response to an area selection operation on the image to be recognized, determine a candidate area according to the selected area; magnify and display the image of the corresponding area of the candidate area to obtain a locally magnified image; in response to a pixel point selection operation on the locally magnified image, recognize the target color of the selected pixel point, and output the target color. According to the technology of the present disclosure, the accuracy of the color recognition result 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 processing technologies, particularly to artificial intelligence technologies, and specifically to a color recognition method, apparatus, device, and storage medium. Background Art

[0002] Congenital color vision deficiency, commonly known as color blindness, is a genetic physiological defect caused by an imbalance in the proportion of the three primary color vectors received by the brain. Since color-blind or color-weak individuals cannot distinguish at least some colors in the natural spectrum, they face many inconveniences in real life. Summary of the Invention

[0003] The present disclosure provides a color recognition method, apparatus, device, and storage medium.

[0004] According to one aspect of the present disclosure, there is provided a color recognition method, including:

[0005] Display an image to be recognized;

[0006] In response to an operation of selecting a region of the image to be recognized, determine a candidate region according to the selected region;

[0007] Enlarge and display the image corresponding to the candidate region to obtain a locally enlarged image;

[0008] In response to an operation of selecting a pixel point of the locally enlarged image, recognize the target color of the selected pixel point and output the target color.

[0009] According to another aspect of the present disclosure, there is also provided an electronic device, including:

[0010] At least one processor; and

[0011] A memory communicatively connected to the at least one processor; wherein,

[0012] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute a color recognition method provided in any embodiment of the present disclosure.

[0013] According to another aspect of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute a color recognition method provided in any embodiment of the present disclosure.

[0014] According to the technology of the present disclosure, the accuracy of the color recognition result is improved.

[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. Description of the Drawings

[0016] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0017] Figure 1 is a flowchart of a color recognition method provided by an embodiment of the present disclosure;

[0018] Figure 2 is a flowchart of another color recognition method provided by an embodiment of the present disclosure;

[0019] Figure 3 is a flowchart of another color recognition method provided by an embodiment of the present disclosure;

[0020] Figure 4A is a flowchart of another color recognition method provided by an embodiment of the present disclosure;

[0021] Figure 4B is a schematic diagram of an image to be recognized provided by an embodiment of the present disclosure;

[0022] Figure 4C is a schematic diagram of the determination result of a partial enlarged image provided by an embodiment of the present disclosure;

[0023] Figure 4D is a schematic diagram of the determination result of another partial enlarged image provided by an embodiment of the present disclosure;

[0024] Figure 5 is a structural diagram of a color recognition device provided by an embodiment of the present disclosure;

[0025] Figure 6 is a block diagram of an electronic device for implementing the color recognition method of the embodiments of the present disclosure. Detailed Embodiments

[0026] The following describes exemplary embodiments of the present disclosure in conjunction with the drawings. Among them, various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0027] The various color recognition methods and color recognition devices provided by the present disclosure are applicable to application scenarios for color recognition of pixel points in an image. The various color recognition methods provided by the present disclosure can be executed by a color recognition device, which can be implemented by software and / or hardware and is specifically configured in an electronic device. The electronic device can be a terminal device or a server, and the present disclosure does not make any limitation thereto.

[0028] For ease of understanding, the color recognition method will be described in detail first.

[0029] See Figure 1 A color recognition method shown in the figure includes:

[0030] S101. Display an image to be recognized.

[0031] Optionally, the image to be recognized can be pre-stored locally in the electronic device or in other storage devices associated with the electronic device; correspondingly, the image to be recognized is obtained and displayed from the local of the electronic device or other storage devices. Typically, the image to be recognized can be imported from the local album of the electronic device for display.

[0032] Or optionally, when there is a need for color recognition, the image to be recognized can be collected and displayed.

[0033] S102. In response to an operation of selecting a region of the image to be recognized, determine a candidate region according to the selected region.

[0034] Among them, the operation of selecting a region of the image to be recognized can be a click operation, a box selection operation, a drag operation, etc., and the present disclosure does not make any limitation thereto. The candidate region is used to represent the region intended to be associated by the operator. It should be noted that the present disclosure does not make any limitation to the specific shape of the candidate region. Of course, for ease of viewing, the shape of the candidate region can be set to a regular geometric shape, such as a rectangle, a circle, or a regular polygon, etc.

[0035] Exemplarily, determining the candidate region according to the selected region can be directly using the selected region as the candidate region; or, the selected region can also be expanded, and the expanded region is used as the candidate region. Among them, the expansion parameters followed when expanding can include at least one of an expansion multiple and an expansion direction, etc. The specific values of the respective expansion parameters can be set by a technician according to empirical values, or selected or set by the operator according to actual needs.

[0036] It should be noted that when the region selection operation cannot accurately represent the intention of the operator, for example, when presenting an image to be recognized on a smart terminal, if the operator clicks on the image to be recognized with a relatively thick touch object (such as a finger) to generate a region selection operation, the clicked region may include the actual intended region, or there may be a certain deviation between the clicked region and the actual intended region of the operator. Therefore, the determination of the candidate region provides data support for generating a locally magnified image in the subsequent process, facilitating the operator to accurately select pixel points.

[0037] S103. Magnify and display the image of the corresponding region of the candidate region to obtain a locally magnified image.

[0038] The magnification and display of the image of the corresponding region of the candidate region can be achieved by magnifying the image to be recognized and then associating and magnifying the candidate region; or, it can also be achieved by only magnifying the image of the corresponding region of the candidate region. The present disclosure does not make any limitation on the specific magnified object.

[0039] In an optional embodiment, the image of the corresponding region of the candidate region can be magnified according to a preset magnification ratio to obtain a locally magnified image, and the locally magnified image is displayed. Among them, the preset magnification ratio can be determined by a technician according to needs or empirical values, or can be set independently by the operator.

[0040] Since the display of the locally magnified image according to the preset magnification ratio may result in an unsatisfactory magnification result (such as being too large or too small), making it impossible for the operator to select the desired recognized pixel points or causing discomfort in viewing; or the operator needs to manually adjust the preset magnification ratio, reducing the color recognition efficiency. To avoid the above situations, in another optional embodiment, the target magnification ratio can also be automatically determined, and then the image of the corresponding region of the candidate region is magnified according to the target magnification ratio.

[0041] Exemplarily, the target magnification ratio can be determined according to the candidate magnification ratios corresponding to various colors in the candidate region; and the image of the corresponding region of the candidate region is magnified according to the target magnification ratio to obtain a locally magnified image.

[0042] Among them, the candidate magnification ratios corresponding to various colors are preset, and the values of the candidate magnification ratios can be set by a technician according to needs or empirical values, or determined by the operator according to his own needs. It should be noted that the candidate magnification ratios corresponding to different colors can be the same or different, and the present disclosure does not make any limitation on this.

[0043] In a specific implementation manner, the maximum magnification ratio, the minimum magnification ratio, the average magnification ratio, the median magnification ratio, or one of the candidate magnification ratios can be randomly selected from the candidate magnification ratios corresponding to various colors in the candidate region as the target magnification ratio.

[0044] Limited by the size of the electronic device's own screen and the convenience of one-handed operation by the operator, a local magnification display area is usually preset in the electronic device to display a locally magnified image, thereby limiting the size of the locally magnified image, avoiding the situation that the locally magnified image is too large and causing inconvenience for the operator to operate the electronic device with one hand, and at the same time avoiding the situation that the locally magnified image is too small and subsequent pixel point selection cannot be performed. In another specific implementation manner, in order to automatically determine the target magnification ratio while enabling the locally magnified image to adapt to the size of the local magnification display area, the reference magnification ratio can also be determined according to the ratio of the candidate area to the local magnification display area; according to the reference magnification ratio, the target magnification ratio is selected from the candidate magnification ratios corresponding to various colors in the candidate area.

[0045] Specifically, the ratio of the candidate area to the local magnification display area can be used as the reference magnification ratio; the candidate magnification ratio with a smaller difference (for example, the smallest) from the reference magnification ratio is selected from the candidate magnification ratios corresponding to various colors in the candidate area as the target magnification ratio. Of course, in order to avoid the situation that the locally magnified image overflows the local magnification display area or the local magnification display area cannot display the locally magnified image as a whole, the candidate magnification ratio with a smaller difference (for example, the smallest) from the reference magnification ratio can also be selected from the candidate magnification ratios with values smaller than the reference magnification ratio as the target magnification ratio.

[0046] It can be understood that the above optional embodiment details the determination process of the locally magnified image as determining the target magnification ratio according to the candidate magnification ratios corresponding to various colors in the candidate area, and magnifying the image corresponding to the candidate area according to the target magnification ratio to obtain the locally magnified image. By adopting the above technical solution, the automatic determination of the target magnification ratio can be realized, avoiding the situation of low color recognition efficiency caused by manual access. At the same time, the above technical solution can flexibly determine the target magnification ratio according to the candidate magnification ratios corresponding to various colors in the candidate area. Compared with mechanically magnifying the image corresponding to the candidate area according to a fixed magnification ratio, the obtained locally magnified image will not be too large or too small, improving the effectiveness of the obtained locally magnified image.

[0047] In an optional embodiment, after obtaining the locally magnified image, the locally magnified image can be further updated in response to a zoom operation on the locally magnified image.

[0048] Among them, the zoom operation can be achieved by touching and setting the zoom function button, or by performing a preset zoom action on the locally enlarged image with a touch object. For example, it can be achieved by pinching with two fingers. Pulling the distance between the two fingers realizes the zoom-in function; reducing the distance between the two fingers realizes the zoom-out function. Among them, the distance between the two fingers is associated with the zoom-in or zoom-out multiple.

[0049] S104. In response to the pixel point selection operation on the locally enlarged image, identify the target color of the selected pixel point and output the target color.

[0050] Among them, the pixel point selection operation on the locally enlarged image can be a click operation or a box selection operation, etc. The present disclosure does not make any limitation on the specific operation manner of the pixel point selection operation.

[0051] Exemplarily, to identify the target color of the selected pixel point, the color value of the selected pixel point can be determined based on a color recognition extractor; and according to the color category to which the color value belongs, it is used as the target color. Among them, the color value can be represented by an R (Red), G (Green), B (Blue) color value, or a hexadecimal color code, or it can also be an H (Hue), S (Saturation), L (Lightness) color value.

[0052] Exemplarily, the output of the target color can be implemented by means of text display and / or voice playback.

[0053] In an alternative embodiment, if the target color is output by means of text display, it can be displayed in any area outside the local enlarged display area corresponding to the locally enlarged image. For the convenience of viewing, usually a color result display area is preset outside the local enlarged display area, and text display is performed in this color result display area.

[0054] In another alternative embodiment, if the target color is output by means of text display, it can also be displayed in the locally enlarged display area corresponding to the locally enlarged image in a color system different from the target color. For the convenience of searching, it can also be displayed in a color system different from the category colors included in the candidate area. It should be noted that in order to avoid discomfort caused by excessive color display to the operator, text display is usually performed in the default color, such as black or white, and only when the default color is not easily distinguishable from the target color, other colors in a color system different from the target color will be used for text display.

[0055] Embodiments of the present disclosure display an image to be recognized; in response to an area selection operation on the image to be recognized, a candidate display area is determined according to the selected area; the image corresponding to the candidate area is magnified and displayed to obtain a locally magnified image; in response to a pixel selection operation on the locally magnified image, the target color of the selected pixel is recognized and the target color is output. By adopting the above technical solution, it is possible to provide color recognition assistance for people who cannot distinguish at least some colors, such as color-blind or color-weak people, so that such people can perform color recognition without relying on a color-blind correction device, reducing the hardware cost, and being able to adapt to different types of user groups with a wide adaptation range. At the same time, the present disclosure introduces a candidate area and magnifies the image corresponding to the candidate area to obtain a locally magnified image for pixel selection, which facilitates the operator to accurately select pixels and avoids the situation where the recognized target color does not match the actual color expected to be known due to deviation in pixel selection, improving the accuracy of the color recognition result.

[0056] Based on the above technical solutions, the present disclosure also provides an alternative embodiment. In this alternative embodiment, the determination process of the locally magnified image is optimized and improved. It should be noted that for parts not detailed in the embodiments of the present disclosure, reference may be made to the descriptions of the foregoing embodiments.

[0057] See Figure 2 A color recognition method shown in

[0058] S201. Display the image to be recognized.

[0059] S202. In response to an area selection operation on the image to be recognized, a candidate area is determined according to the selected area.

[0060] S203. Perform a magnification process on the image to be recognized to obtain a globally magnified image.

[0061] S204. Display the image corresponding to the candidate area in the globally magnified image to obtain a locally magnified image.

[0062] Exemplarily, the entire image to be recognized can be magnified according to a preset magnification ratio to obtain a globally magnified image; only the image corresponding to the candidate area in the globally magnified image is displayed. For the sake of explanation, the subsequent part of the area image will be referred to as the locally magnified image. Among them, the preset magnification ratio can be determined by a technician according to needs or empirical values, or set independently by the operator.

[0063] Since magnifying the image to be recognized according to a preset magnification ratio may result in an unsatisfactory magnification result of the displayed locally magnified image (for example, too large or too small), causing the operator to be unable to select the pixel points to be recognized or experiencing discomfort during viewing; or the operator needs to manually adjust the preset magnification ratio, reducing the color recognition efficiency. To avoid the above situations, in another alternative embodiment, the target magnification ratio can also be automatically determined, and then the corresponding area image of the candidate area is magnified according to the target magnification ratio.

[0064] Exemplarily, the target magnification ratio can be determined according to the candidate magnification ratios corresponding to various types of colors in the candidate area; the image to be recognized is magnified according to the target magnification ratio to obtain a globally magnified image; only the corresponding area image of the candidate area in the globally magnified image is displayed to obtain a locally magnified image.

[0065] Among them, corresponding candidate magnification ratios are preset for various types of colors, and the values of the candidate magnification ratios can be set by technicians according to needs or empirical values, or determined by the operator according to their own needs. It should be noted that the candidate magnification ratios corresponding to different types of colors can be the same or different, and the present disclosure does not make any limitations in this regard.

[0066] In a specific implementation manner, the maximum magnification ratio, the minimum magnification ratio, the average magnification ratio, the median magnification ratio, or one of the candidate magnification ratios can be randomly selected from the candidate magnification ratios corresponding to various types of colors in the candidate area as the target magnification ratio.

[0067] Limited by the size of the electronic device's own screen and the convenience of the operator holding the electronic device with one hand for operation, a local magnification display area is usually preset in the electronic device to display the locally magnified image, thereby restricting the size of the locally magnified image, avoiding the locally magnified image being too large, which causes inconvenience for the operator to operate the electronic device with one hand, and at the same time avoiding the locally magnified image being too small, resulting in the subsequent inability to select pixel points. To make the locally magnified image adapt to the size of the local magnification display area while automatically determining the target magnification ratio, in another specific implementation manner, the reference magnification ratio can also be determined according to the ratio of the candidate area to the local magnification display area; the target magnification ratio is selected from the candidate magnification ratios corresponding to various types of colors in the candidate area according to the reference magnification ratio.

[0068] Specifically, the ratio between the candidate region and the local enlarged display region can be used as a reference magnification ratio; from the candidate magnification ratios corresponding to the colors of various categories in the candidate region, the candidate magnification ratio with a smaller difference (for example, the smallest) from the reference magnification ratio is selected as the target magnification ratio. Of course, to avoid the situation where the locally enlarged image overflows the local enlarged display region or the local enlarged display region cannot display the locally enlarged image as a whole, the candidate magnification ratio with a smaller difference (for example, the smallest) from the reference magnification ratio can also be selected from the candidate magnification ratios whose values are smaller than the reference magnification ratio as the target magnification ratio.

[0069] It can be understood that the above optional embodiment refines the determination process of the global enlarged image into determining the target magnification ratio according to the candidate magnification ratios corresponding to the colors of various categories in the candidate region, and performing an enlargement process on the image to be recognized according to the target magnification ratio to obtain the global enlarged image. Adopting the above technical solution can realize the automatic determination of the target magnification ratio and avoid the situation of low color recognition efficiency caused by manual access. At the same time, the above technical solution can flexibly determine the target magnification ratio according to the candidate magnification ratios corresponding to the colors of various categories in the candidate region. Compared with enlarging the image to be recognized according to a fixed magnification ratio mechanically, the locally enlarged image in the obtained global enlarged image will not be too large or too small, improving the effectiveness of the obtained locally enlarged image.

[0070] In an optional embodiment, only the image corresponding to the candidate region in the global enlarged image is displayed in the local enlarged display region to obtain the local enlarged image, providing data support for subsequent pixel point selection. To flexibly select pixel points in adjacent regions, after obtaining the local enlarged image, the following operations can be additionally performed: in response to a moving operation on the global enlarged image, update the local enlarged image.

[0071] Among them, the moving operation on the global enlarged image can be realized by button control or dragging, etc., and the present disclosure does not make any limitation thereto.

[0072] Specifically, when receiving the moving operation of the operator on the global enlarged image, in the local enlarged display region corresponding to the local enlarged image, update the local enlarged image according to the moving direction and the moving length.

[0073] It can be understood that by adding a response to the moving operation, pixel points in adjacent regions of the candidate region can be flexibly selected, improving the convenience of color recognition of pixel points in adjacent regions.

[0074] S205. In response to a pixel point selection operation on the local enlarged image, identify the target color of the selected pixel point and output the target color.

[0075] In the embodiment of the present disclosure, the operation of determining a locally magnified image is refined into magnifying a to-be-recognized image to obtain a globally magnified image; presenting the image corresponding to the candidate region in the globally magnified image to obtain a locally magnified image. The above technical solution directly magnifies the globally magnified image, instead of separately magnifying the image corresponding to the candidate region, without the need to segment the image corresponding to the candidate region, making the magnification process more convenient, and also eliminating the need to allocate memory space for the image corresponding to the candidate region, reducing the occupation of memory resources. In addition, magnifying the to-be-recognized image as a whole to obtain a globally magnified image facilitates the selection of pixel points in the adjacent regions of the candidate region based on the globally magnified image. In the case of color recognition of at least two regions in the same to-be-recognized image, the color recognition efficiency can be improved, and at the same time, the computational amount of repeatedly performing candidate region determination and locally magnified region determination is reduced.

[0076] Based on the above technical solutions, the present disclosure also provides an optional embodiment. In this optional embodiment, the process of determining the candidate region is optimized and improved. It should be noted that for the parts not detailed in the embodiments of the present disclosure, reference may be made to the descriptions of the foregoing embodiments.

[0077] See Figure 3 for the color recognition method, including:

[0078] S301. Present the to-be-recognized image.

[0079] S302. In response to the region selection operation on the to-be-recognized image, determine the candidate region according to the color attribute of the selected region.

[0080] Among them, the color attribute is used to characterize the color distribution of the selected region. The color attribute may specifically include at least one of color category, color quantity, and color value difference between adjacent colors, etc.

[0081] In an optional embodiment, determining the candidate region according to the color attribute of the selected region may be: if the selected region includes a preset color, expand the selected region according to the expansion parameter corresponding to the preset color to obtain the candidate region. Among them, the expansion parameter may include at least one of expansion direction and expansion multiple, etc. Among them, the preset color and the expansion parameter corresponding to the preset color may be preset by those skilled in the art for the operator to select.

[0082] In another alternative embodiment, to determine a candidate region based on the color attribute of the selected region, it may be: identifying the color categories in the selected region; if the number of color categories in the selected region is greater than a preset quantity threshold, selecting a higher expansion multiple to expand the selected region; if the number of color categories in the selected region is not greater than the preset quantity threshold, selecting a lower expansion multiple to expand the selected region. Among them, the specific expansion multiple can be set by a technician according to needs or empirical values. Among them, the expansion direction can be set by a technician according to empirical values, or set by an operator according to actual requirements. For example, the expansion direction can be set to expand in all directions centered on the selected region.

[0083] It should be noted that the above alternative embodiment takes two different expansion multiples as examples to exemplarily illustrate the determination method of the candidate region. Of course, at least two preset quantity thresholds can also be set according to actual requirements, and at least three expansion multiples can be set. Accordingly, by adjacent preset quantity thresholds, corresponding threshold intervals are determined, and a corresponding relationship between different threshold intervals and expansion multiples is established in sequence; among them, the threshold interval with a higher numerical value of the interval elements corresponds to a higher numerical value of the expansion multiple; the threshold interval with a lower numerical value of the interval elements corresponds to a lower numerical value of the expansion multiple.

[0084] In yet another alternative embodiment, to determine a candidate region based on the color attribute of the selected region, it may be: identifying the color categories in the selected region; determining the candidate region according to the color categories, so that the candidate region includes pixel points corresponding to each color category. In a specific implementation, the areas of the regions corresponding to each color category in the candidate region are evenly distributed.

[0085] In still another alternative embodiment, to determine a candidate region based on the color attribute of the selected region, it may be: identifying the color categories in the selected region and determining the pixel boundaries of each category of color; determining the candidate region according to the pixel boundaries of each category of color. The advantage of the above technical solution is that it can dynamically determine the candidate region according to the distribution of the color categories in the selected region and the extension of pixel points, improving the adaptability of the candidate region to the image to be recognized and providing a guarantee for accurately selecting pixel points in the locally enlarged image.

[0086] Exemplarily, identifying the color category in the selected area may be: identifying the preset color categories included in the selected area, and determining the color category according to the identification result. Among them, the preset color categories can be determined by technicians according to empirical values. For example, they can be categories that are easily confused by special populations, such as blue, green, red, etc.; the preset color categories can also be divided according to different classification criteria. For example, they can be divided into seven colors: red, orange, yellow, green, cyan, blue, and purple according to the spectrum. Of course, the preset color categories can also be divided in other ways, and the present disclosure does not make any limitation thereto.

[0087] It can be understood that by introducing preset color categories to divide the color categories in the selected area, a qualitative description of the color situation included in the selected area can be made, providing data support for the determination of candidate areas and enriching the determination methods of color categories.

[0088] Exemplarily, identifying the color category in the selected area may be: taking the color value of the central pixel point of the selected area as the reference color value, and determining the color category according to the difference value between the color value of the non-central pixel point in the selected area and the reference color value.

[0089] Specifically, the geometric center of the selected area can be determined, and the pixel point located at the geometric center can be used as the central pixel point; the color value of the central pixel point can be used as the reference color value; the difference value between the color value of the non-central pixel point in the selected area and the reference color value can be determined; if the difference value is greater than the preset difference threshold, it is determined that the corresponding non-central pixel point has a different color from the central pixel point; otherwise, it is determined that the corresponding non-central pixel point has the same color as the central pixel point; the finally determined color difference situation can be decomposed to determine the color category.

[0090] Furthermore, the color category identifier can be determined according to the difference threshold interval to which the difference value belongs; among them, the difference threshold interval can be set by technicians according to needs or empirical values, or adjusted and determined according to the reference color value of the central pixel point. Specifically, if different difference values fall into different difference threshold intervals, it indicates that the color categories of the corresponding non-central pixel points are also different. Among them, the difference threshold intervals do not overlap.

[0091] It can be understood that by introducing the reference color value corresponding to the central pixel point, and determining the color category through the difference value between the color value of the non-central pixel point and the reference color value, a quantitative description of the color situation can be made from the perspective of the difference between the color values corresponding to the pixel points, providing data support for the determination of candidate areas and enriching the determination methods of color categories. It should be noted that by determining the color category in the above manner, only the different color categories need to be divided, and there is no need to specifically identify the color categories, reducing the data calculation amount.

[0092] Optionally, to determine the pixel boundaries of each color category, it can be: combining the pixel points corresponding to the same color category to obtain the color regions corresponding to each color category; using the boundaries of each color region as the pixel boundaries of the corresponding color category.

[0093] Alternatively, optionally, to determine the pixel boundaries of each color category, it can be: identifying the pixel points that are different from the surrounding color categories as boundary pixel points; combining the boundary pixel points of the same color category to obtain the pixel boundaries.

[0094] In an alternative embodiment, according to the pixel boundaries of each color category, to determine the candidate region, it can be: directly using the larger boundary (such as the maximum boundary) formed by superimposing the pixel boundaries as the candidate region boundary; using the region defined by the candidate region boundary as the candidate region; or, determining the circumscribed geometric figure of the region defined by the candidate region boundary and using the corresponding region of the circumscribed geometric figure as the candidate region. Among them, the circumscribed geometric figure can be a rectangle, a circle, etc., and the present disclosure does not make specific limitations thereon.

[0095] It can be understood that by using the above technical solution to determine the candidate region, the determination process is convenient and fast, and the amount of calculation is small.

[0096] In another alternative embodiment, according to the pixel boundaries of each color category, to determine the candidate region, it can be: using the regions defined by the pixel boundaries of each color category as reference regions; determining the candidate region according to the region areas of the regions defined by the pixel boundaries of different color categories and the reference regions.

[0097] Among them, the reference region is the largest region obtained by superimposing the regions defined by different color categories and is used as the basis for determining the candidate region. It should be noted that this reference region is the region defined by the maximum boundary formed by superimposing the pixel boundaries in the foregoing alternative embodiment.

[0098] Exemplarily, according to the region areas of the regions defined by the pixel boundaries of different color categories, to crop the reference region and determine the candidate region, it can be: determining the base area according to the region areas of the regions defined by the pixel boundaries of different color categories; cropping the reference region according to the base area to obtain the candidate region.

[0099] Optionally, the base area can be determined according to the region areas corresponding to each color category, such as using the smaller (such as the smallest) region area among the region areas, the determined average region area, the selected median region area, etc. as the base area. Correspondingly, the cropping parameter is determined according to the base area; among them, the cropping parameter can include the cropping length and / or the cropping width; according to the cropping parameter, the reference region is cropped according to the region boundary corresponding to the base area to obtain the candidate region including the region corresponding to the smaller region area.

[0100] In order to avoid the situation where the candidate area appears too small, optionally, when the reference area is cropped according to the area boundary corresponding to the basic area, the corresponding area can be expanded along the expansion direction of the corresponding area according to the area boundary corresponding to the basic area, thereby adjusting the area boundary; according to the adjusted area boundary, the reference area is cropped to obtain a candidate area including the area corresponding to the basic area.

[0101] In a specific implementation, the areas of regions corresponding to different color categories in the candidate area may be limited to be the same or similar, for example, the difference in the areas of regions corresponding to different color categories is less than a set threshold, so that the color categories in the candidate area tend to be uniform.

[0102] It can be understood that by introducing the area of the region defined by the pixel boundaries of different color categories and cropping the reference area, the situation in which the reference area is too large and the magnified display effect is avoided is avoided, thereby improving the rationality of the selected candidate area, thereby improving the rationality of the corresponding local enlarged image, facilitating the selection of pixel points from the local enlarged image, reducing the occurrence of misidentification of the corresponding color of the pixel points, and thus improving the accuracy of the color recognition results.

[0103] Exemplarily, determining a candidate area based on the area defined by the pixel boundaries of different color categories and a reference area can be as follows: determining a base area based on the area defined by the pixel boundaries of different color categories; determining a circumscribed geometric figure corresponding to the base area; and translating the circumscribed geometric figure along the distribution of the different color categories to obtain the candidate area. The circumscribed geometric figure can be a rectangle, a regular polygon, or the like, and the present disclosure does not impose any restrictions on the shape of the circumscribed geometric figure. In a specific implementation, the circumscribed combined figure can be selected based on the distribution of the different color categories.

[0104] This disclosed embodiment refines the candidate region determination process by using the area defined by the pixel boundaries of each color category as a reference area; the candidate region is then determined based on the area defined by the pixel boundaries of each color category and the reference area. This technical solution defines the candidate region determination method and, by incorporating the area of each color category and the reference area into the candidate region determination, improves the candidate region determination method and provides data support for determining a partially enlarged image.

[0105] S303: Enlarge and display the area image corresponding to the candidate area to obtain a local enlarged image.

[0106] S304 : In response to the pixel selection operation on the partially enlarged image, identify the target color of the selected pixel and output the target color.

[0107] The disclosed embodiments refine the candidate region determination process by refining it to determine the candidate region based on the color attributes of the selected region. Furthermore, dynamically determining the candidate region based on color attributes improves the compatibility of the determined candidate region with the image to be recognized, ensuring accurate pixel selection in the subsequent process. This helps avoid pixel color misidentification and ultimately improves the accuracy of color recognition results.

[0108] Based on the technical solutions of the above embodiments, the present disclosure also provides a preferred embodiment for implementing a color recognition method.

[0109] See also Figure 4A A color recognition method is shown, comprising:

[0110] S401: In response to a photo taking operation or a photo selection operation, an image to be identified is uploaded.

[0111] See also Figure 4B The image to be recognized is shown.

[0112] S402: In response to the area selection operation, determine the selected area.

[0113] The area selection operation may be a click operation.

[0114] S403, determining whether the color values of the center pixel and the non-center pixel in the selected area are similar; if so, executing S404A; otherwise, executing S404B.

[0115] S404A: Use the first expansion multiple to expand the selected area as the center to obtain the area to be displayed, and then continue to execute S405.

[0116] S404B: Use the second expansion multiple to expand the selected area as the center to obtain the area to be displayed. Then proceed to S405.

[0117] The second expansion multiple is greater than the first expansion multiple.

[0118] S405 , magnifying the image to be recognized to obtain a global magnified image, and displaying a local magnified image corresponding to the area to be displayed in the global magnified image.

[0119] See also Figure 4C and Figure 4D The selected area is the all-red area in the image to be identified, and the obtained local enlarged image of the area to be displayed is compared with the local enlarged image of the area to be displayed obtained when the selected area is the "red, black, and white" intersection area in the image to be identified. The latter corresponds to a larger expansion multiple of the area to be displayed, that is, the latter corresponds to more different color blocks.

[0120] S406. Update the locally magnified image in response to a transformation operation on the locally magnified image. The transformation operation includes at least one of a zoom operation, a move operation, and a restore operation.

[0121] Among them, the zoom operation can be a pinch operation, the move operation can be a drag operation, the restore operation can be a long press operation, etc. The present disclosure does not make any limitation on the specific operation methods of each operation, and only needs to ensure that each operation can be distinguished.

[0122] S407. Identify the target color of the selected pixel point in response to a pixel point selection operation on the locally magnified image.

[0123] S408. Display the target color in text and / or output the target color by voice.

[0124] Through the technology of the present disclosure, it is possible to assist special populations in color recognition without introducing hardware costs. In addition, the above technical solutions are convenient to operate, applicable to various populations, and have a wide adaptation range. At the same time, by displaying the locally magnified image, it is convenient to select pixel points, avoiding the occurrence of color misrecognition due to incorrect pixel point selection, and improving the accuracy of the color recognition result.

[0125] As an implementation of the above color recognition methods, the present disclosure also provides an optional embodiment of an execution device for implementing the color recognition method. Further refer to Figure 5 A color recognition device 500 shown in the figure, including: a to-be-recognized image display module 501, a candidate area determination module 502, a magnified display module 503, and a color recognition display module 504. Among them,

[0126] The to-be-recognized image display module 501 is configured to display the to-be-recognized image;

[0127] The candidate area determination module 502 is configured to determine a candidate area according to the selected area in response to an area selection operation on the to-be-recognized image;

[0128] The magnified display module 503 is configured to magnify and display the image of the area corresponding to the candidate area to obtain a locally magnified image;

[0129] The color recognition display module 504 is configured to identify the target color of the selected pixel point in response to a pixel point selection operation on the locally magnified image and output the target color.

[0130] In the embodiments of the present disclosure, an image to be recognized is displayed through an image to be recognized display module; in response to an area selection operation on the image to be recognized, a candidate display area is determined according to the selected area through a candidate area determination module; the corresponding area image of the candidate area is magnified and displayed through a magnification display module to obtain a locally magnified image; in response to a pixel point selection operation on the locally magnified image, a target color of the selected pixel point is recognized through a color recognition display module, and the target color is output. By adopting the above technical solution, it is possible to provide color recognition assistance for people who cannot distinguish at least some colors, such as color-blind or color-weak people, so that such people can perform color recognition without relying on color-blind correction devices, reducing the hardware cost, and being able to adapt to different types of user groups with a wide adaptation range. At the same time, the present disclosure introduces a candidate area and magnifies the corresponding area image of the candidate area to obtain a locally magnified image for pixel point selection, which facilitates the operator to accurately select pixel points and avoids the situation where the recognized target color does not match the actual color expected to be known due to deviation in pixel point selection, improving the accuracy of the color recognition result.

[0131] In an alternative embodiment, the candidate area determination module 502 includes:

[0132] A candidate area determination unit for determining the candidate area according to the color attribute of the selected area.

[0133] In an alternative embodiment, the candidate area determination unit includes:

[0134] A color category recognition subunit for recognizing the color categories in the selected area and determining the pixel boundaries of each category of color;

[0135] A candidate area determination subunit for determining the candidate area according to the pixel boundaries of each category of color.

[0136] In an alternative embodiment, the color category recognition subunit includes:

[0137] A first color category recognition slave unit for recognizing whether the selected area contains a preset color category and determining the color category according to the recognition result; or,

[0138] A second color category recognition slave unit for using the color value of the central pixel point of the selected area as a reference color value and determining the color category according to the difference value between the color values of the non-central pixel points in the selected area and the reference color value.

[0139] In an alternative embodiment, the candidate area determination subunit includes:

[0140] A reference area determination slave unit is used to use the area defined by the pixel boundaries of various categories of colors as the reference area;

[0141] A candidate area determination slave unit is used to determine the candidate area according to the area of the area defined by the pixel boundaries of different color categories and the reference area.

[0142] In an alternative embodiment, the candidate area determination slave unit includes:

[0143] A basic area determination sub-slave unit is used to determine the basic area according to the area of the area defined by the pixel boundaries of different color categories;

[0144] A reference area cropping sub-slave unit is used to crop the reference area according to the basic area to obtain the candidate area, so that the difference in the area of the corresponding areas of different color categories in the candidate area is less than a set threshold.

[0145] In an alternative embodiment, the magnification display module 503 includes:

[0146] A global magnification image obtaining unit is used to perform magnification processing on the image to be recognized to obtain a global magnification image;

[0147] A local magnification image display unit is used to display the image of the area corresponding to the candidate area in the global magnification image to obtain the local magnification image.

[0148] In an alternative embodiment, the global magnification image obtaining unit includes:

[0149] A target magnification ratio determination sub-unit is used to determine the target magnification ratio according to the candidate magnification ratios corresponding to various categories of colors in the candidate area;

[0150] A global magnification image obtaining sub-unit is used to perform magnification processing on the image to be recognized according to the target magnification ratio to obtain the global magnification image.

[0151] In an alternative embodiment, the magnification display module 503 includes:

[0152] A target magnification ratio determination sub-unit is used to determine the target magnification ratio according to the candidate magnification ratios corresponding to various categories of colors in the candidate area;

[0153] A local magnification image obtaining sub-unit is used to perform magnification processing on the image of the area corresponding to the candidate area according to the target magnification ratio to obtain the local magnification image.

[0154] In an alternative embodiment, the target magnification ratio determination sub-unit includes:

[0155] A reference magnification ratio determination slave unit is configured to determine a reference magnification ratio according to a ratio between the candidate region and the local magnification display region.

[0156] A target magnification ratio determination slave unit is configured to select the target magnification ratio from candidate magnification ratios corresponding to various categories of colors in the candidate region according to the reference magnification ratio.

[0157] The above color recognition device can execute the color recognition method provided in any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing each color recognition method.

[0158] In the technical solution of the present disclosure, the processing of collection, storage, use, processing, transmission, provision, and disclosure of the image to be recognized complies with the provisions of relevant laws and regulations and does not violate public order and good customs.

[0159] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0160] Figure 6 FIG. shows a schematic block diagram of an exemplary electronic device 600 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0161] As Figure 6 shown, the device 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0162] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as a keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as a disk, optical disc, etc.; and communication unit 609, such as a network card, modem, wireless communication transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0163] Computing unit 601 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of computing unit 601 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Computing unit 601 executes the various methods and processes described above, such as the color recognition method. For example, in some embodiments, the color recognition method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by computing unit 601, one or more steps of the color recognition method described above can be executed. Alternatively, in other embodiments, computing unit 601 can be configured to execute the color recognition method in any other suitable manner (e.g., by means of firmware).

[0164] The various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip systems (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0165] The program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0166] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0167] In order to provide interaction with a user, the systems and techniques described herein may be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0168] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.

[0169] A computer system can include a client and a server. The client and the server are generally far from each other and usually interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services. The server can also be a server of a distributed system, or a server combined with blockchain.

[0170] Artificial intelligence is a discipline that studies how to make a computer simulate certain thinking processes and intelligent behaviors of humans (such as learning, reasoning, thinking, planning, etc.), and it has both hardware-level technologies and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include several major directions such as computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, and knowledge graph technology.

[0171] Cloud computing refers to a technical system in which elastic and scalable shared physical or virtual resource pools are accessed through a network. The resources can include servers, operating systems, networks, software, applications, and storage devices, etc., and the resources can be deployed and managed in a on-demand and self-service manner. Through cloud computing technology, efficient and powerful data processing capabilities can be provided for the application and model training of technologies such as artificial intelligence and blockchain.

[0172] It should be understood that various forms of processes shown above can be used, steps can be reordered, added, or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitations are imposed herein.

[0173] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present disclosure shall be included within the protection scope of the present disclosure.

Claims

1. A color recognition method, comprising: Displaying an image to be recognized; In response to an area selection operation on the image to be recognized, determining a candidate area according to the color attribute of the selected area, wherein the color attribute is used to characterize the color distribution of the selected area, and the candidate area is used to characterize the area associated with the operator's intention; Enlarging and displaying the image corresponding to the candidate area to obtain a locally enlarged image; In response to a pixel point selection operation on the locally enlarged image, recognizing the target color of the selected pixel point and outputting the target color; Wherein, the determining of the candidate area according to the color attribute of the selected area includes: Recognizing the color categories in the selected area and determining the pixel boundaries of each color category; Taking the area defined by the pixel boundaries of each color category as a reference area, where the reference area is the largest area obtained by superimposing the areas defined by different color categories; Determining a base area according to the area of the area defined by the pixel boundaries of different color categories; According to the area boundary corresponding to the base area, expanding the corresponding area along the corresponding area expansion direction to adjust the area boundary, and cropping the reference area according to the adjusted area boundary to obtain a candidate area including the area corresponding to the base area; Wherein, the enlarging and displaying the image corresponding to the candidate area to obtain a locally enlarged image includes: Determining a reference magnification ratio according to the candidate area and the ratio of the pre-set locally enlarged display area; Selecting, from the candidate magnification ratios corresponding to each color category in the candidate area, a candidate magnification ratio whose value is less than the reference magnification ratio and whose difference from the reference magnification ratio is the smallest as the target magnification ratio; Performing magnification processing on the image corresponding to the candidate area according to the target magnification ratio to obtain the locally enlarged image.

2. The method according to claim 1, wherein, The recognizing of the color categories in the selected area includes: Recognizing whether the selected area contains a preset color category and determining the color category according to the recognition result; or, Taking the color value of the central pixel point of the selected area as a reference color value and determining the color category according to the difference value between the color value of the non-central pixel point in the selected area and the reference color value.

3. The method according to any one of claims 1-2, wherein The enlarging and displaying the image corresponding to the candidate area to obtain a locally enlarged image includes: Performing magnification processing on the image to be recognized to obtain a globally enlarged image; Displaying the image corresponding to the candidate area in the globally enlarged image to obtain the locally enlarged image.

4. The method according to claim 3, wherein, The performing of magnification processing on the image to be recognized to obtain a globally enlarged image includes: Determining a target magnification ratio according to the candidate magnification ratios corresponding to each color category in the candidate area; Performing magnification processing on the image to be recognized according to the target magnification ratio to obtain the globally enlarged image.

5. A color recognition device, comprising: An image to be recognized display module for displaying an image to be recognized; A candidate area determination module for determining a candidate area according to the selected area in response to an area selection operation on the image to be recognized; Magnification display module, configured to magnify and display the image corresponding to the candidate area to obtain a locally magnified image; Color recognition display module, configured to recognize the target color of the selected pixel points in response to the pixel point selection operation on the locally magnified image, and output the target color; Wherein, the candidate area determination module includes: Candidate area determination unit, configured to determine the candidate area according to the color attribute of the selected area, wherein the color attribute is used to characterize the color distribution of the selected area, and the candidate area is used to characterize the area associated with the operator's intention; Wherein, the candidate area determination unit includes: Color category recognition sub-unit, configured to recognize the color categories in the selected area and determine the pixel boundaries of each category of color; Candidate area determination sub-unit, configured to determine the candidate area according to the pixel boundaries of each category of color; Wherein, the candidate area determination sub-unit includes: Reference area determination slave unit, configured to use the area defined by the pixel boundaries of each category of color as the reference area, and the reference area is the largest area obtained by superimposing the areas defined by different color categories; Basic area determination slave unit, configured to determine the basic area according to the area of the area defined by the pixel boundaries of different color categories; Reference area cropping slave unit, configured to expand the corresponding area along the corresponding area extension direction according to the area boundary corresponding to the basic area, so as to adjust the area boundary, and crop the reference area according to the adjusted area boundary to obtain a candidate area including the area corresponding to the basic area; Wherein, the magnification display module includes: Reference magnification ratio determination slave unit, configured to determine the reference magnification ratio according to the ratio between the candidate area and the pre-set locally magnified display area; Target magnification ratio determination slave unit, configured to select, from the candidate magnification ratios corresponding to each category of color in the candidate area, the candidate magnification ratio with a value less than the reference magnification ratio and the smallest difference from the reference magnification ratio as the target magnification ratio; Locally magnified image obtaining sub-unit, configured to magnify the image corresponding to the candidate area according to the target magnification ratio to obtain the locally magnified image.

6. The device according to claim 5, wherein, The color category recognition sub-unit includes: First color category recognition slave unit, configured to recognize whether the selected area contains a preset color category and determine the color category according to the recognition result; or, Second color category recognition slave unit, configured to use the color value of the central pixel point of the selected area as the reference color value, and determine the color category according to the difference value between the color values of the non-central pixel points in the selected area and the reference color value.

7. The device according to any one of claims 5-6, wherein, The magnification display module includes: Global magnified image obtaining unit, configured to magnify the image to be recognized to obtain a global magnified image; Locally magnified image display unit, configured to display the image corresponding to the candidate area in the global magnified image to obtain the locally magnified image.

8. The apparatus according to claim 7, wherein, The global magnified image obtaining unit includes: A target magnification ratio determination subunit, configured to determine a target magnification ratio according to the candidate magnification ratios corresponding to various types of colors in the candidate region; A global magnified image obtaining subunit, configured to perform a magnification process on the image to be recognized according to the target magnification ratio to obtain the global magnified image.

9. An electronic device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the color recognition method according to any one of claims 1-4.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause a computer to execute the color recognition method according to any one of claims 1-4.

11. A computer program product, comprising computer programs / instructions, and when the computer programs / instructions are executed by a processor, the steps of the color recognition method according to claim 1 are implemented.

Citation Information

Patent Citations

  • Color recognition method

    CN101334835A

  • Method and device for identifying signal light

    CN103345766A

  • Method and device for recognizing text areas in image

    CN107784301A

  • Image display method and electronic equipment

    CN111026316A