An image processing method, an image recognition method, and related apparatus
By using the collaborative processing of the camera and the terminal, and by employing parallax matching and feature comparison techniques, the computational load for image type recognition is reduced, the recognition efficiency is improved, and the problems of high computational load and low efficiency in existing technologies are solved.
Patent Information
- Application Number
- CN202111405835.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-11-24
AI Technical Summary
Existing image type recognition methods involve large computational loads and low efficiency, failing to meet the need for rapid recognition.
Before transmitting image data, the camera processes the target type image and the reference image through parallax matching to generate labeled image data; after receiving the data, the terminal identifies the image type by comparing the consistency of feature information.
It effectively reduces the computational load of image type recognition and improves recognition efficiency.
Smart Images

Figure CN114170432B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision, and more particularly to an image processing method, an image recognition method, and related apparatus. Background Technology
[0002] With the continuous development of science and technology, infrared cameras are being used more and more widely in the field of computer vision. In practical applications, infrared cameras can acquire two types of images: structured light images and grayscale images. Then, the infrared camera transmits the acquired images to the terminal application platform for image processing.
[0003] Currently, terminal application platforms need to adaptively adopt corresponding image processing algorithms for different types of images. Therefore, before image processing, the terminal application platform needs to identify the type of the received image. In related technologies, the image type is usually identified by calculating multiple images and then comparing multiple calculation results. This method has a large amount of computation, which seriously consumes processor and memory resources, and the image type recognition efficiency is low, which cannot meet the needs of rapid recognition in practical applications. Summary of the Invention
[0004] This application provides an image processing method, an image recognition method, and a related apparatus, which can at least solve the problems of large computational load and low efficiency of image type recognition methods used in related technologies.
[0005] The first aspect of this application provides an image processing method applied to a camera, comprising:
[0006] Acquire image data collected by an image acquisition sensor; wherein the image data includes the following types of images: structured light images and / or grayscale images;
[0007] When the image data includes a target type image, a reference image corresponding to the target type image is obtained;
[0008] The target type image in the image data is subjected to disparity matching processing with the reference image to obtain labeled image data; wherein, the target image region of the labeled image data has labeling information, and the labeling information is used by the terminal to identify the image type;
[0009] The image data to be sent is sent to the terminal.
[0010] A second aspect of this application provides an image recognition method applied to a terminal, comprising:
[0011] Receive image data sent by a camera; wherein the image data includes the following types of images: structured light images and / or grayscale images, and the target pixel regions of the target type images have marking information;
[0012] Obtain the feature information of the target pixel region of the image data;
[0013] A consistency comparison is performed on the feature information based on the labeled information;
[0014] The type of the current image data is identified based on the comparison results.
[0015] A third aspect of this application provides an image processing apparatus applied to a camera, comprising:
[0016] The first acquisition module is used to acquire image data acquired by the image acquisition sensor; wherein, the image data includes the following types of images: structured light images and / or grayscale images;
[0017] The second acquisition module is used to acquire a reference image corresponding to the target type image when the image data includes a target type image;
[0018] The processing module is used to perform disparity matching processing on the target type image and the reference image in the image data to obtain labeled image data; wherein, the target image region of the labeled image data has labeling information, and the labeling information is used by the terminal to identify the image type;
[0019] The sending module is used to send the image data to be sent to the terminal.
[0020] A fourth aspect of this application provides an image recognition device applied to a terminal, comprising:
[0021] A receiving module is used to receive image data sent by a camera; wherein the image data includes the following types of images: structured light images and / or grayscale images, and the target pixel regions of target-type images have marking information;
[0022] The third acquisition module is used to acquire feature information of the target pixel region of the image data;
[0023] The comparison module is used to perform a consistency comparison of the feature information based on the tag information;
[0024] The identification module is used to identify the type of the current image data based on the comparison results.
[0025] A fifth aspect of this application provides an electronic device, including a memory and a processor, wherein the processor is configured to execute a first computer program or a second computer program stored in the memory. When the processor executes the first computer program, it implements the steps of the image processing method provided in the first aspect of this application. When the processor executes the second computer program, it implements the steps of the image recognition method provided in the second aspect of this application.
[0026] The sixth aspect of this application provides a computer-readable storage medium storing a first computer program or a second computer program thereon. When the first computer program is executed by a processor, it implements the steps of the image processing method provided in the first aspect of this application. When the second computer program is executed by a processor, it implements the steps of the image recognition method provided in the second aspect of this application.
[0027] As can be seen from the above, according to the image processing method, image recognition method, and related apparatus provided in this application, before image data transmission, the camera performs disparity matching between the target type image acquired by the image acquisition sensor and a reference image of the same image type to obtain image data with labeled target pixel regions. After receiving the image data, the terminal acquires the feature information of the target pixel regions of the image data, then performs a consistency comparison with the labeling information of the labeled image data, and finally identifies the type of the currently received image data based on the comparison result. Through the implementation of this application, image type identification is achieved by using image labeling and feature comparison, effectively reducing the computational load of image type identification and improving the efficiency of image type identification. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of the basic flow of the image processing method provided in the first embodiment of this application;
[0029] Figure 2 This is a schematic diagram illustrating the marking of the first row of pixels in an image, as provided in the first embodiment of this application.
[0030] Figure 3 A parallax matching schematic diagram provided for the first embodiment of this application;
[0031] Figure 4 This is a schematic diagram of the basic flow of the image recognition method provided in the first embodiment of this application;
[0032] Figure 5 A detailed flowchart illustrating the image interaction method provided in the second embodiment of this application;
[0033] Figure 6 This is a schematic diagram of the program modules of the image processing apparatus provided in the third embodiment of this application;
[0034] Figure 7 This is a schematic diagram of the program modules of the image recognition device provided in the third embodiment of this application;
[0035] Figure 8 This is a schematic diagram of the structure of an electronic device provided in the fourth embodiment of this application. Detailed Implementation
[0036] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0037] Currently, after a camera acquires image data, it typically needs to transmit the image data to a terminal for image processing. Taking an infrared camera as an example, during image data transmission between the infrared camera and the terminal, structured light images (i.e., depth images) and grayscale images (i.e., infrared images) are usually transmitted alternately to the receiving end. Generally, if the terminal receives a structured light image in the current frame, the next frame will be a grayscale image. In practical applications, when structured light images and grayscale images are used for image processing (e.g., face recognition), the two image types should correspond to different algorithms. For example, grayscale images should be placed in a grayscale-based image processing algorithm, and structured light images should be placed in a structured light-based image processing algorithm. If an image is placed in an image processing algorithm that is incompatible with its image type, incorrect image processing results will be obtained. Therefore, the terminal needs to distinguish the type of the received image to ensure the accuracy of subsequent image processing.
[0038] To address the issues of high computational complexity and low efficiency in image type recognition methods employed in related technologies, the first embodiment of this application provides an image processing method applied to a camera. The camera includes an image acquisition sensor (IRSensor) and a camera chip. Preferably, the camera in this embodiment is an infrared camera. Figure 1 This is a basic flowchart of the image processing method provided in this embodiment. The image processing method includes the following steps:
[0039] Step 101: Acquire image data collected by the image acquisition sensor.
[0040] Specifically, the image data in this embodiment may include the following types of images: structured light images and / or grayscale images. In practical applications, the image acquisition sensor acquires the corresponding type of image by controlling the floodlight and structured light projection; that is, the image acquisition sensor is capable of sensing the type of image it acquires. It should be noted that this embodiment may use one image acquisition sensor to alternately acquire structured light images and grayscale images, or it may use multiple image acquisition sensors to acquire structured light images and grayscale images respectively. In addition, when a single image acquisition sensor performs alternating image acquisition, it is not limited to alternating polling acquisition; it may also be, for example, alternating acquisition of two frames of structured light images and one frame of grayscale image. This embodiment does not limit this to a single method.
[0041] Step 102: When the image data includes a target type image, obtain a reference image corresponding to the target type image.
[0042] Specifically, in practical applications, the target image type can be one or more of the various image types acquired by the image sensor. In the preferred embodiment of this example, for the two types of images acquired by the infrared camera's image sensor, one type undergoes subsequent image processing to form differentiated features with the other type of image, thereby enabling the identification of the two types of images through only one image labeling operation.
[0043] Preferably, the target type image in this embodiment can be a structured light image. In practical applications, the structured light image can be a speckle image, which is an image with fixed characteristic speckles. Of course, in some other implementations, the target type image can also be a grayscale image, depending on the actual application requirements.
[0044] In some embodiments of this example, the step of obtaining a reference image corresponding to a target type image includes: obtaining a calibrated image of the same type as the target type image; erasing the target pixel region of the calibrated image to obtain a reference image in which the target pixel region is marked as null.
[0045] First, it should be noted that, preferably, the target pixel region in this embodiment is the first row of pixels in the image. In practical applications, the IRSens of an infrared camera is itself a photosensitive element, and the light is inconsistent, meaning there is noise during image acquisition. This noise does not exist in a specific case where all the first row of exposed pixels are 0. Based on this characteristic, this embodiment can use the first row of pixels in the image as the image feature region.
[0046] like Figure 2 The diagram shown is a schematic representation of marking the first row of pixels in an image according to this embodiment. Further, as... Figure 2 As shown in Figure a, the first row of pixels in this embodiment can be the complete first row of pixels, such as... Figure 2 As shown in Figure b, the first row of pixel region in this embodiment can be a portion of the complete first row of pixel region.
[0047] In another preferred implementation of this embodiment, the camera in this embodiment pre-stores a laboratory calibration image of the same type as the target image. Then, for this calibrated image, the target pixel region is erased to mark the pixel values of the target pixel region as null, i.e., resulting in consecutive pixels with a value of 0. Since the reference image has specific marking information after the marking process, the disparity image obtained by performing disparity matching between the reference image and the unmarked target image will also have corresponding marking information.
[0048] In some other embodiments of this example, the step of obtaining a reference image corresponding to the target type image includes: obtaining a calibrated image of the same type as the target type image; marking the maximum value in the target pixel region of the calibrated image to obtain the reference image.
[0049] Unlike the previous implementation method which performs pixel erasure processing, this implementation method stores an ultra-large value in the target pixel area of the calibrated image. This ultra-large value can be understood as a pixel value that is greater than a preset threshold.
[0050] It should also be understood that the reference image described above in this embodiment may also be marked in the laboratory stage and then stored in the camera in advance. In the actual image processing process, the camera can directly call the marked reference image from memory.
[0051] Step 103: Perform disparity matching processing on the target type image and the reference image in the image data to obtain labeled image data.
[0052] Specifically, in this embodiment, disparity matching can be understood as combining a target type image with its corresponding reference image through operations. The resultant of these operations is a disparity image, and the labeled image data includes this disparity image. In this embodiment, the target image region of the disparity image in the labeled image data has labeling information, which is used by the terminal for image type recognition.
[0053] In some embodiments of this example, the aforementioned implementation method in which the target pixel region of the reference image is marked with an ultra-large value is continued. Further, the step of performing disparity matching processing on the target type image and the reference image in the image data to obtain the marked image data includes: performing a subtraction operation on the target pixel region of the target type image in the image data and the target pixel region of the reference image to obtain the marked image data.
[0054] Accordingly, in this embodiment, the target pixel region of the parallax image corresponding to the target type image in the labeled image data is marked as null.
[0055] like Figure 3 The diagram shown is a parallax matching schematic provided in this embodiment. Specifically, the target pixel region in this embodiment is the first row of pixel regions. In the figure, a represents the marker information of the reference image, and b represents the marker information of the parallax image. The operation between the target type image and the reference image is a subtraction operation. Since the parallax image is obtained by subtracting the pixel value of the reference image from the pixel value of the target type image, when the target pixel region of the reference image contains a very large value, the target type image will be subtracted from the very large value to obtain a large negative value. The large negative value will be filtered to zero, thereby forming a marker with a continuous pixel value of 0 in the target pixel region of the parallax image.
[0056] It should also be noted that in other implementations of this embodiment, the reference image is a labeled image of the same type as the target image, that is, the reference image is not labeled. Accordingly, the specific implementations of performing disparity matching processing on the target type image and the reference image in the image data to obtain labeled image data include, but are not limited to, the following two:
[0057] Method 1: Mark the target image region of the target type image in the image data to obtain the marked target type image; perform disparity matching processing on the marked target type image and the reference image to obtain marked image data.
[0058] Method 2: Perform disparity matching processing on the target type image and the reference image in the image data to obtain a disparity image; perform marking processing on the target image region of the disparity image to obtain marked image data.
[0059] Specifically, in order to obtain labeled image data after disparity matching processing, this embodiment can also use a labeled target type image and an unlabeled reference image for disparity matching processing, and the resulting disparity image will also have specific labels. Alternatively, neither the target type image nor the reference image is labeled, but the target image region of the disparity image is directly labeled, which can also yield a disparity image with specific labels.
[0060] Step 104: Send the image data to be sent to the terminal.
[0061] Specifically, in practical applications, this embodiment marks one type of image among the two types acquired by the image acquisition sensor, while non-target type images are not marked. That is, during image transmission, the types of images to be sent include images requiring marking and unmarked images. After receiving the image from the camera, the terminal, based on the agreed-upon image marking type, determines the other type of image if no corresponding mark is subsequently identified. It should be noted that in a preferred embodiment of this invention, data transmission between the camera and the terminal can be implemented using a Mobile Industry Processor Interface (MIPI). It should be understood that although the image acquisition sensor can acquire images not only via a single camera and single frame, but also via two cameras simultaneously, in practical applications, all acquired images are output as single frames.
[0062] In some embodiments of this example, the image processing method further includes: obtaining the image data output order of the current image interaction process; and sending the image data output order to the terminal.
[0063] Specifically, in practical applications, the image interaction process between the camera and the terminal is a continuous process, during which hundreds or thousands of images may be continuously transmitted. The image transmission between the two is usually alternated according to a specific rule agreed upon in advance. A typical image data output sequence of the camera can be: ABABAB... that is, the two types of images are output alternately one after another. Another typical image data output sequence can be AABAABAAB... that is, the two types of images are output alternately in the manner of two frames of type A and one frame of type B.
[0064] Correspondingly, the first embodiment of the present invention also provides an image recognition method applied to a terminal, which is preferably a door lock. It should be understood that the aforementioned camera can be a component of the terminal or an external device independent of the terminal. The two can communicate through wired or wireless means, which is not limited here.
[0065] like Figure 4 This is a basic flowchart of the image recognition method provided in this embodiment. The image recognition method includes the following steps:
[0066] Step 401: Receive image data sent by the camera;
[0067] Step 402: Obtain feature information of the target pixel region of the image data;
[0068] Step 403: Perform consistency comparison of feature information based on label information;
[0069] Step 404: Identify the type of the current image data based on the comparison results.
[0070] In this embodiment, the image data includes the following image types: structured light images and / or grayscale images, where the target pixel region of the target type image has labeled information. After receiving the current frame image data, the terminal extracts features from the target pixel region of the current frame image data, and then compares the feature information with the labeled information of the disparity image obtained by the camera through disparity matching of the target type image. If the comparison is consistent, it indicates that the current frame image data is a target type image; if the comparison is inconsistent, it indicates that the current frame image is another type of image. Thus, after the camera performs labeling processing on one type of image, the terminal application platform can quickly and efficiently distinguish whether the received image is a structured light image or a grayscale image.
[0071] Furthermore, in some embodiments of this example, the image recognition method further includes: receiving the image data output order of the current image interaction process sent by the camera; and determining the image data receiving order based on the image data output order. Correspondingly, after the step of identifying the type of the current image data based on the comparison result, the method further includes: determining the type of image data to be received further based on the type of the current image data and the image data receiving order.
[0072] Specifically, image transmission between the camera and the terminal is usually carried out alternately according to a pre-agreed specific rule. If the terminal receives and identifies the current frame image, and then combines the current frame image category with the corresponding image data reception order, it can directly distinguish the type of the subsequently received image data. Taking the image data reception order as ABABAB... and the current frame image type as A as an example, the next frame image type is B. In this case, the camera does not need to mark each frame image in the subsequent image interaction process, and the terminal does not need to perform feature extraction and feature comparison processing on the currently received image, which can further improve the efficiency of image processing and recognition.
[0073] Based on the technical solution of the embodiments of this application described above, before image data transmission, the camera performs disparity matching on the target type image acquired by the image acquisition sensor and a reference image of the same image type to obtain image data with labeled target pixel regions. After receiving the image data, the terminal obtains the feature information of the target pixel regions of the image data, then performs a consistency comparison with the labeling information of the labeled image data, and finally identifies the type of the currently received image data based on the comparison result. By implementing the solution of this application, image type identification is achieved through image labeling and feature comparison, effectively reducing the computational load of image type identification and improving the efficiency of image type identification.
[0074] Figure 5 The method described in the second embodiment of this application is a refined image interaction method applied to an image interaction system including an infrared camera and a terminal. The image interaction method includes:
[0075] Step 501: The infrared camera acquires image data collected by the image acquisition sensor.
[0076] Specifically, the image data in this embodiment includes the following types of images: structured light images and / or grayscale images. It should be noted that in this embodiment, a single infrared camera may alternately acquire structured light images and grayscale images, or multiple infrared cameras may acquire structured light images and grayscale images respectively.
[0077] Step 502: When the image data includes a target type image, the infrared camera acquires a calibrated image of the same type as the target type image, and marks the maximum value in the target pixel area of the calibrated image to obtain a reference image.
[0078] In this embodiment, the target type image can be either a structured light image or a grayscale image.
[0079] Step 503: The infrared camera performs a subtraction operation between the target type image in the image data and the target pixel region of the reference image to obtain image data with target marking information.
[0080] Specifically, in the labeled image data from the infrared camera, the target pixel region of the parallax image corresponding to the target type image is marked as null. In this embodiment, the operation between the target type image and the reference image is a subtraction operation. Since the parallax image is obtained by subtracting the pixel value of the reference image from the pixel value of the target type image, if the target pixel region of the reference image contains an excessively large value, then subtracting the excessively large value from the target type image will result in a large negative value. The large negative value will be filtered to zero, thus the target pixel region of the resulting parallax image will be marked with consecutive pixel values of 0.
[0081] Step 504: The infrared camera sequentially sends the image data to be sent and the overall image data of the current image interaction process to the terminal.
[0082] Specifically, during the overall image interaction process, a typical image data output sequence of an infrared camera can be: ABABAB... that is, the two types of images are output alternately. Another typical image data output sequence can be AABAABAAB... that is, the images are output alternately in the manner of two frames of type A and one frame of type B.
[0083] Step 505: The terminal obtains the feature information of the target pixel region of the received current frame image data.
[0084] Specifically, the infrared camera transmits images to the terminal frame by frame. The target pixel area is usually the first row of pixels in the image. In addition, the feature information in this embodiment is the pixel value.
[0085] Step 506: The terminal performs a consistency comparison of the feature information based on the target label information.
[0086] Step 507: The terminal identifies the type of the current frame image data based on the comparison results.
[0087] In this embodiment, the terminal performs a consistency comparison between the feature information of the target pixel region and the labeling information of the disparity image obtained by the infrared camera performing disparity matching on the target type image. If the comparison is consistent, it indicates that the current frame image data is a target type image; if the comparison is inconsistent, it indicates that the current frame image is another type of image.
[0088] Step 508: The terminal determines the image data receiving order based on the image data output order of the infrared camera, and determines the type of image data to be received next based on the type of the current frame image data and the image data receiving order.
[0089] Specifically, the image interaction between the infrared camera and the terminal is usually transmitted alternately according to a pre-agreed specific rule. If the terminal can directly distinguish the type of the subsequently received image data by combining the current frame image category and the corresponding image data reception order after receiving the current frame image and recognizing the current frame image, then in the subsequent image interaction process, the infrared camera no longer needs to mark each frame image, and the terminal no longer needs to perform feature extraction and feature comparison processing on the currently received image, which can further improve the efficiency of image processing and recognition.
[0090] It should be understood that the sequence number of each step in this embodiment does not imply the order in which the steps are executed. The execution order of each step should be determined by its function and internal logic, and should not constitute a unique limitation on the implementation process of this application embodiment.
[0091] Figure 6 An image processing apparatus is provided in the third embodiment of this application. This image processing apparatus can be used to implement the image processing method in the foregoing embodiments, and mainly includes:
[0092] The first acquisition module 601 is used to acquire image data acquired by the image acquisition sensor; wherein, the image data includes the following types of images: structured light images and / or grayscale images;
[0093] The second acquisition module 602 is used to acquire a reference image corresponding to the target type image when the image data includes a target type image;
[0094] Processing module 603 is used to perform disparity matching processing on the target type image and the reference image in the image data to obtain labeled image data; wherein, the target image region of the labeled image data has labeling information, and the labeling information is used by the terminal to identify the image type;
[0095] The sending module 604 is used to send the image data to be sent to the terminal.
[0096] In some embodiments of this example, the target pixel region is the first row of pixels in the image.
[0097] In some embodiments of this example, the second acquisition module is specifically used to: acquire a calibrated image of the same type as the target image; and erase the target pixel region of the calibrated image to obtain a reference image in which the target pixel region is marked as null.
[0098] In other embodiments of this example, the second acquisition module is specifically used to: acquire a calibrated image of the same type as the target image; mark the maximum value in the target pixel region of the calibrated image to obtain a reference image.
[0099] Furthermore, in some embodiments of this example, the processing module is specifically used to: subtract the target pixel region of the target type image and the reference image in the image data to obtain labeled image data; wherein, the target pixel region of the parallax image corresponding to the target type image in the labeled image data is marked as null.
[0100] In some embodiments of this example, the reference image is a labeled image of the same type as the target image. Accordingly, the processing module is specifically used to: mark the target image region of the target image in the image data to obtain a marked target image; and perform disparity matching between the marked target image and the reference image to obtain marked image data. Alternatively, the processing module is specifically used to: perform disparity matching between the target image and the reference image in the image data to obtain a disparity image; and mark the target image region of the disparity image to obtain marked image data.
[0101] In some embodiments of this example, the first acquisition module is further configured to: acquire the image data output order of the current image interaction process. Correspondingly, the sending module is further configured to: send the image data output order to the terminal.
[0102] It should be noted that the image processing methods in the first embodiment can all be implemented based on the image processing device provided in this embodiment. Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the image processing device described in this embodiment can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0103] Figure 7 This application provides an image recognition device according to a third embodiment. The image recognition device can be used to implement the image recognition method described in the foregoing embodiments. The image recognition device mainly includes:
[0104] The receiving module 701 is used to receive image data sent by the camera; wherein the image data includes the following types of images: structured light images and / or grayscale images, and the target pixel regions of the target type images have marking information;
[0105] The third acquisition module 702 is used to acquire feature information of the target pixel region of the image data;
[0106] The comparison module 703 is used to perform consistency comparison of feature information based on the label information;
[0107] The recognition module 704 is used to identify the type of the current image data based on the comparison results.
[0108] In some embodiments of this example, the image processing apparatus further includes a determining module. The receiving module is further configured to: receive the image data output order of the current image interaction process sent by the camera; the determining module is configured to: determine the image data receiving order based on the image data output order; and determine the type of image data to be received further based on the type of the current image data and the image data receiving order.
[0109] It should be noted that the image recognition methods in the first embodiment can all be implemented based on the image recognition device provided in this embodiment. Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the image recognition device described in this embodiment can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0110] Based on the technical solution of the embodiments of this application described above, before image data transmission, the camera performs disparity matching on the target type image acquired by the image acquisition sensor and a reference image of the same image type to obtain image data with labeled target pixel regions. After receiving the image data, the terminal obtains the feature information of the target pixel regions of the image data, then performs a consistency comparison with the labeling information of the labeled image data, and finally identifies the type of the currently received image data based on the comparison result. By implementing the solution of this application, image type identification is achieved through image labeling and feature comparison, effectively reducing the computational load of image type identification and improving the efficiency of image type identification.
[0111] Figure 8 An electronic device is provided in the fourth embodiment of this application. This electronic device can be used to implement the image processing method described in the foregoing embodiments, and mainly includes:
[0112] The system includes a memory 801, a processor 802, and a computer program 803 stored on the memory 801 and executable on the processor 802. The memory 801 and the processor 802 are connected via communication. When the processor 802 executes the computer program 803, it implements the image processing method described in the foregoing embodiments. The number of processors can be one or more.
[0113] The memory 801 can be a high-speed random access memory (RAM) or a non-volatile memory, such as a disk storage device. The memory 801 is used to store executable program code, and the processor 802 is coupled to the memory 801.
[0114] Furthermore, embodiments of this application also provide a computer-readable storage medium, which may be disposed in the electronic device described in the above embodiments, and the computer-readable storage medium may be as described above. Figure 8 The memory in the illustrated embodiment.
[0115] The computer-readable storage medium stores a computer program that, when executed by a processor, implements the image processing method described in the foregoing embodiments. Furthermore, the computer-readable storage medium can also be a USB flash drive, a portable hard drive, a read-only memory (ROM), RAM, a magnetic disk, or an optical disk, or any other medium capable of storing program code.
[0116] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0117] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0118] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0119] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0120] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0121] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0122] The above is a description of the image processing method, image recognition method and related apparatus provided in this application. For those skilled in the art, based on the ideas of the embodiments of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An image processing method applied to a camera, characterized in that, include: Acquire image data collected by an image acquisition sensor; wherein the image data includes the following types of images: structured light images and / or grayscale images; When the image data includes a target type image, a reference image corresponding to the target type image is obtained; The target type image and the reference image in the image data are subjected to disparity matching processing to obtain labeled image data; wherein, the disparity matching processing includes performing operations to combine the target type image and the reference image, the labeled image data includes the disparity image obtained by the operation, and the target pixel region of the disparity image in the labeled image data has labeling information, the labeling information is used by the terminal to perform image type recognition; The image data to be sent is sent to the terminal; The step of performing disparity matching processing on the target type image and the reference image in the image data to obtain labeled image data includes: The target pixel region of the target type image in the image data is marked to obtain the marked target type image; The labeled target type image is subjected to disparity matching with the reference image to obtain labeled image data; Alternatively, disparity matching processing can be performed on the target type image and the reference image in the image data to obtain a disparity image; The target pixel region of the parallax image is marked to obtain marked image data.
2. The image processing method according to claim 1, characterized in that, The target pixel region is the pixel region of the first row of the image.
3. The image processing method according to claim 1, characterized in that, The step of obtaining a reference image corresponding to the target type image includes: Obtain a calibrated image of the same type as the target image; The target pixel region of the calibrated image is erased to obtain a reference image in which the target pixel region is marked as null.
4. The image processing method according to claim 1, characterized in that, The step of obtaining a reference image corresponding to the target type image includes: Obtain a calibrated image of the same type as the target image; Large values are marked in the target pixel region of the calibrated image to obtain a reference image.
5. The image processing method according to claim 4, characterized in that, The step of performing disparity matching processing on the target type image and the reference image in the image data to obtain labeled image data includes: The target pixel region of the target type image in the image data is subtracted from the target pixel region of the reference image to obtain labeled image data; wherein, the target pixel region of the parallax image corresponding to the target type image in the labeled image data is marked as null.
6. The image processing method according to claim 1, characterized in that, The reference image is a calibrated image of the same type as the target image.
7. The image processing method according to any one of claims 1 to 6, characterized in that, Also includes: Obtain the image data output order of the current image interaction process; The image data is output sequentially and sent to the terminal.
8. An image recognition method applied to a terminal, characterized in that, include: The system receives labeled image data sent by a camera; wherein the image data includes the following types of images: structured light images and / or grayscale images, and the labeled image data is a parallax image obtained by combining a target type image acquired by an image sensor with a corresponding reference image through calculation, and the target pixel region of the parallax image in the labeled image data has labeling information; Obtain the feature information of the target pixel region of the image data; A consistency comparison is performed on the feature information based on the labeled information; The type of the current image data is identified based on the comparison results; The methods for acquiring the labeled image data include: The target pixel region of the target type image in the image data is marked to obtain the marked target type image; The labeled target type image is subjected to disparity matching with the reference image to obtain labeled image data; Alternatively, disparity matching processing can be performed on the target type image and the reference image in the image data to obtain a disparity image; The target pixel region of the parallax image is marked to obtain marked image data.
9. The image recognition method according to claim 8, characterized in that, Also includes: The order in which image data from the current image interaction process is received and output; The image data receiving order is determined based on the image data output order. After the step of identifying the type of the current image data based on the comparison result, the method further includes: The type of image data to be received next is determined based on the type of the current image data and the order in which the image data is received.
10. An image processing apparatus applied to a camera, characterized in that, include: The first acquisition module is used to acquire image data acquired by the image acquisition sensor; wherein, the image data includes the following types of images: structured light images and / or grayscale images; The second acquisition module is used to acquire a reference image corresponding to the target type image when the image data includes a target type image; The processing module is used to perform disparity matching processing on the target type image and the reference image in the image data to obtain labeled image data; wherein, the disparity matching processing includes performing operations to combine the target type image and the reference image, the labeled image data includes the disparity image obtained by the operations, and the target pixel region of the disparity image in the labeled image data has labeling information, the labeling information is used by the terminal to perform image type recognition; The sending module is used to send the image data to be sent to the terminal; The step of performing disparity matching processing on the target type image and the reference image in the image data to obtain labeled image data includes: The target pixel region of the target type image in the image data is marked to obtain the marked target type image; The labeled target type image is subjected to disparity matching with the reference image to obtain labeled image data; Alternatively, disparity matching processing can be performed on the target type image and the reference image in the image data to obtain a disparity image; The target pixel region of the parallax image is marked to obtain marked image data.
11. An image recognition device, applied to a terminal, characterized in that, include: A receiving module is used to receive labeled image data sent by a camera; wherein the image data includes the following types of images: structured light images and / or grayscale images, and the labeled image data is a parallax image obtained by combining a target type image acquired by an image sensor with a corresponding reference image through calculation, wherein the target pixel region of the parallax image in the labeled image data has labeling information; The third acquisition module is used to acquire feature information of the target pixel region of the image data; The comparison module is used to perform a consistency comparison of the feature information based on the tag information; The identification module is used to identify the type of the current image data based on the comparison results; The methods for acquiring the labeled image data include: The target pixel region of the target type image in the image data is marked to obtain the marked target type image; The labeled target type image is subjected to disparity matching with the reference image to obtain labeled image data; Alternatively, disparity matching processing can be performed on the target type image and the reference image in the image data to obtain a disparity image; The target pixel region of the parallax image is marked to obtain marked image data.
12. An electronic device, characterized in that, Includes memory and processor, of which: The processor is used to execute a first computer program or a second computer program stored in the memory; When the processor executes the first computer program, it implements the steps of the method according to any one of claims 1 to 7; when the processor executes the second computer program, it implements the steps of the method according to claim 8 or 9.
13. A computer-readable storage medium having a first computer program or a second computer program stored thereon, characterized in that, When the first computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 7; when the second computer program is executed by the processor, it implements the steps of the method according to claim 8 or 9.
Citation Information
Patent Citations
Systems and methods for performing image type recognition
CN103536305A
Image colorization based on reference information
CN110648375A
Target identification method and device
CN111476729A