WO2023184740A1 - Image processing system and method, intelligent terminal, and computer readable storage medium - Google Patents

Image processing system and method, intelligent terminal, and computer readable storage medium Download PDF

Info

Publication number
WO2023184740A1
WO2023184740A1 PCT/CN2022/100631 CN2022100631W WO2023184740A1 WO 2023184740 A1 WO2023184740 A1 WO 2023184740A1 CN 2022100631 W CN2022100631 W CN 2022100631W WO 2023184740 A1 WO2023184740 A1 WO 2023184740A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
depth
image
dimensional
row
Prior art date
Application number
PCT/CN2022/100631
Other languages
French (fr)
Chinese (zh)
Inventor
王刚
余洪涛
谷涛
Original Assignee
奥比中光科技集团股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 奥比中光科技集团股份有限公司 filed Critical 奥比中光科技集团股份有限公司
Publication of WO2023184740A1 publication Critical patent/WO2023184740A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/204Image signal generators using stereoscopic image cameras
    • H04N13/207Image signal generators using stereoscopic image cameras using a single 2D image sensor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/271Image signal generators wherein the generated image signals comprise depth maps or disparity maps

Definitions

  • the present invention relates to the technical field of image information computing and processing, and in particular to an image processing system, a system, a method, an intelligent terminal and a computer-readable storage medium.
  • the existing image processing system When aligning two (or more) images, the existing image processing system needs to process all the data in the two images at one time, and cannot calculate and process the data in batches.
  • the problem with the existing technology is that a large amount of data needs to be processed simultaneously when performing image alignment processing, which is not conducive to improving processing efficiency and accuracy of image alignment.
  • the huge amount of calculation requires high-performance hardware devices for processing, which is not conducive to image alignment processing in scenarios where the hardware device performance is not high, that is, it affects the applicability of image alignment processing.
  • the main purpose of the present invention is to provide an image processing system, method, intelligent terminal and computer-readable storage medium, aiming to solve the problem that in the prior art, a large amount of data needs to be processed simultaneously during image alignment processing, which is not conducive to improving processing efficiency. , which is not conducive to image alignment processing in scenarios with low hardware device performance, and affects the applicability of image alignment processing.
  • a first aspect of the present invention provides an image processing system, including:
  • a depth camera configured to collect depth images of the target scene
  • a two-dimensional camera configured to collect two-dimensional images of the target scene
  • a memory configured to store the depth image, the two-dimensional image, the calibration information between the depth camera and the two-dimensional camera, and the depth measurement range of the depth camera;
  • a processor configured to determine the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range, and to extract at least one row of depth data in the depth image based on the row index range. and at least one corresponding row of two-dimensional data in the above-mentioned two-dimensional image are aligned to determine the two-dimensional data corresponding to the above-mentioned depth data.
  • the above-mentioned extraction of at least one row of depth data in the above-mentioned depth image and the corresponding at least one row of two-dimensional data in the above-mentioned two-dimensional image according to the above-mentioned row index range and performing alignment processing to determine the two-dimensional data corresponding to the above-mentioned depth data includes:
  • the depth image and the two-dimensional image are divided according to the memory size of the processor and the row index range and multiple groups of data to be processed are extracted, wherein each group of the data to be processed includes at least one row of depth data and corresponding multiple rows of two-dimensional data. dimensional data, and adjacent rows of depth data share part of the two-dimensional data.
  • the above-mentioned alignment process on the above-mentioned data to be processed determines the two-dimensional data corresponding to the above-mentioned depth data, including:
  • the above-mentioned group of data to be processed is transferred to the above-mentioned memory for alignment processing until each group of the above-mentioned data to be processed has completed the alignment processing;
  • the sum of the data amount of a group of memory storage data is not greater than the memory size of the above-mentioned processor, and a group of the above-mentioned memory storage data includes a group of the above-mentioned data to be processed and the processed data obtained by aligning the group of data to be processed. .
  • the above image processing system is also used for:
  • the overlapping data is data corresponding to the overlapping range of the row index in the i-1th group of data to be processed
  • the data to be transferred is data outside the overlapping range of the row index in the i-th group of data to be processed.
  • the calibration information stored in the memory includes: the internal parameters of the depth camera, the internal parameters of the two-dimensional camera, the rotation matrix between the depth camera and the two-dimensional camera, and the rotation matrix between the depth camera and the two-dimensional camera. translation matrix between.
  • the depth measurement range stored in the memory includes: the maximum detection value and the minimum detection value of the depth camera.
  • the step of determining the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range includes:
  • the above-mentioned internal parameters of the two-dimensional camera, the above-mentioned rotation matrix, the above-mentioned translation matrix, the above-mentioned maximum detection value and the above-mentioned minimum detection value respectively obtain the maximum row index and the minimum row index corresponding to each row of the above-mentioned depth image;
  • the row index range corresponding to a row to be aligned in the above-mentioned depth image is used to indicate the range of the target alignment row in the above-mentioned two-dimensional image.
  • the target alignment pixels in the above-mentioned two-dimensional image belong to the above-mentioned target alignment rows.
  • the above-mentioned target alignment pixels Corresponds to any pixel to be aligned in the above row to be aligned.
  • a second aspect of the present invention provides an image processing method, wherein the above-mentioned image processing method is applied to any of the above-mentioned image processing systems, and the above-mentioned method includes:
  • the processor determines the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range, and extracts at least one row of depth data in the depth image and the two depth data based on the row index range. At least one corresponding row of two-dimensional data in the three-dimensional image is aligned to determine the two-dimensional data corresponding to the depth data.
  • a third aspect of the present invention provides an intelligent terminal.
  • the intelligent terminal includes a memory, a processor, and an image processing program stored in the memory and executable on the processor.
  • the image processing program is executed by the processor, the above-mentioned steps are implemented. Image processing method steps.
  • a fourth aspect of the present invention provides a computer-readable storage medium.
  • An image processing program is stored on the computer-readable storage medium.
  • the image processing program is executed by a processor, the steps of the image processing method are implemented.
  • the image processing system includes: a depth camera configured to collect a depth image of the target scene; a two-dimensional camera configured to collect a two-dimensional image of the target scene; a memory configured to store the above-mentioned a depth image, a two-dimensional image, calibration information between the depth camera and the two-dimensional camera, and a depth measurement range of the depth camera; a processor configured to determine each of the depth images based on the calibration information and the depth measurement range.
  • the row index range corresponding to one row in the above-mentioned two-dimensional image and extracting at least one row of depth data in the above-mentioned depth image and at least one corresponding row of two-dimensional data in the above-mentioned two-dimensional image according to the above-mentioned row index range, performing alignment processing to determine the corresponding depth data two-dimensional data.
  • the image processing system in the present invention can obtain the depth image based on the calibration information and the depth measurement range.
  • Each row corresponds to the row index range in the two-dimensional image, so that the data to be processed is grouped according to the corresponding row index range, and a group of data to be processed is aligned each time.
  • the processor does not need to process all data at once, and the amount of data calculation each time is small, which is beneficial to improving processing efficiency.
  • data can be grouped reasonably according to the memory size of the processor, thereby rationally utilizing the computing power and storage capacity of the processor, which is beneficial to adapting to processors with different performance and improving the applicability of the image alignment process. This facilitates the operation process after image alignment (such as face recognition) and improves user experience.
  • Figure 1 is a schematic structural diagram of an image processing system provided by an embodiment of the present invention.
  • Figure 2 is a schematic diagram of the mapping relationship between a depth image and an RGB image provided by an embodiment of the present invention
  • Figure 3 is a schematic diagram of the mapping relationship between a depth image and an RGB image provided by an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of an image processing method provided by an embodiment of the present invention.
  • Figure 5 is a functional block diagram of the internal structure of an intelligent terminal provided by an embodiment of the present invention.
  • the term “if” may be interpreted as “when” or “once” or “in response to determining” or “in response to detecting” depending on the context.
  • the phrase “if determined” or “if [the described condition or event] is detected” may be interpreted, depending on the context, to mean “once determined” or “in response to a determination” or “once the [described condition or event] is detected” event]” or “in response to detection of [the described condition or event]”.
  • dimensional images such as RGB images, grayscale images, IR images, etc.
  • the depth image is aligned with the two-dimensional image, that is, the depth information in the depth image is mapped to the pixels of the corresponding two-dimensional image, which is convenient
  • Use depth information to assist in operations such as 3D recognition.
  • align the depth image with an RGB image obtained from a two-dimensional camera module for example, an RGB camera module
  • map the obtained depth information to the pixels of the color image i.e., D2C, Depth to Color
  • image alignment calculations in currently common 3D devices need to be calculated on an additional host or the CPU of a mobile terminal, and cannot be directly performed on the image processor (such as a digital signal processor) corresponding to the 3D device. processor). If the host is used, the usage scenarios of the 3D device are limited. If the CPU of the mobile terminal is used, the burden on the CPU will be increased and the performance of other tasks will be affected.
  • the D2C algorithm in the existing technology can usually only be calculated based on the data collected by a specific 3D camera module. Different 3D camera modules have individual differences and installation differences, making the existing D2C algorithm unable to adapt. Compute the data collected by different 3D camera modules.
  • the present invention provides an image processing system including: a depth camera configured to collect a depth image of a target scene; a two-dimensional camera configured to collect a two-dimensional image of the target scene ;
  • the memory is configured to store the above-mentioned depth image, the two-dimensional image, the calibration information between the above-mentioned depth camera and the above-mentioned two-dimensional camera, and the depth measurement range of the above-mentioned depth camera;
  • the processor is configured to store the above-mentioned calibration information and the above-mentioned depth
  • the measurement range determines the row index range corresponding to each row of the depth image in the two-dimensional image, and extracts at least one row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image based on the row index range.
  • An alignment process is performed to determine the two-dimensional data corresponding to the above depth data.
  • the image processing system in the present invention can obtain the depth image based on the calibration information and the depth measurement range.
  • Each row corresponds to the row index range in the two-dimensional image, so that the data to be processed is grouped according to the corresponding row index range, and a group of data to be processed is aligned each time.
  • the processor does not need to process all data at once, and the amount of data calculation each time is small, which is beneficial to improving processing efficiency.
  • data can be grouped reasonably according to the memory size of the processor, thereby rationally utilizing the computing power and storage capacity of the processor, which is beneficial to adapting to processors with different performance and improving the applicability of the image alignment process. This facilitates the operation process after image alignment (such as face recognition) and improves user experience.
  • an embodiment of the present invention provides an image processing system, including:
  • Depth camera 10 is configured to collect depth images of the target scene
  • the two-dimensional camera 20 is configured to collect two-dimensional images of the target scene
  • the memory 30 is configured to store the above-mentioned depth image, the two-dimensional image, the calibration information between the above-mentioned depth camera and the above-mentioned two-dimensional camera, and the depth measurement range of the above-mentioned depth camera;
  • the processor 40 is configured to determine the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range, and extract at least one row of depth in the depth image based on the row index range.
  • the data and at least one corresponding row of two-dimensional data in the above-mentioned two-dimensional image are aligned to determine the two-dimensional data corresponding to the above-mentioned depth data.
  • the depth image and the two-dimensional image are images that need to be aligned, and the target scene is the scene where the image is captured.
  • alignment processing of two images is taken as an example for explanation.
  • multiple images can be aligned based on the above image processing system, that is, there is more than one two-dimensional image.
  • a depth image can be After aligning with the first two-dimensional image, a first aligned image is obtained, and the second two-dimensional image is aligned with the first aligned image to obtain a second aligned image, thereby realizing alignment processing between the three images.
  • the depth information in the depth image can be mapped to the corresponding pixels of the two-dimensional image, which is beneficial to assisting the two-dimensional image in three-dimensional processing by combining the depth information.
  • Information recognition such as 3D face recognition
  • the depth image and the two-dimensional image are captured by different cameras.
  • the depth image is captured by the depth camera 10 and the two-dimensional image is captured by the two-dimensional camera 20 .
  • the two-dimensional image is an RGB image to be aligned, which is captured by an RGB camera.
  • image alignment processing is performed on the depth image to be aligned and the RGB image to be aligned, and the depth information is mapped to the pixels of the color image (RGB image to be aligned), thereby further performing image recognition based on the color image.
  • Obtaining information about the corresponding environment or the object being photographed is conducive to better utilization of depth information.
  • the calibration information includes the internal parameters of the depth camera 10, the internal parameters of the two-dimensional camera 20, the rotation matrix between the depth camera 10 and the two-dimensional camera 20, the translation matrix between the depth camera 10 and the two-dimensional camera 20, and the depth measurement range. Including the maximum detection value and minimum detection value of the depth camera 10 .
  • the depth image to be aligned and the RGB image to be aligned can be aligned based on the calibration information.
  • the possible corresponding line index range of each line in the depth image in the two-dimensional image can be determined, thereby facilitating line-by-line alignment of the depth image and the two-dimensional image, that is, realizing data alignment. Process in batches.
  • the row index range corresponding to a row in the depth image is the index range of rows in which each pixel point corresponding to the pixel point in the row may exist in the two-dimensional image.
  • the pixels corresponding to each pixel in the first row of the depth image may be distributed between the first and third rows of the two-dimensional image. Then the row index corresponding to the first row of the depth image ranges from rows 1 to 3. .
  • the depth measurement range can be determined based on the maximum working distance and the minimum working distance of the depth camera 10 .
  • the above-mentioned determination of the row index range corresponding to each row of the above-mentioned depth image in the above-mentioned two-dimensional image based on the above-mentioned calibration information and the above-mentioned depth measurement range includes: based on the internal parameters of the depth camera 10, the internal parameters of the two-dimensional camera 20, The rotation matrix, translation matrix, maximum detection value and minimum detection value respectively obtain the maximum row index and minimum row index corresponding to each row of the depth image; based on the maximum row index and minimum row index, the row index range corresponding to each row in the depth image is obtained.
  • the row index range corresponding to a row to be aligned in the depth image is used to indicate the range of the target alignment row (i.e., the row corresponding to the row to be aligned) in the two-dimensional image.
  • the target alignment pixel belongs to the target alignment row, and the target alignment pixel corresponds to any to-be-aligned pixel in the row to be aligned.
  • all pixels in the row are pixels to be aligned.
  • Each pixel to be aligned has a target alignment pixel in the two-dimensional image, and all targets corresponding to a row to be aligned are aligned.
  • the pixels in the two-dimensional image belong to the above row index range.
  • row 1 in the depth image has 640 pixels, and these 640 pixels have corresponding 640 target alignment pixels in the 2D image.
  • the row index range corresponding to the 640 target alignment pixels in the two-dimensional image (for example, rows 1 to 3) is used as the row index range of the row to be aligned.
  • the maximum row index corresponding to the row to be aligned is 3, and the minimum row index is 1.
  • the optical centers of depth cameras such as 3D camera modules
  • two-dimensional (such as RGB) cameras modules
  • D2C two-dimensional
  • the coordinate transformation relationship between the depth image pixel coordinate system and the RGB image pixel coordinate system is constructed, as shown in the following formula (1):
  • u rgb and v rgb respectively represent the abscissa and ordinate coordinates of the image in the RGB image pixel coordinate system
  • u ir and v ir respectively represent the abscissa and ordinate coordinates of the image in the depth image pixel coordinate system
  • R ir2rgb represents from The rotation matrix from the depth (IR) camera to the RGB camera
  • T ir2rgb represents the translation matrix from the depth camera to the RGB camera
  • K ir and K rgb represent the internal parameters of the depth camera and RGB camera respectively
  • Z rgb is the corresponding (u ir , v ir ) coordinate point in the depth image in the RGB image ( u rgb , v rgb ) the depth value of the coordinate position.
  • the coordinates of a pixel to be aligned in the depth image are (u ir , v ir ), and the coordinates of the target alignment pixel corresponding to the pixel to be aligned in the RGB image are (u rgb , v rgb ).
  • the D2C algorithm maps the depth value of the depth image to the corresponding pixels (target alignment pixels) on the RGB image, so that it can be turned into RGBD data (that is, data that combines RGB color and depth information). In the entire algorithm There is no need to consider the values of RGB pixels. In one application scenario, the RGB camera and the depth camera capture images separately. The pixel coordinates of the same object in the two images are different in the two images.
  • Z rgb is the depth of the (u ir , v ir ) coordinate point mapped to the depth of the (u rgb , v rgb ) point, that is is the depth value of the pixel on the aligned RGB image, that is, the processed data corresponding to the (u ir , v ir ) coordinate point after the alignment process (the processed data includes the RGB color of each point in the aligned image value and depth value).
  • each pixel point in the depth image is aligned with each pixel point in the two-dimensional image, and the corresponding depth information is mapped. Therefore (u ir , v ir ) is determined (determined according to the coordinates of the corresponding pixel points to be aligned), and the calibration information between the depth image and the two-dimensional image and the depth measurement range corresponding to the above-mentioned depth image are obtained in advance, so In the above formula (1), only u rgb , v rgb and Z rgb are unknown quantities that need to be calculated. In this embodiment, the pixels in the depth image are aligned row by row, so there is no need to consider the column index range corresponding to v rgb .
  • the pixels in the depth image can also be aligned column by column, and only the column index range corresponding to v rgb needs to be considered, without considering the row index range corresponding to u rgb .
  • the plan will not be described in detail here.
  • line-by-line processing is taken as an example.
  • the unknown quantity Z rgb in formula (1) can be moved to the left side of the equation, so that for a certain line to be aligned (row u ir ) in the depth image, According to the maximum and minimum values of depth, the maximum and minimum values corresponding to u rgb are respectively obtained as the maximum row index and minimum row index of the row to be aligned.
  • the resolution of a common depth image is 640*480, then the value range of u ir is 0 to 639 (counting from line 0), v The value range of ir is 0 to 479 (counting from column 0).
  • the maximum and minimum values of the depth value can be determined based on the working distance of the depth camera.
  • Figure 2 is a schematic diagram of the mapping relationship between a depth image and an RGB image provided by an embodiment of the present invention.
  • the corresponding minimum row index can be obtained according to the above formula (1), and vice versa.
  • the corresponding maximum row index can be obtained according to the above formula (1), so that the row index range in the two-dimensional image corresponding to the row to be aligned in the depth image can be obtained, and the data that needs to be transferred each time can be determined.
  • the corresponding value can be calculated in advance based on the working distance of the depth camera (that is, the detection distance range of the depth camera, determined according to the specific depth camera and application scene settings) and the camera calibration information.
  • Row index range and a corresponding index table can be established based on the minimum row index (color_y_min) and the maximum row index (color_y_max) corresponding to each row, so as to determine the row index range corresponding to each row in the depth image.
  • Figure 2 shows the corresponding mapping relationship between the depth image and the RGB image.
  • the aligned image can be considered to overlap with the RGB image, that is, Figure 2 can also be used as the depth image and the aligned image. The corresponding mapping relationship between the images.
  • an algorithm (or program, etc.) for calculating the row index range can be preset, and the inter-camera rotation matrix R ir2rgb , translation matrix T ir2rgb , depth camera internal parameter K ir and RGB camera internal parameter k rgb are input to the corresponding algorithm, at the same time, obtain the maximum detection value depth max and the minimum detection value depth min based on the working distance of the depth camera and input them into the above algorithm.
  • the maximum detection value and the minimum detection value can also be confirmed in advance by setting the depth camera and its application scenario.
  • the subject to be photographed is predetermined.
  • depth value analysis can also be performed on the depth image, and the specific maximum detection value and minimum detection value in the depth image that has been taken can be obtained and calculated to improve calculation accuracy and perform better data handling. Improve image alignment efficiency.
  • the maximum row index and the minimum row index corresponding to each row in the depth image are calculated sequentially, thereby obtaining the row index range corresponding to each row.
  • u ir is determined for a line to be aligned in the depth image. Traverse each value of v ir (for example, 0 to 639), and substitute depth max and depth min into the above formula (1) to calculate the line to be aligned.
  • 640 candidate minimum indexes and 640 candidate maximum indexes, and the minimum value among all candidate minimum indexes is used as the minimum row index corresponding to the row to be aligned, and the maximum value among all candidate maximum indexes is used as the corresponding minimum row index for the row to be aligned.
  • Maximum row index is used for a line to be aligned.
  • each row and its corresponding row index range can be further made into a lookup table to facilitate storage and search, and based on the above lookup table, you can quickly obtain which numbers a row in the depth image may correspond to in the two-dimensional image. OK, which is helpful for data grouping and handling.
  • the same depth max and depth min are used for calculation of each row to be aligned.
  • the above-mentioned depth measurement range may include the maximum detection value and the minimum detection value of each row in the depth image, so that the row is calculated and obtained based on the maximum detection value and the minimum detection value of each row. The corresponding maximum row index, minimum row index and row index range.
  • the processor 40 is an image processor, and specifically is an image processor used for image alignment processing.
  • the image processor may be a digital signal processor.
  • all data that require image alignment processing can be grouped (batch) processed, so corresponding image processing is not required.
  • the hardware performance of the processor is very high, so it can be processed directly based on the digital information processor in the depth camera (or 3D camera module) without using an additional host or mobile terminal. This not only improves the computing efficiency of the D2C algorithm, but also Reduce system resource consumption, reduce hardware power consumption, and improve applicability.
  • the calculation process of the image alignment process is based on a digital signal processor in this embodiment. In this way, the burden on the mobile terminal CPU can be reduced and the cost of the entire system can be reduced. power consumption.
  • extracting at least one row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image based on the row index range and performing alignment processing to determine the two-dimensional data corresponding to the depth data includes: The memory size and row index range of the processor 40 simultaneously extract multiple rows of depth data in the above-mentioned depth image and corresponding multiple rows of two-dimensional data in the two-dimensional image and form multiple groups of data to be processed; each group of data to be processed is processed separately. Alignment processing determines the two-dimensional data corresponding to each row of depth data.
  • the above D2C calculation process is calculated on the DSP. Neither the depth image nor the two-dimensional image is stored in the on-chip memory of the DSP, that is, the data that needs to be accessed. If it is not in the DSP's on-chip memory, the corresponding data needs to be moved to the DSP's on-chip memory. At the same time, the on-chip memory size of the DSP is limited and usually cannot accommodate all the data in the depth image and the two-dimensional image. Therefore, the data needs to be transported and calculated in batches. At the same time, it is necessary to ensure that in each batch of data transported, all rows to be aligned are included. The data in the corresponding target alignment row is also successfully moved. In this embodiment, data needs to be transferred from Synchronous Dynamic Random Access Memory (SDRAM) to the on-chip memory of the DSP.
  • SDRAM Synchronous Dynamic Random Access Memory
  • the user is required to determine how many rows of data are to be moved at a time, and the user is required to manually enter corresponding instructions to move data back and forth between the on-chip memory and the SDARM.
  • different inputs are required. instructions, so it is inconvenient to operate and is not conducive to improving image processing efficiency.
  • users are also required to manually calculate the amount of data moved each time, which makes it difficult to fully utilize the on-chip memory and easily leads to an increase in the number of data moves, which consumes computing time.
  • a row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image are extracted according to the row index range to form a set of data to be processed, and the set of data to be processed is transported to the processing
  • the processor 40 performs alignment processing on the set of data to be processed, determines the two-dimensional data corresponding to the depth data in the set of data to be processed, and then transfers the next set of processed data to the memory for alignment processing. Until each set of data to be processed is aligned.
  • the sum of the data amounts of a set of memory storage data is not greater than the memory size of the processor 40 , and a set of memory storage data includes a set of data to be processed and processed data obtained by aligning the set of data to be processed.
  • multiple sets of data to be processed can also be transported to the processor 40 at the same time for alignment processing. It should be noted that due to the limitation of the memory size of the processor 40, only a few lines to dozens of lines of data can be transferred to the on-chip memory for processing at a time. Therefore, the depth image and the two-dimensional image can be divided in advance according to actual needs. Determine the data to be processed that needs to be moved each time.
  • the number of rows corresponding to one row in the depth image in the two-dimensional image can be determined according to the predetermined row index range, thereby determining the amount of data that needs to be processed corresponding to one row in the depth image, so that the processing can be performed Grouping of data (for example, determining how many rows in a depth image are grouped together).
  • Grouping of data for example, determining how many rows in a depth image are grouped together.
  • the above image processing system can also be applied to image data of different image data (such as different resolutions) collected by different camera modules, and performs appropriate grouping and handling of different image data, so that the D2C algorithm can adapt to the differences between different modules. Difference, you can make full use of the hardware performance of DSP without too much manual intervention.
  • each group of the data to be processed includes at least one row of depth data and corresponding multiple rows of two-dimensional data, and adjacent rows of data to be processed share part of the two-dimensional data.
  • the shared part of two-dimensional data means that the two-dimensional data corresponding to the data to be processed in adjacent rows may have overlapping parts. The overlapping parts can be retained and reused during the alignment process, and there is no need to repeatedly transport them.
  • a set of images to be processed includes rows 1 and 2 in the depth image, where the row index corresponding to row 1 in the depth image ranges from rows 1 to 3 in the two-dimensional image, and row 2 in the depth image
  • the corresponding row index range is 2 to 5 rows of the two-dimensional image
  • the above-mentioned data to be processed includes all the data of rows 1 to 5 in the two-dimensional image.
  • the depth data of the first row and the depth of the second row are Data can share rows 2 to 3 of 2D data. In this way, it can be ensured that the data required for each image alignment process is transferred to the on-chip memory and avoids wasting the amount of data caused by repeated transfer.
  • a set of memory storage data includes a set of data to be processed and the data corresponding to the set of data to be processed.
  • Data processing It should be noted that not only the input data (a set of data to be processed) needs to be transported on the DSP, but also the output data (aligned image data, Aligned_Depth), that is, the processed data corresponding to the group of data to be processed, needs to be transported.
  • the two pieces of data used in the calculation need to be stored in the on-chip memory at the same time, and the on-chip memory size is fixed. Therefore, it is necessary to limit the sum of the data amount of a set of memory storage data to not be greater than the above-mentioned on-chip memory size.
  • each group of the above-mentioned data to be processed includes first data to be processed and second data to be processed.
  • the above-mentioned first data to be processed is the data corresponding to the row to be processed in the above-mentioned depth image
  • the above-mentioned second data to be processed is
  • the processed data is all data in the row index range corresponding to the row to be processed in the two-dimensional image
  • the row to be processed includes at least one row in the depth image.
  • At least one row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image can be extracted according to the row index range to form at least one set of data to be processed, which specifically includes: according to the memory size and row index of the processor 40
  • the scope divides the depth image and the two-dimensional image respectively and extracts multiple groups of data to be processed, wherein each group of data to be processed includes first data to be processed and second data to be processed, and the first data to be processed is the data to be processed in the depth image.
  • the data corresponding to the row is processed, and the second data to be processed is all data in the row index range in the two-dimensional image corresponding to the row to be processed, and the row to be processed includes at least one row in the depth image.
  • the data volume of the corresponding output data can be obtained according to the data volume of the input data, thereby limiting the data transferred each time.
  • the amount of data corresponding to one line of the depth image and the amount of data corresponding to one line of the RGB image can be preset. Since the output data obtained after alignment is data containing RGB image information and depth information, that is, the data type is certain, and one pixel in the depth image can correspond to one output pixel data, and the number of rows and data volume of the output data can be determined based on the input data to be processed. In this embodiment, it is only necessary to ensure that the sum of the size of the input data and the size of the output data does not exceed the size of the on-chip memory.
  • the internal parameters of the camera are different, so the row index range corresponding to each row in the acquired depth image is also different, so the number of rows of data to be processed that different camera modules can handle at one time is also different. For example, if the data generated by a camera module can transfer 8 lines at a time, then 480 lines of data will need to be calculated 60 times. The data generated by another camera module can be transferred 10 lines at a time, so 480 lines of data only need to be transferred 48 times. The smaller the number of transfers, the smaller the system overhead.
  • the performance of the DSP can be fully utilized, the data can be grouped reasonably, multiple groups of data to be processed can be obtained, and each group of data to be processed can be processed in turn, thereby rationally utilizing the memory and processing capabilities of the DSP. while improving the efficiency of image alignment processing.
  • the row index range calculated in this embodiment is a rough range calculated based on the maximum detection value and the minimum detection value, rather than an exact range calculated based on the specific depth value of each pixel in the depth image. Therefore, overlapping row index ranges may appear in several consecutive rows to be aligned (or there may not be overlapping row index ranges), that is, corresponding adjacent row depth data may share two-dimensional data within overlapping row index ranges. If the corresponding data in the overlapping row index range is moved repeatedly, time will be wasted. Therefore, in this embodiment, the above system is also used for:
  • the overlapping data is the data corresponding to the overlapping range of the row index in the i-1 group of data to be processed
  • the data to be transferred is the data outside the overlapping range of the row index in the i-th group of data to be processed.
  • Figure 3 is a schematic diagram of the mapping relationship between a depth image and an RGB image provided by an embodiment of the present invention.
  • a set of data to be processed in the depth image includes one line of data in the depth image and multiple lines of data in the RGB image.
  • the row index ranges corresponding to the i-1th row of data and the i-th row of data in the depth image overlap, and the corresponding overlapping data is the data between the dotted lines in the RGB image in Figure 3.
  • the overlapping data will be transferred to the on-chip memory, and when processing the i-th group of data to be processed, the overlapping data also needs to be used.
  • the overlapping data in the on-chip memory can be retained, or the overlapping data can be transported on the on-chip memory according to actual needs (the speed of internal transportation in the on-chip memory is much faster than that between SDRAM and on-chip memory) (transfer speed between data transfers).
  • the speed of internal transportation in the on-chip memory is much faster than that between SDRAM and on-chip memory
  • transfer speed between data transfers the speed between data transfers.
  • the above image processing process can also be performed in combination with Single Instruction Multiple Data (SIMD, Single Instruction Multiple Data) technology to further improve the speed of image data alignment processing.
  • SIMD Single Instruction Multiple Data
  • the image alignment processing is performed in batches on the digital signal processor.
  • the image alignment processing can also be performed in batches through the CPU, or the image alignment processing can be performed in batches using FPGA, digital chips, etc. Alignment processing, reasonable and full use of the image processor.
  • the prior information of the 3D camera module (including the row index range corresponding to each row in the depth image) is obtained, the data is grouped according to the prior information, multiple groups of data to be processed are obtained, and the data are transported and processed in sequence.
  • Process each set of data to be processed make full use of the performance of the digital signal processor and reduce the number of data transfers while ensuring that the data that needs to be stored each time does not exceed the on-chip memory of the digital signal processor, thereby reducing the power consumption of the hardware system.
  • This enables the 3D camera module to be suitable for various scenarios.
  • the above system can also adapt to different 3D camera modules. It can consider the differences in calibration parameters of different modules, configure according to specific calibration parameters, make full use of the hardware performance of DSP, and perform parallel processing of data based on DSP. .
  • overlapping data in the data that needs to be transferred is also considered to avoid repeated transfer of overlapping data, further reduce processing time, improve the efficiency of image alignment processing, and facilitate the operation process after image alignment (such as face recognition). ), which is conducive to improving the user experience.
  • an embodiment of the present invention also provides an image processing method.
  • the above method is applied to any of the above image processing systems.
  • the above method includes:
  • Step S100 collect the depth image of the target scene through the depth camera and store it in the memory
  • Step S200 collect the two-dimensional image of the target scene through the two-dimensional camera and store it in the memory
  • Step S300 obtain the calibration information between the depth camera and the two-dimensional camera pre-stored in the memory and the depth measurement range of the depth camera;
  • Step S400 The processor determines the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range, and extracts at least one row of depth data in the depth image based on the row index range. and at least one corresponding row of two-dimensional data in the above-mentioned two-dimensional image are aligned to determine the two-dimensional data corresponding to the above-mentioned depth data.
  • the depth image and the two-dimensional image are images that need to be aligned, and the target scene is the scene where the image is captured.
  • the alignment process of two images is taken as an example for explanation.
  • multiple images can be aligned based on the image processing method, that is, there is more than one two-dimensional image.
  • the depth image and The first aligned image is obtained after the first two-dimensional image is aligned
  • the second aligned image is obtained by aligning the second two-dimensional image with the first aligned image, thereby realizing alignment processing between the three images.
  • the depth information in the depth image can be mapped to the corresponding pixels of the two-dimensional image, which is beneficial to assisting the two-dimensional image in three-dimensional processing by combining the depth information.
  • Information recognition such as 3D face recognition
  • the depth image and the two-dimensional image are captured by different cameras.
  • the depth image is captured by the depth camera, and the two-dimensional image is captured by the two-dimensional camera.
  • the two-dimensional image is an RGB image to be aligned, which is captured by an RGB camera.
  • image alignment processing is performed on the depth image to be aligned and the RGB image to be aligned, and the depth information is mapped to the pixels of the color image (RGB image to be aligned), thereby further performing image recognition based on the color image, Obtaining information about the corresponding environment or the object being photographed is conducive to better utilization of depth information.
  • the calibration information includes the internal parameters of the depth camera, the internal parameters of the two-dimensional camera, the rotation matrix between the depth camera and the two-dimensional camera, and the translation matrix between the depth camera and the two-dimensional camera.
  • the depth measurement range includes the maximum detection of the depth camera. value and minimum detection value.
  • the depth image to be aligned and the RGB image to be aligned can be aligned based on the calibration information.
  • the possible corresponding row index range of each line in the depth image in the two-dimensional image can be determined, thereby facilitating line-by-line alignment of the depth image and the two-dimensional image, that is, realizing data separation. Batch processing.
  • the row index range corresponding to a row in the depth image is the index range of rows in which each pixel point corresponding to the pixel point in the row may exist in the two-dimensional image.
  • the processor is an image processor, and is specifically an image processor used for image alignment processing.
  • the image processor may be a digital signal processor.
  • all data that require image alignment processing can be grouped (batch) processed, so corresponding image processing is not required.
  • the hardware performance of the processor is very high, so it can be processed directly based on the digital information processor in the depth camera (or 3D camera module) without using an additional host or mobile terminal. This not only improves the computing efficiency of the D2C algorithm, but also Reduce system resource consumption, reduce hardware power consumption, and improve applicability.
  • the present invention also provides an intelligent terminal, the functional block diagram of which can be shown in Figure 5 .
  • Smart terminals include processors and memories.
  • the memory of the smart terminal includes an image processing program, and the memory provides an environment for the execution of the image processing program. When the image processing program is executed by the processor, the steps of any of the above image processing methods are implemented.
  • the smart terminal may also include other functional modules or units, which are not specifically limited here.
  • the image processing program performs the following operation instructions when executed by the processor:
  • the calibration information is the pose calibration information between the depth camera and the two-dimensional camera;
  • Embodiments of the present invention also provide a computer-readable storage medium.
  • An image processing program is stored on the computer-readable storage medium.
  • the image processing program is executed by a processor, the steps of any image processing method provided by the embodiments of the present invention are implemented.
  • sequence number of each step in the above embodiment does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
  • Module completion means dividing the internal structure of the above device into different functional units or modules to complete all or part of the functions described above.
  • Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above-mentioned integrated unit can be hardware-based. It can also be implemented in the form of software functional units.
  • the specific names of each functional unit and module are only for the convenience of distinguishing each other and are not used to limit the scope of the present invention.
  • For the specific working processes of the units and modules in the above system please refer to the corresponding processes in the foregoing method embodiments, and will not be described again here.
  • the disclosed apparatus/terminal equipment and methods can be implemented in other ways.
  • the apparatus/terminal equipment embodiments described above are only illustrative.
  • the division of the above modules or units is only a logical function division. In actual implementation, it can be divided in other ways, such as multiple units or units. Components may be combined or may be integrated into another system, or some features may be ignored, or not implemented.
  • the above-mentioned integrated modules/units are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the above-mentioned embodiment methods, and can also be completed by instructing relevant hardware through a computer program.
  • the above-mentioned computer program can be stored in a computer-readable storage medium.
  • the computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of each of the above method embodiments can be implemented.
  • the above-mentioned computer program includes computer program code, and the above-mentioned computer program code may be in the form of source code, object code, executable file or some intermediate form, etc.
  • the above-mentioned computer-readable media may include: any entity or device capable of carrying the above-mentioned computer program code, recording media, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random accessory Access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, etc. It should be noted that the content contained in the above computer-readable storage media can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.

Abstract

An image processing system and method, an intelligent terminal, and a computer readable storage medium. The image processing system comprises: a depth camera (10) configured to acquire a depth image of a target scene; a two-dimensional camera (20) configured to acquire a two-dimensional image of the target scene; a memory (30) configured to store the depth image, the two-dimensional image, calibration information between the depth camera (10) and the two-dimensional camera (20), and a depth measurement range of the depth camera (10); and a processor (40) configured to determine a corresponding row index range of each row of the depth image in the two-dimensional image according to the calibration information and the depth measurement range, and extract at least one row of depth data in the depth image and at least one row of corresponding two-dimensional data in the two-dimensional image according to the row index range for alignment to determine two-dimensional data corresponding to depth data. In this way, compared with the prior art, the image alignment efficiency is improved.

Description

图像处理系统、方法、智能终端及计算机可读存储介质Image processing system, method, intelligent terminal and computer-readable storage medium
本申请要求于2022年4月1日提交中国专利局,申请号为202210338866.8,发明名称为“图像处理系统、系统、方法、智能终端及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requests the priority of the Chinese patent application submitted to the China Patent Office on April 1, 2022, with the application number 202210338866.8, and the invention name is "Image processing system, system, method, intelligent terminal and computer-readable storage medium", which The entire contents are incorporated herein by reference.
技术领域Technical field
本发明涉及图像信息计算处理技术领域,尤其涉及的是一种图像处理系统、系统、方法、智能终端及计算机可读存储介质。The present invention relates to the technical field of image information computing and processing, and in particular to an image processing system, a system, a method, an intelligent terminal and a computer-readable storage medium.
背景技术Background technique
随着科学技术的发展,对于图像信息的获取和应用越来越广泛。在一些应用场景中,需要对获取的多个图像进行对齐处理,以便获取多个图像中相对应的数据信息。例如,在3D视觉的应用场景中,为了更好地应用深度图像中的深度数据,需要将一个场景对应的深度图像与该场景对应的另一个二维图像(例如RGB图像、灰度图像等)进行对应的图像处理,使得深度图像与该二维图像对齐,即将深度图像中的深度信息映射到对应的二维图像的像素上,方便使用深度信息辅助进行3D识别等操作。With the development of science and technology, the acquisition and application of image information are becoming more and more extensive. In some application scenarios, it is necessary to align multiple acquired images in order to obtain corresponding data information in multiple images. For example, in 3D vision application scenarios, in order to better apply the depth data in the depth image, it is necessary to compare the depth image corresponding to one scene with another two-dimensional image corresponding to the scene (such as RGB image, grayscale image, etc.) Corresponding image processing is performed to align the depth image with the two-dimensional image, that is, the depth information in the depth image is mapped to the pixels of the corresponding two-dimensional image, so that the depth information can be used to assist in operations such as 3D recognition.
现有的图像处理系统在对两张(或多张)图像进行对齐处理时,需要一次处理两张图像中的所有数据,不能将数据进行分批计算和处理。现有技术的问题在于,在进行图像对齐处理时需要同时对大量数据进行处理,不利于提高处理效率和图像对齐的准确性。同时,庞大的计算量要求用于处理的硬件设备性能高,不利于在硬件设备性能不高的场景下进行图像对齐处理,即影响图像对齐处理的适用性。When aligning two (or more) images, the existing image processing system needs to process all the data in the two images at one time, and cannot calculate and process the data in batches. The problem with the existing technology is that a large amount of data needs to be processed simultaneously when performing image alignment processing, which is not conducive to improving processing efficiency and accuracy of image alignment. At the same time, the huge amount of calculation requires high-performance hardware devices for processing, which is not conducive to image alignment processing in scenarios where the hardware device performance is not high, that is, it affects the applicability of image alignment processing.
发明内容Contents of the invention
本发明的主要目的在于提供一种图像处理系统、方法、智能终端及计算机可读存储介质,旨在解决现有技术中在进行图像对齐处理时需要同时对大量数据进行处理,不利于提高处理效率,不利于在硬件设备性能不高的场景下进行图像对齐处理,影响图像对齐处理的适用性的问题。The main purpose of the present invention is to provide an image processing system, method, intelligent terminal and computer-readable storage medium, aiming to solve the problem that in the prior art, a large amount of data needs to be processed simultaneously during image alignment processing, which is not conducive to improving processing efficiency. , which is not conducive to image alignment processing in scenarios with low hardware device performance, and affects the applicability of image alignment processing.
为了实现上述目的,本发明第一方面提供一种图像处理系统,包括:In order to achieve the above objects, a first aspect of the present invention provides an image processing system, including:
深度相机,被配置为采集目标场景的深度图像;a depth camera configured to collect depth images of the target scene;
二维相机,被配置为采集目标场景的二维图像;a two-dimensional camera configured to collect two-dimensional images of the target scene;
存储器,被配置为存储上述深度图像、二维图像、上述深度相机和上述二维相机之间的标定信息以及上述深度相机的深度测量范围;A memory configured to store the depth image, the two-dimensional image, the calibration information between the depth camera and the two-dimensional camera, and the depth measurement range of the depth camera;
处理器,被配置为根据上述标定信息和上述深度测量范围确定上述深度图像的每一行在上述二维图像中对应的行索引范围,并根据上述行索引范围提取上述深度图像中的至少一行深度数据及上述二维图像中对应的至少一行二维数据进行对齐处理确定上述深度数据对应的二维数据。A processor configured to determine the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range, and to extract at least one row of depth data in the depth image based on the row index range. and at least one corresponding row of two-dimensional data in the above-mentioned two-dimensional image are aligned to determine the two-dimensional data corresponding to the above-mentioned depth data.
可选的,上述根据上述行索引范围提取上述深度图像中的至少一行深度数据及上述二维图像中对应的至少一行二维数据进行对齐处理确定上述深度数据对应的二维数据,包括:Optionally, the above-mentioned extraction of at least one row of depth data in the above-mentioned depth image and the corresponding at least one row of two-dimensional data in the above-mentioned two-dimensional image according to the above-mentioned row index range and performing alignment processing to determine the two-dimensional data corresponding to the above-mentioned depth data includes:
根据上述处理器的内存大小和上述行索引范围对上述深度图像和上述二维图像进行划分并提取多组待处理数据,其中,每组上述待处理数据包括至少一行深度数据以及对应的多行二维数据,且相邻行深度数据共享部分二维数据。The depth image and the two-dimensional image are divided according to the memory size of the processor and the row index range and multiple groups of data to be processed are extracted, wherein each group of the data to be processed includes at least one row of depth data and corresponding multiple rows of two-dimensional data. dimensional data, and adjacent rows of depth data share part of the two-dimensional data.
可选的,上述对上述待处理数据进行对齐处理确定上述深度数据对应的二维数据,包括:Optionally, the above-mentioned alignment process on the above-mentioned data to be processed determines the two-dimensional data corresponding to the above-mentioned depth data, including:
将一组上述待处理数据搬运到上述处理器的内存中,通过上述处理器对该组待处理数据进行对齐处理,确定该组待处理数据中上述深度数据对应的二维数据,然后将下一组上述待处理数据搬运到上述内存中进行对齐处理,直到每一组上述待处理数据都完成对齐处理;Transfer a set of the above-mentioned data to be processed to the memory of the above-mentioned processor, align the set of data to be processed through the above-mentioned processor, determine the two-dimensional data corresponding to the above-mentioned depth data in the set of data to be processed, and then add the next The above-mentioned group of data to be processed is transferred to the above-mentioned memory for alignment processing until each group of the above-mentioned data to be processed has completed the alignment processing;
其中,一组内存存储数据的数据量之和不大于上述处理器的内存大小,一组上述内存存储数据包括一组上述待处理数据以及对该组待处理数据进行对齐处理后获得的已处理数据。Among them, the sum of the data amount of a group of memory storage data is not greater than the memory size of the above-mentioned processor, and a group of the above-mentioned memory storage data includes a group of the above-mentioned data to be processed and the processed data obtained by aligning the group of data to be processed. .
可选的,上述图像处理系统还用于:Optionally, the above image processing system is also used for:
搬运第i组上述待处理数据时,获取第i组上述待处理数据与第i-1组上述待处理数据的行索引重叠范围,保留上述内存中的重叠数据,将待搬运数据搬运到上述内存中;When transporting the i-th group of the above-mentioned data to be processed, obtain the row index overlapping range of the i-th group of the above-mentioned data to be processed and the i-1 group of the above-mentioned data to be processed, retain the overlapping data in the above-mentioned memory, and transport the data to be transported to the above-mentioned memory middle;
其中,上述重叠数据是第i-1组上述待处理数据中与上述行索引重叠范围对应的数据,上述待搬运数据是第i组上述待处理数据中上述行索引重叠范围以外的数据。Wherein, the overlapping data is data corresponding to the overlapping range of the row index in the i-1th group of data to be processed, and the data to be transferred is data outside the overlapping range of the row index in the i-th group of data to be processed.
可选的,上述存储器中存储的上述标定信息包括:上述深度相机的内参、上述二维相机的内参、上述深度相机和上述二维相机之间的旋转矩阵以及上述深度相机和上述二维相机之间的平移矩阵。Optionally, the calibration information stored in the memory includes: the internal parameters of the depth camera, the internal parameters of the two-dimensional camera, the rotation matrix between the depth camera and the two-dimensional camera, and the rotation matrix between the depth camera and the two-dimensional camera. translation matrix between.
可选的,上述存储器中存储的上述深度测量范围包括:上述深度相机的最大探测值和最小探测值。Optionally, the depth measurement range stored in the memory includes: the maximum detection value and the minimum detection value of the depth camera.
可选的,上述根据上述标定信息和上述深度测量范围确定上述深度图像的每一行在上述二维图像中对应的行索引范围,包括:Optionally, the step of determining the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range includes:
根据上述深度相机的内参、上述二维相机的内参、上述旋转矩阵、上述平移矩阵、上述最大探测值和上述最小探测值分别获取上述深度图像的每一行对应的最大行索引和最小行索引;According to the internal parameters of the above-mentioned depth camera, the above-mentioned internal parameters of the two-dimensional camera, the above-mentioned rotation matrix, the above-mentioned translation matrix, the above-mentioned maximum detection value and the above-mentioned minimum detection value, respectively obtain the maximum row index and the minimum row index corresponding to each row of the above-mentioned depth image;
根据上述最大行索引和上述最小行索引获取上述深度图像中每一行对应的上述行索引范围;Obtain the above-mentioned row index range corresponding to each row in the above-mentioned depth image according to the above-mentioned maximum row index and the above-mentioned minimum row index;
其中,上述深度图像中一个待对齐行对应的行索引范围用于指示上述二维图像中目标对齐行的范围,上述二维图像中的目标对齐像素点属于上述目标对齐行,上述目标对齐像素点与上述待对齐行中任意一个待对齐像素点对应。Among them, the row index range corresponding to a row to be aligned in the above-mentioned depth image is used to indicate the range of the target alignment row in the above-mentioned two-dimensional image. The target alignment pixels in the above-mentioned two-dimensional image belong to the above-mentioned target alignment rows. The above-mentioned target alignment pixels Corresponds to any pixel to be aligned in the above row to be aligned.
本发明第二方面提供一种图像处理方法,其中,上述图像处理方法应用于 上述任意一种图像处理系统中,上述方法包括:A second aspect of the present invention provides an image processing method, wherein the above-mentioned image processing method is applied to any of the above-mentioned image processing systems, and the above-mentioned method includes:
通过深度相机采集目标场景的深度图像并存入存储器;Collect the depth image of the target scene through the depth camera and store it in the memory;
通过二维相机采集目标场景的二维图像并存入存储器;Collect two-dimensional images of the target scene through a two-dimensional camera and store them in memory;
获取上述存储器中预先存储的上述深度相机和上述二维相机之间的标定信息以及上述深度相机的深度测量范围;Obtain the calibration information between the above-mentioned depth camera and the above-mentioned two-dimensional camera pre-stored in the above-mentioned memory and the depth measurement range of the above-mentioned depth camera;
通过处理器根据上述标定信息和上述深度测量范围确定上述深度图像的每一行在上述二维图像中对应的行索引范围,并根据上述行索引范围提取上述深度图像中的至少一行深度数据及上述二维图像中对应的至少一行二维数据进行对齐处理确定上述深度数据对应的二维数据。The processor determines the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range, and extracts at least one row of depth data in the depth image and the two depth data based on the row index range. At least one corresponding row of two-dimensional data in the three-dimensional image is aligned to determine the two-dimensional data corresponding to the depth data.
本发明第三方面提供一种智能终端,上述智能终端包括存储器、处理器以及存储在上述存储器上并可在上述处理器上运行的图像处理程序,上述图像处理程序被上述处理器执行时实现上述图像处理方法的步骤。A third aspect of the present invention provides an intelligent terminal. The intelligent terminal includes a memory, a processor, and an image processing program stored in the memory and executable on the processor. When the image processing program is executed by the processor, the above-mentioned steps are implemented. Image processing method steps.
本发明第四方面提供一种计算机可读存储介质,上述计算机可读存储介质上存储有图像处理程序,上述图像处理程序被处理器执行时实现上述图像处理方法的步骤。A fourth aspect of the present invention provides a computer-readable storage medium. An image processing program is stored on the computer-readable storage medium. When the image processing program is executed by a processor, the steps of the image processing method are implemented.
由上可见,本发明方案中提供的图像处理系统包括:深度相机,被配置为采集目标场景的深度图像;二维相机,被配置为采集目标场景的二维图像;存储器,被配置为存储上述深度图像、二维图像、上述深度相机和上述二维相机之间的标定信息以及上述深度相机的深度测量范围;处理器,被配置为根据上述标定信息和上述深度测量范围确定上述深度图像的每一行在上述二维图像中对应的行索引范围,并根据上述行索引范围提取上述深度图像中的至少一行深度数据及上述二维图像中对应的至少一行二维数据进行对齐处理确定上述深度数据对应的二维数据。与现有技术中需要一次处理两张图像中的所有数据、不能将数据进行分批计算和处理的方案相比,本发明中的图像处理系统可以根据标定信息和深度测量范围获取深度图像中的每一行在二维图像中对应的行索引范围,从而根据对应的行索引范围将需要进行处理的数据进行分组,每一次对 一组待处理数据进行对齐处理。如此,处理器不需要一次同时处理所有数据,每一次的数据计算量较小,有利于提高处理效率。同时,可以合理地根据处理器的内存大小进行数据分组,从而合理利用处理器的计算能力和存储能力,有利于适用于不同性能的处理器,提高图像对齐处理过程的适用性。进而方便进行图像对齐之后的操作流程(例如人脸识别),提升用户体验。As can be seen from the above, the image processing system provided in the solution of the present invention includes: a depth camera configured to collect a depth image of the target scene; a two-dimensional camera configured to collect a two-dimensional image of the target scene; a memory configured to store the above-mentioned a depth image, a two-dimensional image, calibration information between the depth camera and the two-dimensional camera, and a depth measurement range of the depth camera; a processor configured to determine each of the depth images based on the calibration information and the depth measurement range. The row index range corresponding to one row in the above-mentioned two-dimensional image, and extracting at least one row of depth data in the above-mentioned depth image and at least one corresponding row of two-dimensional data in the above-mentioned two-dimensional image according to the above-mentioned row index range, performing alignment processing to determine the corresponding depth data two-dimensional data. Compared with the existing technology that needs to process all the data in two images at one time and cannot calculate and process the data in batches, the image processing system in the present invention can obtain the depth image based on the calibration information and the depth measurement range. Each row corresponds to the row index range in the two-dimensional image, so that the data to be processed is grouped according to the corresponding row index range, and a group of data to be processed is aligned each time. In this way, the processor does not need to process all data at once, and the amount of data calculation each time is small, which is beneficial to improving processing efficiency. At the same time, data can be grouped reasonably according to the memory size of the processor, thereby rationally utilizing the computing power and storage capacity of the processor, which is beneficial to adapting to processors with different performance and improving the applicability of the image alignment process. This facilitates the operation process after image alignment (such as face recognition) and improves user experience.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings in the following description are only illustrative of the present invention. For some embodiments, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1是本发明实施例提供的一种图像处理系统的结构示意图;Figure 1 is a schematic structural diagram of an image processing system provided by an embodiment of the present invention;
图2是本发明实施例提供的一种深度图像与RGB图像的映射关系示意图;Figure 2 is a schematic diagram of the mapping relationship between a depth image and an RGB image provided by an embodiment of the present invention;
图3是本发明实施例提供的一种深度图像和RGB图像的映射关系示意图;Figure 3 is a schematic diagram of the mapping relationship between a depth image and an RGB image provided by an embodiment of the present invention;
图4是本发明实施例提供的一种图像处理方法的流程示意图;Figure 4 is a schematic flowchart of an image processing method provided by an embodiment of the present invention;
图5是本发明实施例提供的一种智能终端的内部结构原理框图。Figure 5 is a functional block diagram of the internal structure of an intelligent terminal provided by an embodiment of the present invention.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本发明实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本发明。在其它情况下,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本发明的描述。In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention in unnecessary detail.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It will be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components but does not exclude one or more other features , the presence or addition of a whole, a step, an operation, an element, a component, and/or a collection thereof.
还应当理解,在本发明说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本发明。如在本发明说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terminology used in the description of the present invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly dictates otherwise.
还应当进一步理解,在本发明说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It will be further understood that the term "and/or" as used in the specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items. .
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当…时”或“一旦”或“响应于确定”或“响应于检测到”。类似的,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述的条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, to mean "once determined" or "in response to a determination" or "once the [described condition or event] is detected" event]” or “in response to detection of [the described condition or event]”.
下面结合本发明实施例的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
在下面的描述中阐述了很多具体细节以便于充分理解本发明,但是本发明还可以采用其它不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本发明内涵的情况下做类似推广,因此本发明不受下面公开的具体实施例的限制。Many specific details are set forth in the following description to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described here. Those skilled in the art can do so without departing from the connotation of the present invention. Similar generalizations are made, and therefore the present invention is not limited to the specific embodiments disclosed below.
随着科学技术的发展,对于图像信息的获取和应用越来越广泛。在一些应用场景中,需要对获取的多个图像进行对齐处理,以便获取多个图像中相对应的数据信息。例如,在3D视觉的应用场景中,从3D相机模组中获取到深度图像之后,为了更好地应用深度图像中的深度数据,需要将一个场景对应的深度图像与该场景对应的另一个二维图像(例如RGB图像、灰度图像、IR图像等)进行对应的图像处理,使得深度图像与该二维图像对齐,即将深度图像中的深 度信息映射到对应的二维图像的像素上,方便使用深度信息辅助进行3D识别等操作。例如,将该深度图像与从二维相机模组(例如,RGB相机模组)中获取的RGB图像对齐,将获取的深度信息映射到彩色图像的像素上(即D2C,Depth to Color),以实现更好地信息利用。With the development of science and technology, the acquisition and application of image information are becoming more and more extensive. In some application scenarios, it is necessary to align multiple acquired images in order to obtain corresponding data information in multiple images. For example, in a 3D vision application scenario, after obtaining a depth image from a 3D camera module, in order to better apply the depth data in the depth image, it is necessary to compare the depth image corresponding to one scene with another depth image corresponding to the scene. Perform corresponding image processing on dimensional images (such as RGB images, grayscale images, IR images, etc.) so that the depth image is aligned with the two-dimensional image, that is, the depth information in the depth image is mapped to the pixels of the corresponding two-dimensional image, which is convenient Use depth information to assist in operations such as 3D recognition. For example, align the depth image with an RGB image obtained from a two-dimensional camera module (for example, an RGB camera module), and map the obtained depth information to the pixels of the color image (i.e., D2C, Depth to Color) to Achieve better information utilization.
现有技术中,在对两张(或多张)图像进行对齐处理时,需要一次处理两张图像中的所有数据,不能将数据进行分批计算和处理。现有技术的问题在于,在进行图像对齐处理时需要同时对大量数据进行处理,不利于提高处理效率和图像对齐的准确性。同时,庞大的计算量要求用于处理的硬件设备性能高,不利于在硬件设备性能不高的场景下进行图像对齐处理,即影响图像对齐处理的适用性。In the existing technology, when aligning two (or more) images, all data in the two images need to be processed at one time, and the data cannot be calculated and processed in batches. The problem with the existing technology is that a large amount of data needs to be processed simultaneously when performing image alignment processing, which is not conducive to improving processing efficiency and accuracy of image alignment. At the same time, the huge amount of calculation requires high-performance hardware devices for processing, which is not conducive to image alignment processing in scenarios where the hardware device performance is not high, that is, it affects the applicability of image alignment processing.
具体地,受计算量的限制,目前常见的3D设备中的图像对齐处理计算都需要在额外设置的宿主机或者移动终端的CPU上计算,不能直接在3D设备对应的图像处理器(如数字信号处理器)上进行计算。如果使用宿主机,则限制了3D设备的使用场景,如果使用移动终端的CPU,则会增加CPU的负担,影响其他任务的进行。同时,现有技术中的D2C算法通常只能根据特定的3D相机模组采集的数据进行计算,而不同的3D相机模组存在个体本身差异以及安装的差异,使得现有的D2C算法无法自适应地对不同的3D相机模组采集的数据进行计算。Specifically, due to limitations in the amount of calculation, image alignment calculations in currently common 3D devices need to be calculated on an additional host or the CPU of a mobile terminal, and cannot be directly performed on the image processor (such as a digital signal processor) corresponding to the 3D device. processor). If the host is used, the usage scenarios of the 3D device are limited. If the CPU of the mobile terminal is used, the burden on the CPU will be increased and the performance of other tasks will be affected. At the same time, the D2C algorithm in the existing technology can usually only be calculated based on the data collected by a specific 3D camera module. Different 3D camera modules have individual differences and installation differences, making the existing D2C algorithm unable to adapt. Compute the data collected by different 3D camera modules.
为了解决现有技术中存在的至少一个问题,本发明中提供一种图像处理系统包括:深度相机,被配置为采集目标场景的深度图像;二维相机,被配置为采集目标场景的二维图像;存储器,被配置为存储上述深度图像、二维图像、上述深度相机和上述二维相机之间的标定信息以及上述深度相机的深度测量范围;处理器,被配置为根据上述标定信息和上述深度测量范围确定上述深度图像的每一行在上述二维图像中对应的行索引范围,并根据上述行索引范围提取上述深度图像中的至少一行深度数据及上述二维图像中对应的至少一行二维数据进行对齐处理确定上述深度数据对应的二维数据。与现有技术中需要一次处 理两张图像中的所有数据、不能将数据进行分批计算和处理的方案相比,本发明中的图像处理系统可以根据标定信息和深度测量范围获取深度图像中的每一行在二维图像中对应的行索引范围,从而根据对应的行索引范围将需要进行处理的数据进行分组,每一次对一组待处理数据进行对齐处理。如此,处理器不需要一次同时处理所有数据,每一次的数据计算量较小,有利于提高处理效率。同时,可以合理地根据处理器的内存大小进行数据分组,从而合理利用处理器的计算能力和存储能力,有利于适用于不同性能的处理器,提高图像对齐处理过程的适用性。进而方便进行图像对齐之后的操作流程(例如人脸识别),提升用户体验。In order to solve at least one problem existing in the prior art, the present invention provides an image processing system including: a depth camera configured to collect a depth image of a target scene; a two-dimensional camera configured to collect a two-dimensional image of the target scene ; The memory is configured to store the above-mentioned depth image, the two-dimensional image, the calibration information between the above-mentioned depth camera and the above-mentioned two-dimensional camera, and the depth measurement range of the above-mentioned depth camera; The processor is configured to store the above-mentioned calibration information and the above-mentioned depth The measurement range determines the row index range corresponding to each row of the depth image in the two-dimensional image, and extracts at least one row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image based on the row index range. An alignment process is performed to determine the two-dimensional data corresponding to the above depth data. Compared with the existing technology that needs to process all the data in two images at one time and cannot calculate and process the data in batches, the image processing system in the present invention can obtain the depth image based on the calibration information and the depth measurement range. Each row corresponds to the row index range in the two-dimensional image, so that the data to be processed is grouped according to the corresponding row index range, and a group of data to be processed is aligned each time. In this way, the processor does not need to process all data at once, and the amount of data calculation each time is small, which is beneficial to improving processing efficiency. At the same time, data can be grouped reasonably according to the memory size of the processor, thereby rationally utilizing the computing power and storage capacity of the processor, which is beneficial to adapting to processors with different performance and improving the applicability of the image alignment process. This facilitates the operation process after image alignment (such as face recognition) and improves user experience.
如图1所示,本发明实施例提供一种图像处理系统,包括:As shown in Figure 1, an embodiment of the present invention provides an image processing system, including:
深度相机10,被配置为采集目标场景的深度图像; Depth camera 10 is configured to collect depth images of the target scene;
二维相机20,被配置为采集目标场景的二维图像;The two-dimensional camera 20 is configured to collect two-dimensional images of the target scene;
存储器30,被配置为存储上述深度图像、二维图像、上述深度相机和上述二维相机之间的标定信息以及上述深度相机的深度测量范围;The memory 30 is configured to store the above-mentioned depth image, the two-dimensional image, the calibration information between the above-mentioned depth camera and the above-mentioned two-dimensional camera, and the depth measurement range of the above-mentioned depth camera;
处理器40,被配置为根据上述标定信息和上述深度测量范围确定上述深度图像的每一行在上述二维图像中对应的行索引范围,并根据上述行索引范围提取上述深度图像中的至少一行深度数据及上述二维图像中对应的至少一行二维数据进行对齐处理确定上述深度数据对应的二维数据。The processor 40 is configured to determine the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range, and extract at least one row of depth in the depth image based on the row index range. The data and at least one corresponding row of two-dimensional data in the above-mentioned two-dimensional image are aligned to determine the two-dimensional data corresponding to the above-mentioned depth data.
其中,深度图像和二维图像是需要进行对齐处理的图像,目标场景是进行图像拍摄的场景。本实施例中,以对两个图像进行对齐处理为例进行说明,实际使用过程中,可以基于上述图像处理系统对多个图像进行对齐处理,即二维图像不止一幅,例如,将深度图像和第一二维图像对齐后获得第一对齐图像,将第二二维图像与第一对齐图像进行对齐处理获得第二对齐图像,从而实现三个图像之间的对齐处理。Among them, the depth image and the two-dimensional image are images that need to be aligned, and the target scene is the scene where the image is captured. In this embodiment, alignment processing of two images is taken as an example for explanation. In actual use, multiple images can be aligned based on the above image processing system, that is, there is more than one two-dimensional image. For example, a depth image can be After aligning with the first two-dimensional image, a first aligned image is obtained, and the second two-dimensional image is aligned with the first aligned image to obtain a second aligned image, thereby realizing alignment processing between the three images.
本实施例中,将深度图像与二维图像(例如RGB图像)进行对齐,可以实现将深度图像中的深度信息映射到二维图像的对应像素上,有利于结合深度信 息辅助二维图像进行三维信息识别(例如3D人脸识别)。In this embodiment, by aligning the depth image with the two-dimensional image (such as an RGB image), the depth information in the depth image can be mapped to the corresponding pixels of the two-dimensional image, which is beneficial to assisting the two-dimensional image in three-dimensional processing by combining the depth information. Information recognition (such as 3D face recognition).
需要说明的是,本实施例中,深度图像和二维图像是通过不同相机拍摄获取的,深度图像是深度相机10拍摄获得,二维图像是二维相机20拍摄获得的。具体的,二维图像为待对齐RGB图像,是利用RGB相机拍摄获得。基于本实施例中的图像处理系统,对待对齐深度图像和待对齐RGB图像进行图像对齐处理,将深度信息映射到彩色图像(待对齐RGB图像)的像素上,从而进一步基于彩色图像进行图像识别,获取对应的环境或被拍摄的对象的信息,有利于更好地实现对于深度信息的利用。It should be noted that in this embodiment, the depth image and the two-dimensional image are captured by different cameras. The depth image is captured by the depth camera 10 and the two-dimensional image is captured by the two-dimensional camera 20 . Specifically, the two-dimensional image is an RGB image to be aligned, which is captured by an RGB camera. Based on the image processing system in this embodiment, image alignment processing is performed on the depth image to be aligned and the RGB image to be aligned, and the depth information is mapped to the pixels of the color image (RGB image to be aligned), thereby further performing image recognition based on the color image. Obtaining information about the corresponding environment or the object being photographed is conducive to better utilization of depth information.
具体的,标定信息包括深度相机10的内参、二维相机20的内参、深度相机10和二维相机20之间的旋转矩阵以及深度相机10和二维相机20之间的平移矩阵,深度测量范围包括深度相机10的最大探测值和最小探测值。Specifically, the calibration information includes the internal parameters of the depth camera 10, the internal parameters of the two-dimensional camera 20, the rotation matrix between the depth camera 10 and the two-dimensional camera 20, the translation matrix between the depth camera 10 and the two-dimensional camera 20, and the depth measurement range. Including the maximum detection value and minimum detection value of the depth camera 10 .
本实施例中,基于标定信息可以对待对齐深度图像和待对齐RGB图像进行对齐处理。同时,基于深度相机10对应的最大探测值和最小探测值可以确定深度图像中各行在二维图像中可能对应的行索引范围,从而方便对深度图像和二维图像进行分行对齐,即实现数据的分批处理。In this embodiment, the depth image to be aligned and the RGB image to be aligned can be aligned based on the calibration information. At the same time, based on the maximum detection value and the minimum detection value corresponding to the depth camera 10, the possible corresponding line index range of each line in the depth image in the two-dimensional image can be determined, thereby facilitating line-by-line alignment of the depth image and the two-dimensional image, that is, realizing data alignment. Process in batches.
其中,深度图像中一行对应的行索引范围是该行中的像素点在二维图像中对应的各个像素点可能存在的行的索引范围。例如,深度图像的第1行中各个像素点对应的像素点可能分布在二维图像的第1行到第3行之间,则深度图像的第1行对应的行索引范围是1到3行。Among them, the row index range corresponding to a row in the depth image is the index range of rows in which each pixel point corresponding to the pixel point in the row may exist in the two-dimensional image. For example, the pixels corresponding to each pixel in the first row of the depth image may be distributed between the first and third rows of the two-dimensional image. Then the row index corresponding to the first row of the depth image ranges from rows 1 to 3. .
需要说明的是,深度测量范围可以根据深度相机10的最大工作距离和最小工作距离确定。It should be noted that the depth measurement range can be determined based on the maximum working distance and the minimum working distance of the depth camera 10 .
本实施例中,上述根据上述标定信息和上述深度测量范围确定上述深度图像的每一行在上述二维图像中对应的行索引范围,包括:根据深度相机10的内参、二维相机20的内参、旋转矩阵、平移矩阵、最大探测值和最小探测值分别获取深度图像的每一行对应的最大行索引和最小行索引;基于最大行索引和最小行索引获取深度图像中每一行对应的行索引范围。In this embodiment, the above-mentioned determination of the row index range corresponding to each row of the above-mentioned depth image in the above-mentioned two-dimensional image based on the above-mentioned calibration information and the above-mentioned depth measurement range includes: based on the internal parameters of the depth camera 10, the internal parameters of the two-dimensional camera 20, The rotation matrix, translation matrix, maximum detection value and minimum detection value respectively obtain the maximum row index and minimum row index corresponding to each row of the depth image; based on the maximum row index and minimum row index, the row index range corresponding to each row in the depth image is obtained.
其中,深度图像中一个待对齐行(即深度图像中的任意一行)对应的行索引范围用于指示二维图像中目标对齐行(即与待对齐行对应的行)的范围,二维图像中的目标对齐像素点属于目标对齐行,目标对齐像素点与待对齐行中任意一个待对齐像素点对应。Among them, the row index range corresponding to a row to be aligned in the depth image (i.e., any row in the depth image) is used to indicate the range of the target alignment row (i.e., the row corresponding to the row to be aligned) in the two-dimensional image. In the two-dimensional image, The target alignment pixel belongs to the target alignment row, and the target alignment pixel corresponds to any to-be-aligned pixel in the row to be aligned.
具体的,对于一个待对齐行,该行中的所有像素点都为待对齐像素点,每一个待对齐像素点在二维图像中有一个目标对齐像素点,一个待对齐行对应的所有目标对齐像素点在二维图像中属于上述行索引范围之内。例如,深度图像中的第1行有640个像素点,该640个像素点在二维图像中有对应的640个目标对齐像素点。将二维图像中这640个目标对齐像素点对应的行索引范围(例如第1到3行)作为待对齐行的行索引范围。其中,该待对齐行对应的最大行索引是3,最小行索引是1。Specifically, for a row to be aligned, all pixels in the row are pixels to be aligned. Each pixel to be aligned has a target alignment pixel in the two-dimensional image, and all targets corresponding to a row to be aligned are aligned. The pixels in the two-dimensional image belong to the above row index range. For example, row 1 in the depth image has 640 pixels, and these 640 pixels have corresponding 640 target alignment pixels in the 2D image. The row index range corresponding to the 640 target alignment pixels in the two-dimensional image (for example, rows 1 to 3) is used as the row index range of the row to be aligned. Among them, the maximum row index corresponding to the row to be aligned is 3, and the minimum row index is 1.
具体的,深度相机(例如3D相机模组)和二维(例如RGB)相机(模组)的光心存在距离上和旋转角度上的偏差,因此将深度信息映射到RGB图像上时需要先将深度信息转换到世界坐标系,再由世界坐标系转换到RGB图像像素坐标系,即实现D2C。Specifically, the optical centers of depth cameras (such as 3D camera modules) and two-dimensional (such as RGB) cameras (modules) have deviations in distance and rotation angle. Therefore, when mapping depth information to an RGB image, you need to first The depth information is converted to the world coordinate system, and then converted from the world coordinate system to the RGB image pixel coordinate system, which implements D2C.
本实施例中,构建深度图像像素坐标系和RGB图像像素坐标系间的坐标转换关系,如下公式(1)所示:In this embodiment, the coordinate transformation relationship between the depth image pixel coordinate system and the RGB image pixel coordinate system is constructed, as shown in the following formula (1):
Figure PCTCN2022100631-appb-000001
Figure PCTCN2022100631-appb-000001
其中,u rgb和v rgb分别代表图像在RGB图像像素坐标系下的横坐标和纵坐标,u ir和v ir分别代表图像在深度图像像素坐标系下的横坐标和纵坐标,R ir2rgb代表从深度(IR)相机到RGB相机的旋转矩阵,T ir2rgb代表从深度相机到RGB相机的平移矩阵,K ir和K rgb分别代表深度相机和RGB相机的内参,
Figure PCTCN2022100631-appb-000002
是K ir的逆矩阵,depth代表深度图像中坐标为(u ir,v ir)的位置的深度值,Z rgb则为深度图像中(u ir,v ir)坐标点在RGB图像中对应的(u rgb,v rgb)坐标位置的深度值。
Among them, u rgb and v rgb respectively represent the abscissa and ordinate coordinates of the image in the RGB image pixel coordinate system, u ir and v ir respectively represent the abscissa and ordinate coordinates of the image in the depth image pixel coordinate system, and R ir2rgb represents from The rotation matrix from the depth (IR) camera to the RGB camera, T ir2rgb represents the translation matrix from the depth camera to the RGB camera, K ir and K rgb represent the internal parameters of the depth camera and RGB camera respectively,
Figure PCTCN2022100631-appb-000002
is the inverse matrix of K ir , depth represents the depth value of the position with coordinates (u ir , v ir ) in the depth image, and Z rgb is the corresponding (u ir , v ir ) coordinate point in the depth image in the RGB image ( u rgb , v rgb ) the depth value of the coordinate position.
需要说明的是,上述公式(1)中,深度图像中的一个待对齐像素点的坐标为(u ir,v ir),RGB图像中与该待对齐像素点对应的目标对齐像素点的坐标为(u rgb,v rgb)。D2C算法是把深度图像的深度值映射到RGB图像上的对应像素点(目标对齐像素点)上,这样就可以变成RGBD的数据(即结合RGB色彩和深度信息的数据),在整个算法中不需要考虑RGB像素的值。在一种应用场景中,RGB相机和深度相机分别采图,两种图中的同一物体在两个图像中的像素坐标是不一样的,即把两张图像重叠在一起的话会有偏差,D2C需要做的是将深度图像与RGB重叠后使得两张图中的同一物体重叠,上述Z rgb则为(u ir,v ir)坐标点的深度映射到(u rgb,v rgb)点上的深度,即为在对齐后的RGB图像上像素点的深度值,也即(u ir,v ir)坐标点在经过对齐处理后对应的已处理数据(已处理数据包括对齐后的图像中各点的RGB色彩值和深度值)。 It should be noted that in the above formula (1), the coordinates of a pixel to be aligned in the depth image are (u ir , v ir ), and the coordinates of the target alignment pixel corresponding to the pixel to be aligned in the RGB image are (u rgb , v rgb ). The D2C algorithm maps the depth value of the depth image to the corresponding pixels (target alignment pixels) on the RGB image, so that it can be turned into RGBD data (that is, data that combines RGB color and depth information). In the entire algorithm There is no need to consider the values of RGB pixels. In one application scenario, the RGB camera and the depth camera capture images separately. The pixel coordinates of the same object in the two images are different in the two images. That is, there will be a deviation if the two images are overlapped. D2C What needs to be done is to overlap the depth image with RGB so that the same object in the two pictures overlaps. The above Z rgb is the depth of the (u ir , v ir ) coordinate point mapped to the depth of the (u rgb , v rgb ) point, that is is the depth value of the pixel on the aligned RGB image, that is, the processed data corresponding to the (u ir , v ir ) coordinate point after the alignment process (the processed data includes the RGB color of each point in the aligned image value and depth value).
本实施例中,将深度图像中的各个像素点对齐二维图像中的各个像素点,并映射对应的深度信息。因此(u ir,v ir)是确定的(根据对应的待对齐像素点的坐标确定),且预先获取了深度图像和二维图像之间的标定信息以及上述深度图像对应的深度测量范围,因此上述公式(1)中,只有u rgb、v rgb和Z rgb是需要计算的未知量。本实施例中,是对深度图像中的像素点进行逐行对齐,因此无需考虑v rgb对应的列索引范围。在实际使用过程中,也可以对深度图像中的像素点进行逐列对齐,则只需考虑v rgb对应的列索引范围,而无需考虑u rgb对应的行索引范围,具体也可以参照本实施例方案,在此不再赘述。 In this embodiment, each pixel point in the depth image is aligned with each pixel point in the two-dimensional image, and the corresponding depth information is mapped. Therefore (u ir , v ir ) is determined (determined according to the coordinates of the corresponding pixel points to be aligned), and the calibration information between the depth image and the two-dimensional image and the depth measurement range corresponding to the above-mentioned depth image are obtained in advance, so In the above formula (1), only u rgb , v rgb and Z rgb are unknown quantities that need to be calculated. In this embodiment, the pixels in the depth image are aligned row by row, so there is no need to consider the column index range corresponding to v rgb . In actual use, the pixels in the depth image can also be aligned column by column, and only the column index range corresponding to v rgb needs to be considered, without considering the row index range corresponding to u rgb . For details, please refer to this embodiment. The plan will not be described in detail here.
本实施例中,以逐行处理为例进行说明,可以将公式(1)中的未知量Z rgb移到等式左边,从而针对深度图像中的某一待对齐行(第u ir行),根据depth的最大值和最小值分别求取u rgb对应的最大值和最小值,作为该待对齐行的最大行索引和最小行索引。 In this embodiment, line-by-line processing is taken as an example. The unknown quantity Z rgb in formula (1) can be moved to the left side of the equation, so that for a certain line to be aligned (row u ir ) in the depth image, According to the maximum and minimum values of depth, the maximum and minimum values corresponding to u rgb are respectively obtained as the maximum row index and minimum row index of the row to be aligned.
在一种应用场景中,以常见的一种深度图像为例,常见的深度图像的分辨率为640*480,则u ir的取值范围为0到639(从第0行开始计数),v ir的取值范围为0到479(从第0列开始计数)。深度值depth的最大值和最小值(即上 述深度图像中的最大探测值和最小探测值)可以根据深度相机的工作距离确定。 In an application scenario, taking a common depth image as an example, the resolution of a common depth image is 640*480, then the value range of u ir is 0 to 639 (counting from line 0), v The value range of ir is 0 to 479 (counting from column 0). The maximum and minimum values of the depth value (that is, the maximum detection value and the minimum detection value in the above-mentioned depth image) can be determined based on the working distance of the depth camera.
具体的,基于上述公式(1)所示的D2C原理可知,RGB图像中对应的行索引u rgb和列索引v rgb均与depth相关。图2是本发明实施例提供的一种深度图像与RGB图像的映射关系示意图,如图2所示,当depth为最小探测值时,根据上述公式(1)可以获取对应的最小行索引,反之当depth为最大探测值时,根据上述公式(1)可以获取对应的最大行索引,从而可以获取深度图像中待对齐行对应的二维图像中的行索引范围,确定每次需要搬运的数据。 Specifically, based on the D2C principle shown in the above formula (1), it can be known that the corresponding row index u rgb and column index v rgb in the RGB image are related to depth. Figure 2 is a schematic diagram of the mapping relationship between a depth image and an RGB image provided by an embodiment of the present invention. As shown in Figure 2, when depth is the minimum detection value, the corresponding minimum row index can be obtained according to the above formula (1), and vice versa. When depth is the maximum detection value, the corresponding maximum row index can be obtained according to the above formula (1), so that the row index range in the two-dimensional image corresponding to the row to be aligned in the depth image can be obtained, and the data that needs to be transferred each time can be determined.
本实施例中,针对深度图像中的每一行,可以根据深度相机的工作距离(即深度相机的探测距离范围,根据具体的深度相机和应用场景设置确定)以及相机标定信息可以提前计算出对应的行索引范围。且可以根据每一行对应的最小行索引(color_y_min)和最大行索引(color_y_max)建立对应的索引表,以便确定深度图像中每一行对应的行索引范围。需要说明的是,图2中展示的是深度图像与RGB图像的对应映射关系,实际使用过程中,可以认为对齐后的图像是与RGB图像重叠的,即图2也可以作为深度图像与对齐后的图像之间的对应映射关系。In this embodiment, for each row in the depth image, the corresponding value can be calculated in advance based on the working distance of the depth camera (that is, the detection distance range of the depth camera, determined according to the specific depth camera and application scene settings) and the camera calibration information. Row index range. And a corresponding index table can be established based on the minimum row index (color_y_min) and the maximum row index (color_y_max) corresponding to each row, so as to determine the row index range corresponding to each row in the depth image. It should be noted that Figure 2 shows the corresponding mapping relationship between the depth image and the RGB image. In actual use, the aligned image can be considered to overlap with the RGB image, that is, Figure 2 can also be used as the depth image and the aligned image. The corresponding mapping relationship between the images.
本实施例中,可以预设一个用于计算行索引范围的算法(或程序等),将相机间的旋转矩阵R ir2rgb、平移矩阵T ir2rgb、深度相机内参K ir和RGB相机内参k rgb输入对应的算法,同时,基于深度相机工作距离获取最大探测值depth max和最小探测值depth min并输入上述算法。 In this embodiment, an algorithm (or program, etc.) for calculating the row index range can be preset, and the inter-camera rotation matrix R ir2rgb , translation matrix T ir2rgb , depth camera internal parameter K ir and RGB camera internal parameter k rgb are input to the corresponding algorithm, at the same time, obtain the maximum detection value depth max and the minimum detection value depth min based on the working distance of the depth camera and input them into the above algorithm.
需要说明的是,在一种应用场景中,最大探测值和最小探测值还可以预先通过对深度相机及其应用场景的设定来确认,例如,在对应的拍摄区域内,预先规定被拍摄对象(如需要进行人脸检测的用户)距离深度相机的最近距离和最远距离。在另一种应用场景中,还可以对深度图像进行深度值分析,获取已经拍摄好的深度图像中具体的最大探测值和最小探测值进行计算,以提高计算精度,进行更好的数据搬运,提高图像对齐效率。It should be noted that in an application scenario, the maximum detection value and the minimum detection value can also be confirmed in advance by setting the depth camera and its application scenario. For example, in the corresponding shooting area, the subject to be photographed is predetermined. (For example, users who need to perform face detection) The shortest distance and the farthest distance from the depth camera. In another application scenario, depth value analysis can also be performed on the depth image, and the specific maximum detection value and minimum detection value in the depth image that has been taken can be obtained and calculated to improve calculation accuracy and perform better data handling. Improve image alignment efficiency.
具体的,依次计算深度图像中每一行对应的最大行索引和最小行索引,从 而获得每一行对应的行索引范围。对于深度图像中的一个待对齐行,u ir是确定的,遍历v ir的每一个取值(例如0到639),分别将depth max和depth min代入上述公式(1)计算获得该待对齐行的640个候选最小索引和640个候选最大索引,并将所有候选最小索引中的最小值作为该待对齐行对应的最小行索引,将所有候选最大索引中的最大值作为该待对齐行对应的最大行索引。如此,可以获取深度图像中每一行对应的最大行索引和最小行索引,从而获取每一行对应的行索引范围。需要说明的是,还可以进一步将各行及其对应的行索引范围制成查找表,方便进行存储和查找,且根据上述查找表可以快速获取深度图像中的一行在二维图像中可能对应哪几行,有利于进行数据分组和搬运。 Specifically, the maximum row index and the minimum row index corresponding to each row in the depth image are calculated sequentially, thereby obtaining the row index range corresponding to each row. For a line to be aligned in the depth image, u ir is determined. Traverse each value of v ir (for example, 0 to 639), and substitute depth max and depth min into the above formula (1) to calculate the line to be aligned. 640 candidate minimum indexes and 640 candidate maximum indexes, and the minimum value among all candidate minimum indexes is used as the minimum row index corresponding to the row to be aligned, and the maximum value among all candidate maximum indexes is used as the corresponding minimum row index for the row to be aligned. Maximum row index. In this way, the maximum row index and the minimum row index corresponding to each row in the depth image can be obtained, thereby obtaining the row index range corresponding to each row. It should be noted that each row and its corresponding row index range can be further made into a lookup table to facilitate storage and search, and based on the above lookup table, you can quickly obtain which numbers a row in the depth image may correspond to in the two-dimensional image. OK, which is helpful for data grouping and handling.
需要说明的是,为了便于计算,本实施例中每一个待对齐行进行计算时采用的是相同的depth max和depth min。在一个实施例中,为了更精准的体现映射关系,上述深度测量范围可以包括深度图像中每一行的最大探测值和最小探测值,从而根据每一行的最大探测值和最小探测值计算获取该行对应的最大行索引、最小行索引和行索引范围。 It should be noted that, in order to facilitate calculation, in this embodiment, the same depth max and depth min are used for calculation of each row to be aligned. In one embodiment, in order to reflect the mapping relationship more accurately, the above-mentioned depth measurement range may include the maximum detection value and the minimum detection value of each row in the depth image, so that the row is calculated and obtained based on the maximum detection value and the minimum detection value of each row. The corresponding maximum row index, minimum row index and row index range.
本实施例中,处理器40是图像处理器,且具体为用于进行图像对齐处理的图像处理器,图像处理器可以为数字信号处理器。具体的,采用本实施例中的系统,可以对所有需要进行图像对齐处理的数据(包括深度图像和二维图像中的所有数据)进行分组(分批)处理,因此并不要求对应的图像处理器的硬件性能非常高,从而可以直接基于深度相机(或3D相机模组)中的数字信息处理器进行处理,无需使用额外的宿主机或移动终端,不仅可以提高D2C算法的计算效率,还可以减少系统消耗资源,降低硬件的功耗,且可以提高适用性。可见,与现有技术中使用宿主机和移动终端的CPU的方案不同,本实施例中基于数字信号处理器进行图像对齐处理的计算过程,如此,可以降低移动终端CPU的负担并降低整个系统的功耗。In this embodiment, the processor 40 is an image processor, and specifically is an image processor used for image alignment processing. The image processor may be a digital signal processor. Specifically, using the system in this embodiment, all data that require image alignment processing (including all data in depth images and two-dimensional images) can be grouped (batch) processed, so corresponding image processing is not required. The hardware performance of the processor is very high, so it can be processed directly based on the digital information processor in the depth camera (or 3D camera module) without using an additional host or mobile terminal. This not only improves the computing efficiency of the D2C algorithm, but also Reduce system resource consumption, reduce hardware power consumption, and improve applicability. It can be seen that, unlike the prior art solution that uses the CPU of the host machine and the mobile terminal, the calculation process of the image alignment process is based on a digital signal processor in this embodiment. In this way, the burden on the mobile terminal CPU can be reduced and the cost of the entire system can be reduced. power consumption.
本实施例中,上述根据上述行索引范围提取上述深度图像中的至少一行深度数据及上述二维图像中对应的至少一行二维数据进行对齐处理确定上述深度 数据对应的二维数据,包括:根据处理器40的内存大小及行索引范围同时提取上述深度图像中的多行深度数据以及二维图像中对应的多行二维数据并组成多组待处理数据;分别对每一组待处理数据进行对齐处理,确定每一行深度数据对应的二维数据。In this embodiment, extracting at least one row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image based on the row index range and performing alignment processing to determine the two-dimensional data corresponding to the depth data includes: The memory size and row index range of the processor 40 simultaneously extract multiple rows of depth data in the above-mentioned depth image and corresponding multiple rows of two-dimensional data in the two-dimensional image and form multiple groups of data to be processed; each group of data to be processed is processed separately. Alignment processing determines the two-dimensional data corresponding to each row of depth data.
具体的,进行图像对齐处理的过程中,有大量的访存操作,上述D2C计算过程在DSP上进行计算,深度图像和二维图像都不是存储在DSP的片上内存中的,即需要访问的数据不在DSP的片上内存中,则需要将对应的数据搬运到DSP的片上内存中。同时,DSP的片上内存大小有限,通常无法容纳深度图像和二维图像中的所有数据,因此需要对数据进行分批搬运和计算,同时需要保证每次搬运的一批数据中,待对齐行所对应的目标对齐行中的数据也被成功搬运。本实施例中,需要从同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)中搬运数据到DSP的片上内存中。Specifically, during the image alignment process, there are a large number of memory access operations. The above D2C calculation process is calculated on the DSP. Neither the depth image nor the two-dimensional image is stored in the on-chip memory of the DSP, that is, the data that needs to be accessed. If it is not in the DSP's on-chip memory, the corresponding data needs to be moved to the DSP's on-chip memory. At the same time, the on-chip memory size of the DSP is limited and usually cannot accommodate all the data in the depth image and the two-dimensional image. Therefore, the data needs to be transported and calculated in batches. At the same time, it is necessary to ensure that in each batch of data transported, all rows to be aligned are included. The data in the corresponding target alignment row is also successfully moved. In this embodiment, data needs to be transferred from Synchronous Dynamic Random Access Memory (SDRAM) to the on-chip memory of the DSP.
在一种应用场景中,需要用户判断每次搬运几行数据,且需要用户手动输入对应的指令来实现片上内存和SDARM中的数据的来回搬移,获取不同大小、类型的数据都需要输入不同的指令,因此不方便操作,且不利于提升图像处理效率。同时,还需要用户手动计算每次搬运的数据量,难以实现对片上内存的充分利用,且容易导致搬移数据次数增多,耗费计算时间。In one application scenario, the user is required to determine how many rows of data are to be moved at a time, and the user is required to manually enter corresponding instructions to move data back and forth between the on-chip memory and the SDARM. To obtain data of different sizes and types, different inputs are required. instructions, so it is inconvenient to operate and is not conducive to improving image processing efficiency. At the same time, users are also required to manually calculate the amount of data moved each time, which makes it difficult to fully utilize the on-chip memory and easily leads to an increase in the number of data moves, which consumes computing time.
因此,本实施例中,优选的,根据行索引范围提取深度图像中的一行深度数据及二维图像中对应的至少一行二维数据组成一组待处理数据,将一组待处理数据搬运到处理器40的内存中,通过处理器40对该组待处理数据进行对齐处理,确定该组待处理数据中深度数据对应的二维数据,然后将下一组处理数据搬运到内存中进行对齐处理,直到每一组待处理数据都完成对齐处理。其中,一组内存存储数据的数据量之和不大于处理器40的内存大小,一组内存存储数据包括一组待处理数据以及对该组待处理数据进行对齐处理后获得的已处理数据。Therefore, in this embodiment, preferably, a row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image are extracted according to the row index range to form a set of data to be processed, and the set of data to be processed is transported to the processing In the memory of the processor 40, the processor 40 performs alignment processing on the set of data to be processed, determines the two-dimensional data corresponding to the depth data in the set of data to be processed, and then transfers the next set of processed data to the memory for alignment processing. Until each set of data to be processed is aligned. The sum of the data amounts of a set of memory storage data is not greater than the memory size of the processor 40 , and a set of memory storage data includes a set of data to be processed and processed data obtained by aligning the set of data to be processed.
更进一步的,也可以同时搬运多组待处理数据到处理器40中同步进行对 齐处理。需要说明的是,受处理器40的内存大小的限制,每次只能搬运几行到几十行数据到片上内存中进行处理,因此,可以根据实际需求预先对深度图像和二维图像进行划分确定每次需要搬运的待处理数据。具体的,本实施例中,可以根据预先确定的行索引范围来确定深度图像中一行在二维图像中对应的行数,从而确定深度图像中一行对应的需要进行处理的数据量,从而可以进行数据分组(例如,确定将深度图像中的几行确定为一组)。如此,基于预先确定的行索引范围即可以确定每次需要计算几行、可以搬运几行的数据到片上内存。如此,可以降低计算量和搬移数据的次数。同时,上述图像处理系统还可以适用于不同相机模组采集的不同图像数据(例如分辨率不同)的图像数据,对不同的图像数据进行适当的分组搬运,使得D2C算法适应不同模组之间的差异,不需要过多人工干预即可充分利用DSP的硬件性能。Furthermore, multiple sets of data to be processed can also be transported to the processor 40 at the same time for alignment processing. It should be noted that due to the limitation of the memory size of the processor 40, only a few lines to dozens of lines of data can be transferred to the on-chip memory for processing at a time. Therefore, the depth image and the two-dimensional image can be divided in advance according to actual needs. Determine the data to be processed that needs to be moved each time. Specifically, in this embodiment, the number of rows corresponding to one row in the depth image in the two-dimensional image can be determined according to the predetermined row index range, thereby determining the amount of data that needs to be processed corresponding to one row in the depth image, so that the processing can be performed Grouping of data (for example, determining how many rows in a depth image are grouped together). In this way, based on the predetermined row index range, it can be determined how many rows need to be calculated each time and how many rows of data can be transferred to the on-chip memory. In this way, the amount of calculation and the number of data moves can be reduced. At the same time, the above image processing system can also be applied to image data of different image data (such as different resolutions) collected by different camera modules, and performs appropriate grouping and handling of different image data, so that the D2C algorithm can adapt to the differences between different modules. Difference, you can make full use of the hardware performance of DSP without too much manual intervention.
本实施例中,根据内存大小和上述行索引范围分别对深度图像和二维图像进行划分获得多组待处理数据。需要说明的是,其中,每组所述待处理数据包括至少一行深度数据以及对应的多行二维数据,且相邻行待处理数据共享部分二维数据。其中,共享部分二维数据是指相邻行的待处理数据对应的二维数据可能存在重叠部分,对于重叠部分可以对齐过程中保留并重复使用,不需要重复进行搬运。In this embodiment, the depth image and the two-dimensional image are divided respectively according to the memory size and the above row index range to obtain multiple sets of data to be processed. It should be noted that each group of the data to be processed includes at least one row of depth data and corresponding multiple rows of two-dimensional data, and adjacent rows of data to be processed share part of the two-dimensional data. Among them, the shared part of two-dimensional data means that the two-dimensional data corresponding to the data to be processed in adjacent rows may have overlapping parts. The overlapping parts can be retained and reused during the alignment process, and there is no need to repeatedly transport them.
例如,一组待处理图像中包括深度图像中的第1行和第2行,其中,深度图像中第1行对应的行索引范围为二维图像的1到3行,深度图像中第2行对应的行索引范围为二维图像的2到5行,则上述一待处理数据包括二维图像中第1到5行的所有数据,在进行对齐处理时第一行深度数据和第二行深度数据可以共享第2到第3行二维数据。如此,可以保证每次进行图像对齐处理时需要用到的数据都被搬运到片上内存中而又避免了重复搬用造成数据量的浪费。For example, a set of images to be processed includes rows 1 and 2 in the depth image, where the row index corresponding to row 1 in the depth image ranges from rows 1 to 3 in the two-dimensional image, and row 2 in the depth image The corresponding row index range is 2 to 5 rows of the two-dimensional image, then the above-mentioned data to be processed includes all the data of rows 1 to 5 in the two-dimensional image. When performing alignment processing, the depth data of the first row and the depth of the second row are Data can share rows 2 to 3 of 2D data. In this way, it can be ensured that the data required for each image alignment process is transferred to the on-chip memory and avoids wasting the amount of data caused by repeated transfer.
同时,还需考虑片上内存的存储空间,即一组内存存储数据的数据量之和不大于上述片上内存大小,一组内存存储数据包括一组待处理数据以及与该组待处理数据对应的已处理数据。需要说明的是,在DSP上不仅需要搬运输入的 数据(一组待处理数据),也需要搬运输出的数据(对齐后的图像数据,Aligned_Depth),即该组待处理数据对应的已处理数据,计算时使用到的这两块数据需要同时在片上内存中存储,而片上的内存大小是固定的,因此需要限定一组内存存储数据的数据量之和不大于上述片上内存大小。At the same time, it is also necessary to consider the storage space of the on-chip memory, that is, the sum of the data amount of a set of memory storage data is not greater than the above-mentioned on-chip memory size. A set of memory storage data includes a set of data to be processed and the data corresponding to the set of data to be processed. Data processing. It should be noted that not only the input data (a set of data to be processed) needs to be transported on the DSP, but also the output data (aligned image data, Aligned_Depth), that is, the processed data corresponding to the group of data to be processed, needs to be transported. The two pieces of data used in the calculation need to be stored in the on-chip memory at the same time, and the on-chip memory size is fixed. Therefore, it is necessary to limit the sum of the data amount of a set of memory storage data to not be greater than the above-mentioned on-chip memory size.
在一种应用场景中,每一组上述待处理数据中包括第一待处理数据和第二待处理数据,上述第一待处理数据是上述深度图像中待处理行对应的数据,上述第二待处理数据是上述二维图像中与上述待处理行对应的行索引范围内的所有数据,上述待处理行包括所述深度图像中的至少一行。对应的,可以根据行索引范围提取深度图像中的至少一行深度数据及二维图像中对应的至少一行二维数据组成至少一组待处理数据,具体包括:根据处理器40的内存大小和行索引范围分别对深度图像和二维图像进行划分并提取多组待处理数据,其中,每一组待处理数据包括第一待处理数据和第二待处理数据,第一待处理数据是深度图像中待处理行对应的数据,第二待处理数据是二维图像中与待处理行对应的行索引范围内的所有数据,待处理行包括深度图像中的至少一行。In one application scenario, each group of the above-mentioned data to be processed includes first data to be processed and second data to be processed. The above-mentioned first data to be processed is the data corresponding to the row to be processed in the above-mentioned depth image, and the above-mentioned second data to be processed is The processed data is all data in the row index range corresponding to the row to be processed in the two-dimensional image, and the row to be processed includes at least one row in the depth image. Correspondingly, at least one row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image can be extracted according to the row index range to form at least one set of data to be processed, which specifically includes: according to the memory size and row index of the processor 40 The scope divides the depth image and the two-dimensional image respectively and extracts multiple groups of data to be processed, wherein each group of data to be processed includes first data to be processed and second data to be processed, and the first data to be processed is the data to be processed in the depth image. The data corresponding to the row is processed, and the second data to be processed is all data in the row index range in the two-dimensional image corresponding to the row to be processed, and the row to be processed includes at least one row in the depth image.
需要说明的是,根据输入数据的数据量可以获取对应的输出数据的数据量,从而限制每次搬运的数据。例如,在一种应用场景中,可以预先设置深度图像的一行对应数据量、RGB图像的一行对应的数据量,由于对齐后获得的输出数据是包含RGB图像信息和深度信息的数据,即数据类型是确定的,且深度图像中的一个像素点可以对应一个输出像素点数据,输出数据的行数和数据量可以根据输入的待处理数据确定。本实施例中,只需要保证输入数据的大小和输出数据的大小总和不超过片上内存的大小即可。It should be noted that the data volume of the corresponding output data can be obtained according to the data volume of the input data, thereby limiting the data transferred each time. For example, in one application scenario, the amount of data corresponding to one line of the depth image and the amount of data corresponding to one line of the RGB image can be preset. Since the output data obtained after alignment is data containing RGB image information and depth information, that is, the data type is certain, and one pixel in the depth image can correspond to one output pixel data, and the number of rows and data volume of the output data can be determined based on the input data to be processed. In this embodiment, it is only necessary to ensure that the sum of the size of the input data and the size of the output data does not exceed the size of the on-chip memory.
对于不同的相机模组,相机的内参不同,因此获取的深度图像中各行对应的行索引范围也不同,因此不同的相机模组一次能搬运的待处理数据的行数也不同。例如,一种相机模组产生的数据一次能搬运8行,则480行数据需要60次才能计算完。另一种相机模组产生的数据一次能搬运10行,则480行数据只需要搬运48次。搬运的次数越小,系统的开销也越小。基于本实施例中的方案, 可以充分利用DSP的性能,合理地进行数据分组,获取多组待处理数据,并依次对每一组待处理数据进行处理,从而在合理利用DSP的内存和处理能力的同时提高图像对齐处理的效率。For different camera modules, the internal parameters of the camera are different, so the row index range corresponding to each row in the acquired depth image is also different, so the number of rows of data to be processed that different camera modules can handle at one time is also different. For example, if the data generated by a camera module can transfer 8 lines at a time, then 480 lines of data will need to be calculated 60 times. The data generated by another camera module can be transferred 10 lines at a time, so 480 lines of data only need to be transferred 48 times. The smaller the number of transfers, the smaller the system overhead. Based on the solution in this embodiment, the performance of the DSP can be fully utilized, the data can be grouped reasonably, multiple groups of data to be processed can be obtained, and each group of data to be processed can be processed in turn, thereby rationally utilizing the memory and processing capabilities of the DSP. while improving the efficiency of image alignment processing.
需要说明的是,不同的图像分辨率也会导致搬运次数不同,即一行的像素点数目越多,一次能搬运的行数越少,例如1280*960的图像可能一次只能搬运4行数据。而基于本实施例中的图像处理系统,可以自适应不同的模组采集的不同分辨率的图像,从而提高对应的算法代码的利用率,无需用户在切换模组和分辨率时修改对应的代码,有利于提高图像处理过程的适用性,且方便在不同的场景进行图像对齐处理。It should be noted that different image resolutions will also lead to different transfer times. That is, the more pixels in a row, the fewer rows that can be transferred at one time. For example, a 1280*960 image may only be able to transfer 4 lines of data at a time. Based on the image processing system in this embodiment, it can adapt to images of different resolutions collected by different modules, thereby improving the utilization of the corresponding algorithm codes and eliminating the need for users to modify the corresponding codes when switching modules and resolutions. , which is helpful to improve the applicability of the image processing process and facilitate image alignment processing in different scenarios.
同时,本实施例中计算出来的行索引范围是基于最大探测值和最小探测值计算获得的一个大致范围,而并不是基于深度图像中每一个像素点的具体深度值计算获得的精确的范围,因此连续几个待对齐行中可能会出现重叠的行索引范围(也可能不存在重叠的行索引范围),即对应的相邻行深度数据可能可以共享重叠的行索引范围内的二维数据。而重叠的行索引范围中对应的数据如果重复搬运,则会浪费时间。因此,本实施例中,上述系统还用于:At the same time, the row index range calculated in this embodiment is a rough range calculated based on the maximum detection value and the minimum detection value, rather than an exact range calculated based on the specific depth value of each pixel in the depth image. Therefore, overlapping row index ranges may appear in several consecutive rows to be aligned (or there may not be overlapping row index ranges), that is, corresponding adjacent row depth data may share two-dimensional data within overlapping row index ranges. If the corresponding data in the overlapping row index range is moved repeatedly, time will be wasted. Therefore, in this embodiment, the above system is also used for:
搬运第i组上述待处理数据时,获取第i组待处理数据与第i-1组待处理数据的行索引重叠范围,保留片上内存中的重叠数据,将待搬运数据搬运到片上内存中;When transporting the i-th group of the above-mentioned data to be processed, obtain the row index overlapping range of the i-th group of data to be processed and the i-1 group of data to be processed, retain the overlapping data in the on-chip memory, and transport the data to be transported to the on-chip memory;
其中,重叠数据是第i-1组待处理数据中与行索引重叠范围对应的数据,待搬运数据是第i组待处理数据中行索引重叠范围以外的数据。Among them, the overlapping data is the data corresponding to the overlapping range of the row index in the i-1 group of data to be processed, and the data to be transferred is the data outside the overlapping range of the row index in the i-th group of data to be processed.
图3是本发明实施例提供的一种深度图像和RGB图像的映射关系示意图,图3中,假设深度图像中的一组待处理数据包括深度图像中的一行数据以及RGB图像中的多行数据。如图3所示,深度图像中的第i-1行数据和第i行数据对应的行索引范围有重叠,对应的重叠数据是图3中RGB图像中虚线之间的数据。在对第i-1组待处理数据进行处理时,重叠数据会被搬运到片上内存中,而在对第i组待处理数据进行处理时,也需要用到重叠数据。因此,基于 本实施例中的方案,可以保留片上内存中的重叠数据,或根据实际需求对重叠数据在片上内存上进行搬运即可(在片上内存内部搬运的速度远快于SDRAM和片上内存之间的搬运速度),如此,可以减少数据搬运过程中的冗余搬运操作,有利于减少数据搬运的时间,提升整个系统运行的速度,从而提升图像对齐处理的效率。Figure 3 is a schematic diagram of the mapping relationship between a depth image and an RGB image provided by an embodiment of the present invention. In Figure 3, it is assumed that a set of data to be processed in the depth image includes one line of data in the depth image and multiple lines of data in the RGB image. . As shown in Figure 3, the row index ranges corresponding to the i-1th row of data and the i-th row of data in the depth image overlap, and the corresponding overlapping data is the data between the dotted lines in the RGB image in Figure 3. When processing the i-1th group of data to be processed, the overlapping data will be transferred to the on-chip memory, and when processing the i-th group of data to be processed, the overlapping data also needs to be used. Therefore, based on the solution in this embodiment, the overlapping data in the on-chip memory can be retained, or the overlapping data can be transported on the on-chip memory according to actual needs (the speed of internal transportation in the on-chip memory is much faster than that between SDRAM and on-chip memory) (transfer speed between data transfers). In this way, redundant transfer operations during the data transfer process can be reduced, which is beneficial to reducing the time of data transfer, increasing the speed of the entire system operation, thereby improving the efficiency of image alignment processing.
在一种应用场景中,还可以结合单指令多数据(SIMD,Single Instruction Multiple Data)技术进行上述图像处理过程,进一步提高图像数据对齐处理的速度。In one application scenario, the above image processing process can also be performed in combination with Single Instruction Multiple Data (SIMD, Single Instruction Multiple Data) technology to further improve the speed of image data alignment processing.
需要说明的是,本实施例中是在数字信号处理器上分批进行图像对齐处理,实际使用过程中,还可以通过CPU分批进行图像对齐处理,或者采用FPGA、数字芯片等分批进行图像对齐处理,对图像处理器进行合理且充分的使用。It should be noted that in this embodiment, the image alignment processing is performed in batches on the digital signal processor. In actual use, the image alignment processing can also be performed in batches through the CPU, or the image alignment processing can be performed in batches using FPGA, digital chips, etc. Alignment processing, reasonable and full use of the image processor.
由上可见,本实施例中,获取3D相机模组的先验信息(包括深度图像中各行对应的行索引范围),根据先验信息对数据进行分组,获取多组待处理数据,依次搬运和处理各组待处理数据,在保证每次需要存储的数据不超过数字信号处理器的片上内存的条件下充分利用数字信号处理器的性能,减少数据搬运次数,从而可以降低硬件系统的功耗,使得3D相机模组能够适用于各种场景。同时,上述系统还可以自适应不同的3D相机模组,可以考虑不同模组的标定参数的差异,根据具体的标定参数进行配置,充分利用DSP的硬件性能,且基于DSP对数据进行并行化处理。As can be seen from the above, in this embodiment, the prior information of the 3D camera module (including the row index range corresponding to each row in the depth image) is obtained, the data is grouped according to the prior information, multiple groups of data to be processed are obtained, and the data are transported and processed in sequence. Process each set of data to be processed, make full use of the performance of the digital signal processor and reduce the number of data transfers while ensuring that the data that needs to be stored each time does not exceed the on-chip memory of the digital signal processor, thereby reducing the power consumption of the hardware system. This enables the 3D camera module to be suitable for various scenarios. At the same time, the above system can also adapt to different 3D camera modules. It can consider the differences in calibration parameters of different modules, configure according to specific calibration parameters, make full use of the hardware performance of DSP, and perform parallel processing of data based on DSP. .
同时,本实施例中,还考虑需要搬运的数据中的重叠数据,避免重叠数据的重复搬运,进一步降低处理时间,提升图像对齐处理的效率,方便进行图像对齐之后的操作流程(例如人脸识别),有利于提升用户的使用体验。At the same time, in this embodiment, overlapping data in the data that needs to be transferred is also considered to avoid repeated transfer of overlapping data, further reduce processing time, improve the efficiency of image alignment processing, and facilitate the operation process after image alignment (such as face recognition). ), which is conducive to improving the user experience.
如图4中所示,对应于上述图像处理系统,本发明实施例还提供一种图像处理方法,上述方法应用于上述任意一种图像处理系统,上述方法包括:As shown in Figure 4, corresponding to the above image processing system, an embodiment of the present invention also provides an image processing method. The above method is applied to any of the above image processing systems. The above method includes:
步骤S100,通过深度相机采集目标场景的深度图像并存入存储器;Step S100, collect the depth image of the target scene through the depth camera and store it in the memory;
步骤S200,通过二维相机采集目标场景的二维图像并存入存储器;Step S200, collect the two-dimensional image of the target scene through the two-dimensional camera and store it in the memory;
步骤S300,获取上述存储器中预先存储的上述深度相机和上述二维相机之间的标定信息以及上述深度相机的深度测量范围;Step S300, obtain the calibration information between the depth camera and the two-dimensional camera pre-stored in the memory and the depth measurement range of the depth camera;
步骤S400,通过处理器根据上述标定信息和上述深度测量范围确定上述深度图像的每一行在上述二维图像中对应的行索引范围,并根据上述行索引范围提取上述深度图像中的至少一行深度数据及上述二维图像中对应的至少一行二维数据进行对齐处理确定上述深度数据对应的二维数据。Step S400: The processor determines the row index range corresponding to each row of the depth image in the two-dimensional image based on the calibration information and the depth measurement range, and extracts at least one row of depth data in the depth image based on the row index range. and at least one corresponding row of two-dimensional data in the above-mentioned two-dimensional image are aligned to determine the two-dimensional data corresponding to the above-mentioned depth data.
其中,深度图像和二维图像是需要进行对齐处理的图像,目标场景是进行图像拍摄的场景。本实施例中,以对两个图像进行对齐处理为例进行说明,实际使用过程中,可以基于图像处理方法对多个图像进行对齐处理,即二维图像不止一幅,例如,将深度图像和第一二维图像对齐后获得第一对齐图像,将第二二维图像与第一对齐图像进行对齐处理获得第二对齐图像,从而实现三个图像之间的对齐处理。Among them, the depth image and the two-dimensional image are images that need to be aligned, and the target scene is the scene where the image is captured. In this embodiment, the alignment process of two images is taken as an example for explanation. In actual use, multiple images can be aligned based on the image processing method, that is, there is more than one two-dimensional image. For example, the depth image and The first aligned image is obtained after the first two-dimensional image is aligned, and the second aligned image is obtained by aligning the second two-dimensional image with the first aligned image, thereby realizing alignment processing between the three images.
本实施例中,将深度图像与二维图像(例如RGB图像)进行对齐,可以实现将深度图像中的深度信息映射到二维图像的对应像素上,有利于结合深度信息辅助二维图像进行三维信息识别(例如3D人脸识别)。In this embodiment, by aligning the depth image with the two-dimensional image (such as an RGB image), the depth information in the depth image can be mapped to the corresponding pixels of the two-dimensional image, which is beneficial to assisting the two-dimensional image in three-dimensional processing by combining the depth information. Information recognition (such as 3D face recognition).
需要说明的是,本实施例中,深度图像和二维图像是通过不同相机拍摄获取的,深度图像是深度相机拍摄获得,二维图像是二维相机拍摄获得的。具体的,二维图像为待对齐RGB图像,是利用RGB相机拍摄获得。基于本实施例中的图像处理方法,对待对齐深度图像和待对齐RGB图像进行图像对齐处理,将深度信息映射到彩色图像(待对齐RGB图像)的像素上,从而进一步基于彩色图像进行图像识别,获取对应的环境或被拍摄的对象的信息,有利于更好地实现对于深度信息的利用。It should be noted that in this embodiment, the depth image and the two-dimensional image are captured by different cameras. The depth image is captured by the depth camera, and the two-dimensional image is captured by the two-dimensional camera. Specifically, the two-dimensional image is an RGB image to be aligned, which is captured by an RGB camera. Based on the image processing method in this embodiment, image alignment processing is performed on the depth image to be aligned and the RGB image to be aligned, and the depth information is mapped to the pixels of the color image (RGB image to be aligned), thereby further performing image recognition based on the color image, Obtaining information about the corresponding environment or the object being photographed is conducive to better utilization of depth information.
具体的,标定信息包括深度相机的内参、二维相机的内参、深度相机和二维相机之间的旋转矩阵以及深度相机和二维相机之间的平移矩阵,深度测量范围包括深度相机的最大探测值和最小探测值。Specifically, the calibration information includes the internal parameters of the depth camera, the internal parameters of the two-dimensional camera, the rotation matrix between the depth camera and the two-dimensional camera, and the translation matrix between the depth camera and the two-dimensional camera. The depth measurement range includes the maximum detection of the depth camera. value and minimum detection value.
本实施例中,基于标定信息可以对待对齐深度图像和待对齐RGB图像进 行对齐处理。同时,基于深度图像中的最大探测值和最小探测值可以确定深度图像中各行在二维图像中可能对应的行索引范围,从而方便对深度图像和二维图像进行分行对齐,即实现数据的分批处理。In this embodiment, the depth image to be aligned and the RGB image to be aligned can be aligned based on the calibration information. At the same time, based on the maximum detection value and the minimum detection value in the depth image, the possible corresponding row index range of each line in the depth image in the two-dimensional image can be determined, thereby facilitating line-by-line alignment of the depth image and the two-dimensional image, that is, realizing data separation. Batch processing.
其中,深度图像中一行对应的行索引范围是该行中的像素点在二维图像中对应的各个像素点可能存在的行的索引范围。Among them, the row index range corresponding to a row in the depth image is the index range of rows in which each pixel point corresponding to the pixel point in the row may exist in the two-dimensional image.
本实施例中,处理器是图像处理器,且具体为用于进行图像对齐处理的图像处理器处理器,图像处理器可以为数字信号处理器。具体的,基于本实施例中的方法,可以对所有需要进行图像对齐处理的数据(包括深度图像和二维图像中的所有数据)进行分组(分批)处理,因此并不要求对应的图像处理器的硬件性能非常高,从而可以直接基于深度相机(或3D相机模组)中的数字信息处理器进行处理,无需使用额外的宿主机或移动终端,不仅可以提高D2C算法的计算效率,还可以减少系统消耗资源,降低硬件的功耗,且可以提高适用性。可见,与现有技术中使用宿主机和移动终端的CPU的方案不同,本实施例中基于数字信号处理器进行图像对齐处理的计算过程,如此,可以降低移动终端CPU的负担并降低整个系统的功耗。基于上述实施例,本发明还提供了一种智能终端,其原理框图可以如图5所示。智能终端包括处理器及存储器。该智能终端的存储器包括图像处理程序,存储器为图像处理程序的运行提供环境。该图像处理程序被处理器执行时实现上述任意一种图像处理方法的步骤。需要说明的是,智能终端还可以包括其它功能模块或单元,在此不作具体限定。In this embodiment, the processor is an image processor, and is specifically an image processor used for image alignment processing. The image processor may be a digital signal processor. Specifically, based on the method in this embodiment, all data that require image alignment processing (including all data in depth images and two-dimensional images) can be grouped (batch) processed, so corresponding image processing is not required. The hardware performance of the processor is very high, so it can be processed directly based on the digital information processor in the depth camera (or 3D camera module) without using an additional host or mobile terminal. This not only improves the computing efficiency of the D2C algorithm, but also Reduce system resource consumption, reduce hardware power consumption, and improve applicability. It can be seen that, unlike the prior art solution that uses the CPU of the host machine and the mobile terminal, the calculation process of the image alignment process is based on a digital signal processor in this embodiment. In this way, the burden on the mobile terminal CPU can be reduced and the cost of the entire system can be reduced. power consumption. Based on the above embodiments, the present invention also provides an intelligent terminal, the functional block diagram of which can be shown in Figure 5 . Smart terminals include processors and memories. The memory of the smart terminal includes an image processing program, and the memory provides an environment for the execution of the image processing program. When the image processing program is executed by the processor, the steps of any of the above image processing methods are implemented. It should be noted that the smart terminal may also include other functional modules or units, which are not specifically limited here.
本领域技术人员可以理解,图5中示出的原理框图,仅仅是与本发明方案相关的部分结构的框图,并不构成对本发明方案所应用于其上的智能终端的限定,具体地智能终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the principle block diagram shown in Figure 5 is only a block diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the smart terminal to which the solution of the present invention is applied. Specifically, the smart terminal More or fewer components may be included than shown in the figures, or certain components may be combined, or may have a different arrangement of components.
在一个实施例中,图像处理程序被处理器执行时进行以下操作指令:In one embodiment, the image processing program performs the following operation instructions when executed by the processor:
利用深度相机和二维相机分别获取目标场景的深度图像和二维图像;Use the depth camera and the 2D camera to obtain the depth image and 2D image of the target scene respectively;
获取深度相机和二维相机之间的标定信息以及深度相机测量的深度测量范 围,标定信息是深度相机和二维相机之间的位姿标定信息;Obtain the calibration information between the depth camera and the two-dimensional camera and the depth measurement range measured by the depth camera. The calibration information is the pose calibration information between the depth camera and the two-dimensional camera;
根据标定信息和深度测量范围获取深度图像的每一行在二维图像中对应的行索引范围;Obtain the row index range corresponding to each row of the depth image in the two-dimensional image according to the calibration information and the depth measurement range;
根据行索引范围提取深度图像中的至少一行深度数据及二维图像中对应的至少一行二维数据组成至少一组待处理数据,对待处理数据进行对齐处理确定深度数据对应的二维数据。Extract at least one row of depth data in the depth image and at least one corresponding row of two-dimensional data in the two-dimensional image according to the row index range to form at least one set of data to be processed, and perform alignment processing on the data to be processed to determine the two-dimensional data corresponding to the depth data.
本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有图像处理程序,图像处理程序被处理器执行时实现本发明实施例提供的任意一种图像处理方法的步骤。Embodiments of the present invention also provide a computer-readable storage medium. An image processing program is stored on the computer-readable storage medium. When the image processing program is executed by a processor, the steps of any image processing method provided by the embodiments of the present invention are implemented.
应理解,上述实施例中各步骤的序号大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should be understood that the sequence number of each step in the above embodiment does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将上述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units and modules is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs. Module completion means dividing the internal structure of the above device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be hardware-based. It can also be implemented in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of distinguishing each other and are not used to limit the scope of the present invention. For the specific working processes of the units and modules in the above system, please refer to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not detailed or documented in a certain embodiment, please refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各实例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来 实现。这些功能究竟是以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered to be beyond the scope of the present invention.
在本发明所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,上述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以由另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/terminal equipment and methods can be implemented in other ways. For example, the apparatus/terminal equipment embodiments described above are only illustrative. For example, the division of the above modules or units is only a logical function division. In actual implementation, it can be divided in other ways, such as multiple units or units. Components may be combined or may be integrated into another system, or some features may be ignored, or not implemented.
上述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,上述计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,上述计算机程序包括计算机程序代码,上述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。上述计算机可读介质可以包括:能够携带上述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,上述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减。If the above-mentioned integrated modules/units are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the above-mentioned embodiment methods, and can also be completed by instructing relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of each of the above method embodiments can be implemented. Wherein, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code may be in the form of source code, object code, executable file or some intermediate form, etc. The above-mentioned computer-readable media may include: any entity or device capable of carrying the above-mentioned computer program code, recording media, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random accessory Access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, etc. It should be noted that the content contained in the above computer-readable storage media can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
以上所述实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解;其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不是相应技术方案的本质脱离本发明各实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that they can still implement the above-mentioned implementations. Modifications are made to the technical solutions described in the examples, or equivalent substitutions are made to some of the technical features; however, these modifications or substitutions do not mean that the essence of the corresponding technical solutions deviates from the spirit and scope of the technical solutions of each embodiment of the present invention, and they should all be included in this document. within the scope of protection of the invention.

Claims (10)

  1. 一种图像处理系统,其特征在于,包括:An image processing system, characterized by including:
    深度相机,被配置为采集目标场景的深度图像;a depth camera configured to collect depth images of the target scene;
    二维相机,被配置为采集目标场景的二维图像;a two-dimensional camera configured to collect two-dimensional images of the target scene;
    存储器,被配置为存储所述深度图像、二维图像、所述深度相机和所述二维相机之间的标定信息以及所述深度相机的深度测量范围;A memory configured to store the depth image, the two-dimensional image, the calibration information between the depth camera and the two-dimensional camera, and the depth measurement range of the depth camera;
    处理器,被配置为根据所述标定信息和所述深度测量范围确定所述深度图像的每一行在所述二维图像中对应的行索引范围,并根据所述行索引范围提取所述深度图像中的至少一行深度数据及所述二维图像中对应的至少一行二维数据进行对齐处理确定所述深度数据对应的二维数据。A processor configured to determine the row index range corresponding to each row of the depth image in the two-dimensional image according to the calibration information and the depth measurement range, and to extract the depth image according to the row index range. At least one row of depth data in the two-dimensional image and at least one corresponding row of two-dimensional data in the two-dimensional image are aligned to determine the two-dimensional data corresponding to the depth data.
  2. 根据权利要求1所述的图像处理系统,其特征在于,所述根据所述行索引范围提取所述深度图像中的至少一行深度数据及所述二维图像中对应的至少一行二维数据进行对齐处理确定所述深度数据对应的二维数据,包括:The image processing system according to claim 1, wherein at least one row of depth data in the depth image and corresponding at least one row of two-dimensional data in the two-dimensional image are extracted according to the row index range for alignment. Processing and determining the two-dimensional data corresponding to the depth data includes:
    根据所述处理器的内存大小和所述行索引范围对所述深度图像和所述二维图像进行划分并提取多组待处理数据,其中,每组所述待处理数据包括至少一行深度数据以及对应的多行二维数据,且相邻行深度数据共享部分二维数据。The depth image and the two-dimensional image are divided according to the memory size of the processor and the row index range and multiple groups of data to be processed are extracted, wherein each group of the data to be processed includes at least one row of depth data and Corresponding multiple rows of two-dimensional data, and adjacent rows of depth data share part of the two-dimensional data.
  3. 根据权利要求2所述的图像处理系统,其特征在于,所述对所述待处理数据进行对齐处理确定所述深度数据对应的二维数据,包括:The image processing system according to claim 2, wherein the alignment process on the data to be processed to determine the two-dimensional data corresponding to the depth data includes:
    将一组所述待处理数据搬运到所述处理器的内存中,通过所述处理器对该组待处理数据进行对齐处理,确定该组待处理数据中所述深度数据对应的二维数据,然后将下一组所述待处理数据搬运到所述内存中进行对齐处理,直到每一组所述待处理数据都完成对齐处理;transporting a set of the data to be processed to the memory of the processor, aligning the set of data to be processed by the processor, and determining the two-dimensional data corresponding to the depth data in the set of data to be processed, Then, the next set of data to be processed is transferred to the memory for alignment processing until each set of data to be processed is completed.
    其中,一组内存存储数据的数据量之和不大于所述处理器的内存大小,一组所述内存存储数据包括一组所述待处理数据以及对该组待处理数据进行对齐处理后获得的已处理数据。Wherein, the sum of the data amounts of a set of memory storage data is not greater than the memory size of the processor, and a set of memory storage data includes a set of the to-be-processed data and a set of data obtained by aligning the set of to-be-processed data. Data processed.
  4. 根据权利要求3所述的图像处理系统,其特征在于,所述图像处理系 统还用于:The image processing system according to claim 3, characterized in that the image processing system is also used for:
    搬运第i组所述待处理数据时,获取第i组所述待处理数据与第i-1组所述待处理数据的行索引重叠范围,保留所述内存中的重叠数据,将待搬运数据搬运到所述内存中;When transporting the data to be processed in the i-th group, obtain the row index overlapping range of the data to be processed in the i-th group and the data to be processed in the i-1 group, retain the overlapping data in the memory, and transfer the data to be transported transferred to the memory;
    其中,所述重叠数据是第i-1组所述待处理数据中与所述行索引重叠范围对应的数据,所述待搬运数据是第i组所述待处理数据中所述行索引重叠范围以外的数据。Wherein, the overlapping data is the data corresponding to the overlapping range of the row index in the i-1th group of data to be processed, and the data to be transported is the overlapping range of the row index in the i-th group of data to be processed. other data.
  5. 根据权利要求1所述的图像处理系统,其特征在于,所述存储器中存储的所述标定信息包括:所述深度相机的内参、所述二维相机的内参、所述深度相机和所述二维相机之间的旋转矩阵以及所述深度相机和所述二维相机之间的平移矩阵。The image processing system according to claim 1, characterized in that the calibration information stored in the memory includes: internal parameters of the depth camera, internal parameters of the two-dimensional camera, the depth camera and the two-dimensional camera. The rotation matrix between the 2D camera and the translation matrix between the depth camera and the 2D camera.
  6. 根据权利要求5所述的图像处理系统,其特征在于,所述存储器中存储的所述深度测量范围包括:所述深度相机的最大探测值和最小探测值。The image processing system according to claim 5, wherein the depth measurement range stored in the memory includes: a maximum detection value and a minimum detection value of the depth camera.
  7. 根据权利要求6所述的图像处理系统,其特征在于,所述根据所述标定信息和所述深度测量范围确定所述深度图像的每一行在所述二维图像中对应的行索引范围,包括:The image processing system according to claim 6, wherein determining the line index range corresponding to each line of the depth image in the two-dimensional image based on the calibration information and the depth measurement range includes: :
    根据所述深度相机的内参、所述二维相机的内参、所述旋转矩阵、所述平移矩阵、所述最大探测值和所述最小探测值分别获取所述深度图像的每一行对应的最大行索引和最小行索引;The maximum row corresponding to each row of the depth image is obtained according to the internal parameters of the depth camera, the internal parameters of the two-dimensional camera, the rotation matrix, the translation matrix, the maximum detection value and the minimum detection value. Index and minimum row index;
    根据所述最大行索引和所述最小行索引获取所述深度图像中每一行对应的所述行索引范围;Obtain the row index range corresponding to each row in the depth image according to the maximum row index and the minimum row index;
    其中,所述深度图像中一个待对齐行对应的行索引范围用于指示所述二维图像中目标对齐行的范围,所述二维图像中的目标对齐像素点属于所述目标对齐行,所述目标对齐像素点与所述待对齐行中任意一个待对齐像素点对应。Wherein, the row index range corresponding to a row to be aligned in the depth image is used to indicate the range of the target alignment row in the two-dimensional image, and the target alignment pixels in the two-dimensional image belong to the target alignment row, so The target alignment pixel corresponds to any pixel to be aligned in the row to be aligned.
  8. 一种图像处理方法,其特征在于,所述方法应用于如权利要求1-7任意一项所述的图像处理系统中,所述方法包括:An image processing method, characterized in that the method is applied to the image processing system according to any one of claims 1 to 7, and the method includes:
    通过深度相机采集目标场景的深度图像并存入存储器;Collect the depth image of the target scene through the depth camera and store it in the memory;
    通过二维相机采集目标场景的二维图像并存入存储器;Collect two-dimensional images of the target scene through a two-dimensional camera and store them in memory;
    获取所述存储器中预先存储的所述深度相机和所述二维相机之间的标定信息以及所述深度相机的深度测量范围;Obtain the calibration information between the depth camera and the two-dimensional camera and the depth measurement range of the depth camera pre-stored in the memory;
    通过处理器根据所述标定信息和所述深度测量范围确定所述深度图像的每一行在所述二维图像中对应的行索引范围,并根据所述行索引范围提取所述深度图像中的至少一行深度数据及所述二维图像中对应的至少一行二维数据进行对齐处理确定所述深度数据对应的二维数据。The processor determines the row index range corresponding to each row of the depth image in the two-dimensional image according to the calibration information and the depth measurement range, and extracts at least one of the depth images according to the row index range. One row of depth data and at least one corresponding row of two-dimensional data in the two-dimensional image are aligned to determine the two-dimensional data corresponding to the depth data.
  9. 一种智能终端,所述智能终端包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的图像处理程序,所述图像处理程序被所述处理器执行时实现如权利要求8所述图像处理方法的步骤。An intelligent terminal. The intelligent terminal includes a memory, a processor, and an image processing program stored on the memory and executable on the processor. When the image processing program is executed by the processor, the image processing program implements the following steps: The steps of the image processing method described in claim 8.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有图像处理程序,所述图像处理程序被处理器执行时实现如权利要求8所述图像处理方法的步骤。A computer-readable storage medium, characterized in that an image processing program is stored on the computer-readable storage medium, and when the image processing program is executed by a processor, the steps of the image processing method as claimed in claim 8 are implemented.
PCT/CN2022/100631 2022-04-01 2022-06-23 Image processing system and method, intelligent terminal, and computer readable storage medium WO2023184740A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210338866.8A CN114862658B (en) 2022-04-01 2022-04-01 Image processing system, method, intelligent terminal and computer readable storage medium
CN202210338866.8 2022-04-01

Publications (1)

Publication Number Publication Date
WO2023184740A1 true WO2023184740A1 (en) 2023-10-05

Family

ID=82628758

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/100631 WO2023184740A1 (en) 2022-04-01 2022-06-23 Image processing system and method, intelligent terminal, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN114862658B (en)
WO (1) WO2023184740A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103796001A (en) * 2014-01-10 2014-05-14 深圳奥比中光科技有限公司 Method and device for synchronously acquiring depth information and color information
CN104134188A (en) * 2014-07-29 2014-11-05 湖南大学 Three-dimensional visual information acquisition method based on two-dimensional and three-dimensional video camera fusion
US20170142392A1 (en) * 2015-11-13 2017-05-18 Craig Peterson 3d system including additional 2d to 3d conversion
CN109166077A (en) * 2018-08-17 2019-01-08 广州视源电子科技股份有限公司 Image alignment method, apparatus, readable storage medium storing program for executing and computer equipment
CN109741405A (en) * 2019-01-21 2019-05-10 同济大学 A kind of depth information acquisition system based on dual structure light RGB-D camera
CN112365530A (en) * 2020-11-04 2021-02-12 Oppo广东移动通信有限公司 Augmented reality processing method and device, storage medium and electronic equipment
CN112634152A (en) * 2020-12-16 2021-04-09 中科海微(北京)科技有限公司 Face sample data enhancement method and system based on image depth information
CN113781536A (en) * 2021-09-06 2021-12-10 广州极飞科技股份有限公司 Image alignment method and apparatus, electronic device, and computer-readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738703B (en) * 2019-09-27 2022-08-26 Oppo广东移动通信有限公司 Positioning method and device, terminal and storage medium
CN112116703A (en) * 2020-09-08 2020-12-22 苏州小优智能科技有限公司 3D camera and infrared light scanning algorithm for aligning point cloud and color texture

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103796001A (en) * 2014-01-10 2014-05-14 深圳奥比中光科技有限公司 Method and device for synchronously acquiring depth information and color information
CN104134188A (en) * 2014-07-29 2014-11-05 湖南大学 Three-dimensional visual information acquisition method based on two-dimensional and three-dimensional video camera fusion
US20170142392A1 (en) * 2015-11-13 2017-05-18 Craig Peterson 3d system including additional 2d to 3d conversion
CN109166077A (en) * 2018-08-17 2019-01-08 广州视源电子科技股份有限公司 Image alignment method, apparatus, readable storage medium storing program for executing and computer equipment
CN109741405A (en) * 2019-01-21 2019-05-10 同济大学 A kind of depth information acquisition system based on dual structure light RGB-D camera
CN112365530A (en) * 2020-11-04 2021-02-12 Oppo广东移动通信有限公司 Augmented reality processing method and device, storage medium and electronic equipment
CN112634152A (en) * 2020-12-16 2021-04-09 中科海微(北京)科技有限公司 Face sample data enhancement method and system based on image depth information
CN113781536A (en) * 2021-09-06 2021-12-10 广州极飞科技股份有限公司 Image alignment method and apparatus, electronic device, and computer-readable storage medium

Also Published As

Publication number Publication date
CN114862658B (en) 2023-05-05
CN114862658A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
US10726580B2 (en) Method and device for calibration
WO2021057742A1 (en) Positioning method and apparatus, device, and storage medium
CN101908231B (en) Reconstruction method and system for processing three-dimensional point cloud containing main plane scene
CN111673735A (en) Mechanical arm control method and device based on monocular vision positioning
WO2019184657A1 (en) Image recognition method, apparatus, electronic device and storage medium
CN108010123B (en) Three-dimensional point cloud obtaining method capable of retaining topology information
WO2022012085A1 (en) Face image processing method and apparatus, storage medium, and electronic device
WO2020237492A1 (en) Three-dimensional reconstruction method, device, apparatus, and storage medium
WO2021143127A1 (en) Parallax correction method and device, and storage medium
WO2021136386A1 (en) Data processing method, terminal, and server
WO2022183638A1 (en) Image feature matching method and related apparatus, device, and storage medium
WO2019127923A1 (en) Integrated circuit, image feature extraction method, and terminal
WO2020216249A1 (en) Target tracking and processing method based on multiple processors
EP3026629A1 (en) Method and apparatus for estimating depth of focused plenoptic data
WO2021007859A1 (en) Method and apparatus for estimating pose of human body
CN107633497A (en) A kind of image depth rendering intent, system and terminal
WO2021142843A1 (en) Image scanning method and device, apparatus, and storage medium
CN111739071A (en) Rapid iterative registration method, medium, terminal and device based on initial value
TW202242716A (en) Methods, apparatuses, devices and storage media for object matching
WO2023184740A1 (en) Image processing system and method, intelligent terminal, and computer readable storage medium
CN110136205A (en) The disparity adjustment method, apparatus and system of more mesh cameras
WO2023142732A1 (en) Image processing method and apparatus, and electronic device
CN116881886A (en) Identity recognition method, identity recognition device, computer equipment and storage medium
CN113538538B (en) Binocular image alignment method, electronic device, and computer-readable storage medium
CN212515897U (en) Active and passive three-dimensional imaging real-time processing system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22934563

Country of ref document: EP

Kind code of ref document: A1