Image grayscale processing method, device, equipment and storage medium

By selecting multiple grayscale processing algorithms during the image recognition process and adjusting them according to the recognition results, the feature loss problem caused by a single algorithm during the image recognition process is solved, and the recognition accuracy and camera calibration accuracy are improved.

CN115187549BActive Publication Date: 2025-08-29GUANGZHOU XIAOPENG CONNECTIVITY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210815026.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-11
Publication Date
2025-08-29
Estimated Expiration
2042-07-11

AI Technical Summary

Technical Problem

In the prior art, due to the single grayscale processing algorithm in the image recognition process, image features are lost in different shooting environments, which affects the recognition accuracy. Especially in scenes such as camera calibration and obstacle detection, environmental changes lead to inaccurate recognition results.

Method used

During the image recognition process, multiple grayscale processing algorithms are selected to adjust the algorithm based on the recognition results to ensure that the recognition results meet preset conditions, or the optimal algorithm is selected to improve the accuracy, including adaptive adjustments to scenes such as camera calibration and obstacle detection.

Benefits of technology

Through multiple algorithm adjustments, image features are avoided, image recognition accuracy is improved, and camera calibration and obstacle detection are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115187549B_ABST
    Figure CN115187549B_ABST
Patent Text Reader

Abstract

The present application provides an image grayscale processing method, apparatus, device and storage medium, the method comprising: acquiring a target image; determining a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image; extracting image features from the processed image, and performing image recognition based on the image features; and determining a second grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image when the recognition result does not meet the preset conditions. The present application replaces the grayscale processing algorithm and performs re-recognition when the recognition result does not meet the preset conditions, so that the grayscale processing algorithm used for grayscale processing of the target image is no longer single, but can be adjusted accordingly based on the recognition result of the target image, thereby avoiding the problem of image feature loss caused by using a single grayscale processing algorithm, thereby improving the accuracy of image recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image grayscale processing method, apparatus, device and storage medium. Background Art

[0002] Image recognition technology often involves grayscale processing. Grayscale processing converts color images into grayscale images using a grayscale processing algorithm. Image features can be extracted from grayscale images and used to identify target objects. The choice of grayscale processing algorithm affects the effectiveness of feature extraction and, in turn, image recognition accuracy.

[0003] Currently, the commonly used grayscale processing algorithm is a weighted average algorithm that is close to human vision. When the shooting environment of the image to be recognized, such as the location, light, weather, etc., changes, if a unified grayscale processing algorithm is still used for grayscale processing, some image features will be lost, thereby affecting the recognition accuracy. Summary of the Invention

[0004] To overcome the problems existing in the related art, the present application provides an image grayscale processing method, device, equipment and storage medium.

[0005] According to a first aspect of an embodiment of the present application, a method for image grayscale processing is provided, the method comprising:

[0006] Acquire the target image;

[0007] Determining a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image;

[0008] extracting image features from the processed image and performing image recognition based on the image features;

[0009] When the recognition result does not meet the preset condition, a second grayscale processing algorithm is determined from at least two preset grayscale processing algorithms to perform grayscale processing on the target image.

[0010] According to a second aspect of an embodiment of the present application, a camera calibration method is provided, the method comprising:

[0011] Acquiring a calibration image of the camera, wherein the calibration image has a target point;

[0012] Performing grayscale processing on the calibration image based on the method described in the first aspect;

[0013] Obtain target recognition results that meet preset conditions;

[0014] The camera configuration parameters are determined based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

[0015] According to a third aspect of an embodiment of the present application, a camera calibration method is provided, the method comprising: acquiring a calibration image of the camera, the calibration image having a target point;

[0016] Performing grayscale processing on the calibration image based on the method described in the first aspect;

[0017] When the recognition results corresponding to each grayscale processing algorithm do not meet the preset conditions, the recognition result with the highest proportion of the number of identified target points is used as the target recognition result;

[0018] The camera configuration parameters are determined based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

[0019] According to a fourth aspect of an embodiment of the present application, there is provided an image grayscale processing device, comprising:

[0020] A first acquisition module is used to acquire a target image;

[0021] A first determining module is configured to determine a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image;

[0022] A feature extraction module, configured to extract image features from the processed image and perform image recognition based on the image features;

[0023] The second determining module is used to determine a second grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image when the recognition result does not meet the preset conditions.

[0024] According to a fifth aspect of an embodiment of the present application, a camera calibration device is provided, including:

[0025] A first acquisition module is used to acquire a calibration image of the camera, wherein the calibration image has a target point;

[0026] A first processing module, configured to perform grayscale processing on the calibration image based on the method described in the first aspect;

[0027] The second acquisition module is used to obtain target recognition results that meet preset conditions;

[0028] The third determination module is used to determine the camera configuration parameters based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

[0029] According to a sixth aspect of an embodiment of the present application, a camera calibration device is provided, including:

[0030] A second acquisition module is used to acquire a calibration image of the camera, wherein the calibration image has a target point;

[0031] A second processing module, configured to perform grayscale processing on the calibration image based on the method described in the first aspect;

[0032] a fourth determination module, configured to, when the recognition results corresponding to each grayscale processing algorithm do not meet the preset conditions, use the recognition result with the highest proportion of the number of identified target points as the target recognition result;

[0033] A fifth determination module is used to determine the camera configuration parameters based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

[0034] According to the seventh aspect of the embodiments of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the first, second, or third aspects is implemented.

[0035] According to an eighth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is used to instruct related hardware to complete any of the methods described in the first, second or third aspects above.

[0036] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:

[0037] During the image recognition process, the present application replaces the grayscale processing algorithm and re-recognizes when the recognition result does not meet the preset conditions, so that the grayscale processing algorithm used for grayscale processing of the target image is no longer single, but can make corresponding adjustments based on the recognition result of the target image, thereby avoiding the problem of image feature loss caused by using a single grayscale processing algorithm, and thus improving the accuracy of image recognition.

[0038] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] Figure 1A This is a flowchart of an image grayscale processing method according to an exemplary embodiment of the present application.

[0041] Figure 1B This is a schematic diagram of a calibration image used for camera calibration shown in this application.

[0042] Figure 1C This is a flowchart of a camera calibration method according to an exemplary embodiment of the present application.

[0043] Figure 1D This is another calibration image schematic diagram for camera calibration shown in this application.

[0044] Figure 1E This is a flowchart of a camera calibration method according to another exemplary embodiment of the present application.

[0045] Figure 2A This is a block diagram of an image grayscale processing device according to an exemplary embodiment of the present application.

[0046] Figure 2B This is a block diagram of a camera calibration device according to an exemplary embodiment of the present application.

[0047] Figure 2C This is a block diagram of a camera calibration device according to an exemplary embodiment of the present application.

[0048] Figure 3 This is a hardware structure diagram of an electronic device in which an image grayscale processing device is located according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0049] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0050] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0051] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0052] Image recognition technology is widely used in various scenarios, such as face detection and recognition, obstacle detection in autonomous driving scenarios, and camera calibration. Image recognition often involves grayscale processing of images. Grayscale processing preserves features such as the overall and local distribution of chromaticity and brightness levels, reducing the computational complexity of subsequent image processing. Furthermore, the grayscale image serves as the basis for further image recognition. The choice of grayscale processing algorithm can affect feature extraction and, consequently, image recognition accuracy.

[0053] It is not difficult to understand that the shooting environment when performing image recognition in different scenarios is not static. For example, the weather, light, time, location, etc. when collecting the image to be recognized, these factors will cause the same target object to present different characteristics in different shooting environments. In order to eliminate the impact of the shooting environment on the recognition accuracy, the processing method of the image to be recognized should be adjusted. However, the current image recognition technology ignores the impact of the grayscale processing algorithm on the recognition accuracy. For images collected under different shooting environments, a unified grayscale processing algorithm (close to the weighted average algorithm of human vision) is used, and it is not adjusted according to the shooting environment. Inappropriate grayscale processing methods may cause the grayscale value difference between the feature points of the target object and other feature points in the image to be small, so that the target object cannot be distinguished in subsequent image processing, reducing the recognition accuracy.

[0054] Taking the calibration of on-board cameras as an example, the calibration image is usually a black and white checkerboard, and calibration is completed by identifying the intersections of the black and white squares on the checkerboard. When replacing a camera, the camera is usually calibrated at a 4S store that provides after-sales service. Since the calibration environment of each store is inconsistent, using the same grayscale processing method to process the calibration image may cause the grayscale values ​​of the black and white squares in the calibration image to be close and indistinguishable, thereby affecting the recognition accuracy. For example, when detecting obstacles around the vehicle on a cloudy day, due to the weak light on a cloudy day, the color and brightness of the obstacles and the road surface may be similar in the collected image to be identified. If the grayscale processing method used in a sunny scene is used, it may be impossible to distinguish between the obstacles and the road surface, resulting in missed detection of obstacles.

[0055] In order to overcome the problems existing in the related art, the present application proposes an image grayscale processing method, which first selects one from at least two grayscale processing algorithms to process and identify the target image, and then replaces the grayscale processing algorithm to re-identify when the recognition result does not meet the preset conditions. The grayscale processing algorithm used for grayscale processing of the target image is no longer single, but can be adjusted accordingly based on the recognition result of the target image, thereby avoiding the problem of image feature loss caused by the use of a single grayscale processing algorithm and improving the accuracy of image recognition. The image grayscale processing method proposed in the present application is applicable to various scenarios where image recognition is required. The embodiments of the present application are described in detail below.

[0056] like Figure 1A As shown, Figure 1A This is a flowchart of an image grayscale processing method according to an exemplary embodiment of the present application, comprising the following steps:

[0057] Step 102, acquiring a target image;

[0058] The target image can be collected in real time by the camera, for example, by photographing a calibration plate to obtain a calibration image during camera calibration, or by photographing the vehicle's surroundings while the vehicle is moving; it can also be a non-real-time collection image obtained from an existing database.

[0059] Step 104, determining a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image;

[0060] The grayscale processing of an image is the process of converting a color image into a grayscale image through a grayscale processing algorithm. The grayscale value of each pixel is calculated based on the values ​​of the three components R, G, and B of each pixel. The grayscale processing algorithm provides a formula for calculating the grayscale value. For example, the commonly used weighted average grayscale processing algorithm that is close to human vision sets different weights for the three components R, G, and B based on the sensitivity of the human eye to different colors and sums them to determine the grayscale value. The calculation formula is expressed as: Gray = R*0.299+G*0.587+B*0.114. In addition, common grayscale processing algorithms also include floating-point grayscale processing algorithms, integer grayscale processing algorithms, and single-channel grayscale processing algorithms. Among them, the single-channel grayscale processing algorithm takes the value of any one of the components R, G, and B as the grayscale value. Taking R, G, or B components are three different algorithms. In the embodiment of the present application, the grayscale processing method used to grayscale the image can be any of the above-mentioned grayscale processing algorithms.

[0061] Step 106: extracting image features from the processed image and performing image recognition based on the image features;

[0062] To extract image features, the grayscale image can be binarized. By setting an appropriate threshold, the grayscale values ​​of pixels above the threshold are adjusted to 255, and the grayscale values ​​of pixels below the threshold are adjusted to 0, thereby reflecting the overall or local characteristics of the image. Subsequently, based on the characteristics of the target to be identified, an appropriate algorithm is selected to extract image features from the binarized image. For example, a corner detection algorithm can be used to extract the intersection of lines in the image, or a spot detection algorithm can be used to extract a certain area in the image.

[0063] Step 108 : If the recognition result does not meet the preset condition, determine a second grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image.

[0064] The recognition results and preset conditions can be set by the user based on the specific application scenario of image recognition. Taking the camera calibration scenario as an example, the target image is a black and white checkerboard calibration image (such as Figure 1B As shown), the target to be identified is the target point 110 therein (the intersection of the black square and the white square), and the recognition result is generally the pixel coordinate of the identified target point 110. Based on the recognition result, the number of identified target points 110 can be determined. The pixel coordinates of the target point are used to determine the configuration parameters of the camera. The more target points are identified, the higher the accuracy of the determined configuration parameters. In consideration of the accuracy of the configuration parameters, the preset conditions can be set based on the number of identified target points, for example, the number of identified target points meets the preset threshold, or the ratio of the number of identified target points to the total number of target points in the calibration image meets the preset threshold. The preset threshold can be set based on demand. Taking into account factors such as light or camera dirtiness, some target points in a certain area of ​​the target image may not be detected. The value of the preset threshold can be appropriately lowered.

[0065] For example, in a face detection scenario, the target image could be a group photo, with image features representing key facial features. The recognition result could be an image with faces labeled or the number of detected faces. The preset condition could be that the ratio of the number of detected faces to the total number of faces in the target image meets a preset threshold. This ratio can reflect the accuracy of face detection.

[0066] It should be noted that the above two scenarios are only examples and are not limitations of the embodiments of the method of this application.

[0067] If the recognition result meets the preset conditions, no other grayscale processing algorithms will be used to grayscale the target image. The grayscale processing algorithm corresponding to the recognition result will be used as the target grayscale processing algorithm, and the recognition result will be used as the target recognition result. In this case, it can be guaranteed that the recognition result meets the requirements, thereby ensuring the recognition accuracy.

[0068] If the recognition results corresponding to each preset grayscale processing algorithm do not meet the preset conditions, the various recognition results can be compared and the best recognition result can be determined. The grayscale processing algorithm corresponding to the best recognition result is used as the target grayscale processing algorithm, and the best recognition result is used as the target recognition result. For example, in a camera calibration scenario, the grayscale processing algorithm corresponding to the recognition result with the highest proportion of identified target points can be used as the target grayscale processing algorithm. In this case, even if the obtained recognition result cannot meet the requirements, a recognition result with a relatively high recognition accuracy can be obtained through comparison, which also has the effect of improving the recognition accuracy.

[0069] In view of the application of the aforementioned image grayscale processing method of the present application to the scene of camera calibration, the present application also proposes a camera calibration method, such as Figure 1C As shown, the following steps are included:

[0070] Step 112: Acquire a calibration image of the camera, wherein the calibration image has a target point;

[0071] Commonly used calibration images except Figure 1B In addition to the black and white checkerboard shown, it also includes Figure 1D The black and white dot image shown above has the center of the black dot as the target point. The camera calibration environment is not fixed. For example, the calibration of the vehicle camera can be done at the car factory or at a 4S dealership.

[0072] Step 114, determining a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the calibration image, extracting image features from the processed image, and performing image recognition based on the image features;

[0073] Step 116, if the recognition result does not meet the preset condition, determine a second grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the calibration image;

[0074] The preset condition may be that the ratio of the number of identified target points to the total number of target points in the calibration image meets a preset threshold. The specific implementation process of grayscale processing of the calibration image can be found in the above description of the embodiment of the image grayscale processing method, which will not be repeated here.

[0075] Step 118, obtaining a target recognition result that meets preset conditions;

[0076] Step 120 : Determine camera configuration parameters based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

[0077] Target recognition results are typically the pixel coordinates of the identified target point. Camera configuration parameters include the camera's intrinsic and extrinsic parameters. Intrinsic parameters characterize the transformation between the camera coordinate system and the pixel coordinate system, while extrinsic parameters characterize the transformation between the camera coordinate system and the world coordinate system. By determining the camera's configuration parameters, a transformation matrix from three-dimensional space to a two-dimensional imaging plane can be obtained. This transformation matrix can then be used to determine the distance between objects in the captured image and the camera. For vehicle-mounted cameras, this matrix can be used to determine the distance between the vehicle and its surroundings.

[0078] Since the grayscale processing method used for the calibration image during camera calibration is no longer single, but takes into account the shooting environment of the calibration image, it can make corresponding adjustments based on the recognition results of the calibration image. This allows the most suitable grayscale processing algorithm to be selected when calibrating the camera in different environments to ensure the accuracy of target point recognition. On this basis, the accuracy of the calibration results (camera configuration parameters) is also guaranteed.

[0079] In addition, considering that there is a situation where the recognition results obtained after processing by each preset grayscale processing algorithm do not meet the preset conditions, this application also proposes a camera calibration method, such as Figure 1E As shown, the following steps are included:

[0080] Step 122: Acquire a calibration image of the camera, wherein the calibration image has a target point;

[0081] Step 124, determining a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the calibration image, extracting image features from the processed image, and performing image recognition based on the image features;

[0082] Step 126 , if the recognition result does not meet the preset condition, determining a second grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the calibration image;

[0083] The recognition result is generally the pixel coordinates of the recognized target points. The preset condition may be that the ratio of the number of recognized target points to the total number of target points in the calibration image meets a preset threshold.

[0084] Step 128: If the recognition results corresponding to each grayscale processing algorithm do not meet the preset conditions, the recognition result with the highest proportion of the number of recognized target points is used as the target recognition result;

[0085] Step 130 : determining camera configuration parameters based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

[0086] The functions and specific implementation processes of each step are described in the corresponding steps of the embodiment of the aforementioned camera calibration method, which will not be repeated here. The application objects of the camera calibration method proposed in this application include but are not limited to vehicle-mounted cameras or drone cameras.

[0087] Corresponding to the embodiment of the above method, the present application also provides an image grayscale processing device. Figure 2A As shown, Figure 2A FIG. 2 is a block diagram of an image grayscale processing device 200 according to an exemplary embodiment of the present application, wherein the device includes:

[0088] A first acquisition module 201 is used to acquire a target image;

[0089] A first determining module 202 is configured to determine a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image;

[0090] A feature extraction module 203 is used to extract image features from the processed image and perform image recognition based on the image features;

[0091] The second determining module 204 is configured to determine a second grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image when the recognition result does not meet the preset condition.

[0092] This application also provides a camera calibration device, Figure 2B 2 is a block diagram of a camera calibration device 210 according to an exemplary embodiment of the present application, the device comprising:

[0093] The first acquisition module 211 is used to acquire a calibration image of the camera, where the calibration image has a target point;

[0094] A first processing module 212 is configured to perform grayscale processing on the calibration image based on the aforementioned image grayscale processing method;

[0095] The second acquisition module 213 is used to obtain a target recognition result that meets a preset condition;

[0096] The third determination module 214 is configured to determine camera configuration parameters based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

[0097] Figure 2C 2 is a block diagram of another camera calibration device 220 according to another exemplary embodiment of the present application, the device comprising:

[0098] The second acquisition module 221 is used to acquire a calibration image of the camera, where the calibration image has a target point;

[0099] The second processing module 222 is used to perform grayscale processing on the calibration image based on the aforementioned image grayscale processing method;

[0100] The fourth determination module 223 is configured to, when the recognition results corresponding to each grayscale processing algorithm do not meet the preset conditions, use the recognition result with the highest proportion of the number of recognized target points as the target recognition result;

[0101] The fifth determination module 224 is configured to determine camera configuration parameters based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

[0102] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0103] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present application scheme. Those of ordinary skill in the art can understand and implement it without paying any creative work.

[0104] The embodiments of the image grayscale processing device and camera calibration device in this application document can be installed on an electronic device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 3 FIG. 1 is a hardware structure diagram of an electronic device 300 in which the image grayscale processing device is located in an embodiment of the present application. Figure 3 In addition to the processor 310, memory 330, network interface 320, and non-volatile memory 340 shown, the electronic device in which the device 331 is located in the embodiment may also include other hardware, generally depending on the actual function of the electronic device, which will not be described in detail. The hardware structure of the electronic device in which the camera calibration device is located is similar to that of the electronic device 300.

[0105] Accordingly, the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any of the aforementioned method embodiments is implemented. The present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is used to instruct related hardware to implement the method described in any of the aforementioned method embodiments.

[0106] The foregoing description describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0107] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention claimed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not claimed herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present application are indicated by the claims.

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

[0109] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for image grayscale processing, characterized in that: include: Acquire the target image; Determining a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image; extracting image features from the processed image and performing image recognition based on the image features; When the recognition result does not meet the preset condition, a second grayscale processing algorithm is determined from at least two preset grayscale processing algorithms to perform grayscale processing on the target image.

2. The method according to claim 1, characterized in that The grayscale processing algorithm includes one of the following: a floating-point grayscale processing algorithm, an integer grayscale processing algorithm, a weighted average grayscale processing algorithm, or a single-channel grayscale processing algorithm.

3. The method according to claim 1, characterized in that The target image is a calibration image of a camera, and the image features are used to characterize target points in the calibration image.

4. The method according to claim 3, characterized in that The recognition result is the pixel coordinates of the recognized target point.

5. The method according to claim 4, characterized in that The preset condition is that the ratio of the number of the identified target points to the total number of target points in the calibration image meets a preset threshold.

6. The method according to claim 5, characterized in that The method further comprises: If the recognition results corresponding to each grayscale processing algorithm do not meet the preset conditions, the grayscale processing algorithm corresponding to the recognition result with the highest proportion of the number of identified target points is used as the target grayscale processing algorithm.

7. A camera calibration method, characterized in that: include: Acquiring a calibration image of the camera, wherein the calibration image has a target point; Performing grayscale processing on the calibration image based on the method of claim 1; Obtain target recognition results that meet preset conditions; The camera configuration parameters are determined based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

8. The method according to claim 7, characterized in that The preset condition is that the ratio of the number of the identified target points to the total number of target points in the calibration image meets a preset threshold.

9. A camera calibration method, characterized in that: include: Acquiring a calibration image of the camera, wherein the calibration image has a target point; Performing grayscale processing on the calibration image based on the method of claim 1; In the case that the recognition results corresponding to each grayscale processing algorithm do not meet the preset conditions, the recognition result with the highest ratio of the number of the recognized target points to the total number of target points in the calibration image is taken as the target recognition result; The camera configuration parameters are determined based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

10. The method according to claim 9, characterized in that The preset condition is that the ratio of the number of the identified target points to the total number of target points in the calibration image meets a preset threshold.

11. An image grayscale processing device, characterized in that: include: A first acquisition module is used to acquire a target image; A first determining module is configured to determine a first grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image; A feature extraction module, configured to extract image features from the processed image and perform image recognition based on the image features; The second determining module is used to determine a second grayscale processing algorithm from at least two preset grayscale processing algorithms to perform grayscale processing on the target image when the recognition result does not meet the preset conditions.

12. A camera calibration device, characterized in that: include: A first acquisition module is used to acquire a calibration image of the camera, wherein the calibration image has a target point; a first processing module, configured to perform grayscale processing on the calibration image based on the method according to claim 1; The second acquisition module is used to obtain target recognition results that meet preset conditions; The third determination module is used to determine the camera configuration parameters based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

13. A camera calibration device, characterized in that: include: A second acquisition module is used to acquire a calibration image of the camera, wherein the calibration image has a target point; a second processing module, configured to perform grayscale processing on the calibration image based on the method according to claim 1; a fourth determination module, configured to, when the recognition results corresponding to each grayscale processing algorithm do not meet the preset conditions, take the recognition result with the highest ratio of the number of the recognized target points to the total number of target points in the calibration image as the target recognition result; A fifth determination module is used to determine the camera configuration parameters based on the target recognition result and the three-dimensional coordinates of the target point in the world coordinate system.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 10 is implemented.

15. A computer-readable storage medium storing a computer program, wherein the computer program is used to instruct related hardware to perform the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Watermark embedding method and terminal

    CN108198123A

  • Lane line recognition method and device

    CN111046741A