Image recognition method and device

By directly using edge density and edge gradient direction feature quantities to identify moving areas in image recognition, the problem of low efficiency of the mixed Gaussian background modeling method is solved and faster moving area recognition is achieved.

CN112183560BActive Publication Date: 2024-09-06VIVO MOBILE COMM CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202011163160.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-27
Publication Date
2024-09-06
Estimated Expiration
2040-10-27

AI Technical Summary

Technical Problem

In the existing technology, the mixed Gaussian background modeling method is inefficient for identifying moving areas in images, requires a large number of images and multiple iterations, has a large amount of calculation, and is slow in recognition speed.

Method used

By obtaining the target image sequence, the edge density feature quantity and edge gradient direction feature quantity of the moving area are determined, and the moving area is determined when specific conditions are met, and the moving area is directly identified, avoiding the establishment of a complex Gaussian mixture model.

Benefits of technology

The efficiency of motion area recognition is improved, the amount of calculation is small, the recognition speed is fast, and the moving area in the image can be identified more quickly and accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112183560B
    Figure CN112183560B
Patent Text Reader

Abstract

The present application discloses an image recognition method and device, belonging to the field of image processing technology. The image recognition method comprises: obtaining a target image sequence, wherein the target image sequence comprises multiple frames of images; determining at least one motion region in the target image sequence; for each motion region, determining the edge density feature quantity and edge gradient direction feature quantity of the motion region; and determining the motion region as a target motion region when the edge density feature quantity and the edge gradient direction feature quantity meet the target conditions. The image recognition method and device of the present application can improve the recognition efficiency of the motion region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and specifically relates to an image recognition method and device. Background Art

[0002] With the development of electronic devices, electronic devices have professional image processing functions, such as high-dynamic range imaging (HDR), multi-frame noise reduction and super-resolution imaging. These professional image processing functions can synthesize multiple frames of images collected by electronic devices. When there are a large number of highlights, slightly moving and fine-textured objects (such as highlight leaves) in the shooting scene, large areas of blur will be produced after image synthesis (similar to the appearance of "burned" or "fuzzy" objects). Therefore, when synthesizing images, it is necessary to eliminate the moving areas of these objects. Before eliminating the movement of these objects, it is first necessary to identify the moving areas of these objects.

[0003] The related technology mainly uses the mixed Gaussian background modeling method to identify the moving areas of these objects.

[0004] However, in the process of implementing this application, the inventors found that there are at least the following problems in the related technology: the mixed Gaussian model of the mixed Gaussian background modeling method is relatively complex, requiring a large number of images and multiple iterations to complete the modeling, and the recognition efficiency of using the mixed Gaussian background modeling method to identify the moving areas of these objects is low. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide an image recognition method and device that can solve the problem of low efficiency in motion area recognition.

[0006] In order to solve the above technical problems, this application is implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides an image recognition method, comprising:

[0008] Acquire a target image sequence, wherein the target image sequence includes multiple frames of images;

[0009] determining at least one motion region in a target image sequence;

[0010] For each motion region, determine the edge density (ED) feature quantity and edge gradient direction (EGD) feature quantity of the motion region;

[0011] When the edge density feature quantity and the edge gradient direction feature quantity meet the target condition, the motion region is determined as the target motion region.

[0012] In a second aspect, an embodiment of the present application provides an image recognition device, including:

[0013] An acquisition module, used for acquiring a target image sequence, wherein the target image sequence includes multiple frames of images;

[0014] A first determination module, used to determine at least one motion region in a target image sequence;

[0015] A second determination module is used to determine the edge density feature quantity and the edge gradient direction feature quantity of each motion region;

[0016] The third determination module is used to determine the motion region as a target motion region when the edge density feature quantity and the edge gradient direction feature quantity meet the target condition.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0018] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0019] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the method described in the first aspect.

[0020] In an embodiment of the present application, after determining the motion region of the moving object in the target image sequence, the edge density feature quantity and the edge gradient direction feature quantity of the motion region are determined. In this way, when it is determined that the edge density feature quantity and the edge gradient direction feature quantity meet the target conditions, the motion region is determined as the target motion region, and the identification of the motion region is completed. Compared with the related art, the embodiment of the present application does not need to establish a mixed Gaussian model. The motion region can be identified through the edge density feature quantity and the edge gradient direction feature quantity of the motion region. The calculation amount is small and the recognition speed is fast. Therefore, the efficiency of motion region recognition can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a flowchart of an image recognition method provided by an embodiment of the present application;

[0022] Figure 2 It is a first schematic diagram of the circumscribed rectangular area of ​​the motion area;

[0023] Figure 3 It is a second schematic diagram of the circumscribed rectangular area of ​​the motion area;

[0024] Figure 4 is a schematic diagram of a circumscribed rectangular area of ​​a motion area provided in an embodiment of the present application;

[0025] Figure 5 It is a schematic diagram of the corresponding relationship between the area of ​​the motion region and the edge density feature quantity and the edge gradient direction feature quantity.

[0026] Figure 6 is a schematic diagram of data changes in the image recognition process provided by an embodiment of the present application;

[0027] Figure 7 is a structural schematic diagram of an image recognition device provided in an embodiment of the present application;

[0028] Figure 8 is a schematic diagram of an electronic device provided in an embodiment of the present application;

[0029] Fig. 9 It is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0032] The image recognition method and device provided in the embodiments of the present application are described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0033] Figure 1: is a flowchart of an image recognition method provided by an embodiment of the present application. The image recognition method may include:

[0034] S101: Acquire a target image sequence.

[0035] The target image sequence includes multiple frame images.

[0036] S102: Determine at least one motion region in a target image sequence.

[0037] S103: For each motion region, determine the edge density feature value and edge gradient direction feature value of the motion region.

[0038] S104: When the edge density feature quantity and the edge gradient direction feature quantity meet the target condition, the motion region is determined as a target motion region.

[0039] The specific implementation of the above steps will be described in detail below.

[0040] In an embodiment of the present application, after determining the motion region of the moving object in the target image sequence, the edge density feature quantity and the edge gradient direction feature quantity of the motion region are determined. In this way, when it is determined that the edge density feature quantity and the edge gradient direction feature quantity meet the target conditions, the motion region is determined as the target motion region, and the identification of the motion region is completed. Compared with the related art, the embodiment of the present application does not need to establish a mixed Gaussian model. The motion region can be identified through the edge density feature quantity and the edge gradient direction feature quantity of the motion region. The calculation amount is small and the recognition speed is fast. Therefore, the efficiency of motion region recognition can be improved.

[0041] In some possible implementations of the embodiments of the present application, the multiple frames of images in S101 may be multiple images continuously captured by an image capture device for a certain scene, for example, multiple images captured by continuous shooting with a mobile phone.

[0042] In some possible implementations of the embodiments of the present application, in S102, motion detection may be performed on the multiple frames of images acquired in S101 to obtain at least one region of interest (ROI) in the target image sequence.

[0043] In some possible implementations of the embodiments of the present application, each ROI in the at least one ROI may be used as a motion region.

[0044] In some possible implementations of the embodiments of the present application, each ROI in the at least one ROI may be divided into blocks, and each block of ROI is used as a motion region.

[0045] The embodiments of the present application do not limit the method used for motion detection of multiple frame images. Any available motion detection method can be applied to the embodiments of the present application, such as: global image alignment, bidirectional mapping of grayscale values, multi-frame grayscale difference and adaptive morphological filtering, etc.

[0046] In some possible implementations of the embodiments of the present application, S103 may include: determining a circumscribed rectangular area corresponding to the motion area; determining a structure tensor (ST) matrix corresponding to the motion area according to a first gradient of the motion area in a first direction, a second gradient of the motion area in a second direction, a first offset of the motion area in the first direction, and a second offset of the motion area in the second direction, wherein the first direction is perpendicular to the second direction; performing singular value decomposition on the structure tensor matrix with the center point coordinates and the first distance of the circumscribed rectangular area as parameters of the structure tensor matrix to obtain a first eigenvector and a second eigenvector corresponding to the structure tensor matrix; wherein the first distance is the distance from the center point to the vertex of the circumscribed rectangular area; and determining an edge density feature quantity and an edge gradient direction feature quantity according to the first eigenvector and the second eigenvector.

[0047] Figure 2 It is a first schematic diagram of the circumscribed rectangular area of ​​the motion area; Figure 3 It is a second schematic diagram of the circumscribed rectangular area of ​​the motion area. It can be understood that the circumscribed rectangle of the motion area obtained by taking different directions as the directions of the circumscribed rectangle sides is also different.

[0048] In some possible implementations of the embodiments of the present application, when determining the circumscribed rectangular area corresponding to the motion area, the circumscribed rectangular area corresponding to the motion area can be determined with the horizontal X direction and the vertical Y direction as the coordinate axes. When determining the circumscribed rectangular area corresponding to the motion area with the horizontal X direction and the vertical Y direction as the coordinate axes, the maximum X-axis coordinate, the minimum X-axis coordinate, the maximum Y-axis coordinate and the minimum Y-axis coordinate of the motion area are taken, and the boundaries of the circumscribed rectangle are determined based on the above four coordinates respectively, and the area enclosed by the four boundaries is determined as the circumscribed rectangular area corresponding to the motion area of ​​the embodiment of the present application. Figure 4 Schematic diagram of a circumscribed rectangular area of ​​a motion area provided in an embodiment of the present application.

[0049] In some possible implementations of the embodiment of the present application, the first direction of the embodiment of the present application may be the positive direction of the above-mentioned X-axis, and the second direction may be the positive direction of the Y-axis.

[0050] In some possible implementations of the embodiments of the present application, when determining the ST matrix corresponding to the motion area based on the first gradient of the motion area in the first direction, the second gradient of the motion area in the second direction, the first offset of the motion area in the first direction and the second offset of the motion area in the second direction, the coordinates of a point P on the motion area in the coordinate system with the X-axis and the Y-axis as coordinate axes can be set to (Px, Py), the gradients of the motion area in the above-mentioned first direction and second direction are Ix and Iy respectively, and the offsets of the motion area in the above-mentioned first direction and second direction are m and n respectively, then Ix is the first gradient, Iy is the second gradient, m is the first offset, and n is the second offset.

[0051] The ST matrix formula corresponding to point P on the motion area is:

[0052]

[0053] Among them, r in the above ST matrix is ​​the radius of the window corresponding to the ST matrix.

[0054] In an embodiment of the present application, when the structure tensor matrix is ​​subjected to singular value decomposition with the coordinates of the center point of the circumscribed rectangular area and the first distance as the parameters of the structure tensor matrix to obtain the first eigenvalue and the second eigenvalue corresponding to the structure tensor matrix, Px in the above ST matrix formula can be assigned to the X-axis coordinate of the center point of the above circumscribed rectangular area, Py in the above ST matrix formula can be assigned to the Y-axis coordinate of the center point of the above circumscribed rectangular area, and r in the above ST matrix formula can be assigned to the distance from the center point of the above circumscribed rectangular area to the vertex of the circumscribed rectangular area to obtain a new ST matrix.

[0055] The new ST matrix is ​​subjected to singular value decomposition to obtain two eigenvectors. In some possible implementations of the embodiment of the present application, the larger of the two eigenvectors is used as the first eigenvector, and the smaller of the two eigenvectors is used as the second eigenvector.

[0056] Among them, singular value decomposition (SVD) is a kind of matrix decomposition. By performing singular value decomposition on a matrix, the eigenvector corresponding to the matrix can be obtained.

[0057] Then, the edge density feature quantity and the edge gradient direction feature quantity are determined according to the first eigenvector and the second eigenvector.

[0058] In some possible implementations of the embodiments of the present application, determining the edge density feature quantity and the edge gradient direction feature quantity based on the first eigenvector and the second eigenvector can include: determining the sum of the first eigenvector and the second eigenvector as the edge density feature quantity; determining the quotient of the first difference and the edge density feature quantity as the edge gradient direction feature quantity; wherein the first difference is the difference between the first eigenvector and the second eigenvector, and the first eigenvector is greater than the second eigenvector.

[0059] Assume that the first eigenvector is λ1, the second eigenvector is λ2, the edge density feature is ED, and the edge gradient direction feature is EGD.

[0060] Then ED=λ1+λ2,

[0061] In some possible embodiments of the present application, when λ1>λ2, there is a main direction in the edge of the above window, and in particular, when λ1>0 and λ2=0, the edge gradient in the above window is the only main direction, indicating that the direction of the edge gradient of the motion region is highly consistent. When λ1=λ2, there is no main direction in the above window, and in particular, when λ1=λ2=0, the motion region is absolutely flat.

[0062] In some possible embodiments of the present application, the edge density feature ED is used to evaluate the flatness of the region, and the edge gradient direction feature EGD is used to evaluate the consistency of the edge gradient direction in the region. The larger the edge density feature ED is, the more uneven the region is, the more textures there are in the region, and the greater the edge density is; the smaller the edge gradient direction feature EGD is, the less consistent the direction of the edge gradient intensity is.

[0063] Generally, the area with a larger edge density feature ED or a smaller edge gradient direction feature EGD is a highlight area with slight movement of fine textured objects. Based on this, in some possible implementations of the embodiments of the present application, the target condition may include: the edge density feature is greater than the target edge density feature, and / or the edge gradient direction feature is less than the target edge gradient direction feature; wherein the target edge density feature may be an edge density feature corresponding to the area of ​​the motion region, and the target edge gradient direction feature may be an edge gradient direction feature corresponding to the area of ​​the motion region.

[0064] The corresponding relationship between the area of ​​the motion region and the edge density feature and the edge gradient direction feature is as follows: Figure 5 shown. Figure 5 It is a schematic diagram of the corresponding relationship between the area of ​​the motion region and the edge density feature quantity and the edge gradient direction feature quantity. Among them, Figure 5In , S1 represents different edge density feature quantities corresponding to the areas of different motion regions, and S2 represents different edge gradient direction feature quantities corresponding to the areas of different motion regions.

[0065] In an embodiment of the present application, the corresponding target edge density feature quantity and the target edge gradient direction feature quantity can be determined according to the area of ​​the motion region. The edge density feature quantity and the edge gradient direction feature quantity can be constrained by the area of ​​the motion region, which can improve the accuracy of recognition of the motion region and reduce the error recognition rate of the motion region.

[0066] Based on the above, during the image recognition process, the data changes in the embodiment of the present application are as follows: Figure 6 shown. Figure 6 It is a schematic diagram of data changes in the image recognition process provided in an embodiment of the present application.

[0067] First, motion detection is performed on multiple frames of images included in the target image sequence to obtain at least one ROI in the target image sequence.

[0068] Each ROI in the at least one ROI is regarded as a motion region; or each ROI in the at least one ROI is divided into blocks, and each block of ROI is regarded as a motion region.

[0069] Then, for each motion area, the edge density feature ED and the edge gradient direction feature EGD of the motion area are determined based on the coordinates of the center point of the circumscribed rectangular area corresponding to the motion area, the distance from the center point to the vertices of the circumscribed rectangular area, and the ST matrix corresponding to the motion area.

[0070] The edge density feature ED is compared with the target edge density feature, and the edge gradient direction feature EGD is compared with the target edge gradient direction feature. When the edge density feature ED is greater than the target edge density feature, and / or the edge gradient direction feature EGD is less than the target edge gradient direction feature, the motion area is determined as the target motion area.

[0071] In some possible implementations of the embodiments of the present application, after S104, the image recognition method of the embodiments of the present application may further include: performing motion compensation processing on a first motion area other than a target motion area in at least one motion area; and synthesizing multiple frames of images based on the target motion area and the first motion area after motion compensation processing to obtain a target image.

[0072] In some possible implementations of the embodiments of the present application, before synthesizing multiple frames of images, motion compensation processing can be performed on a first motion region other than a target motion region in at least one motion region, and motion compensation processing is not performed on the target motion region in at least one motion region. After motion compensation processing is performed on the first motion region other than the target motion region in at least one motion region, when synthesizing multiple frames of images, mutually matching pixel points in the multiple frames of images can be found; based on the mutually matching pixel points in the multiple frames of images, an alignment model for aligning the multiple frames of images is calculated; the multiple frames of images are aligned using the alignment model, and the aligned multiple frames of images are synthesized to obtain a target image.

[0073] The embodiments of the present application do not limit the methods used for motion compensation processing and image synthesis. Any available motion compensation processing and image synthesis methods can be applied to the embodiments of the present application.

[0074] In an embodiment of the present application, by performing motion compensation processing on a motion area other than a target motion area in at least one motion area, and not performing motion compensation processing on the target motion area, it is possible to avoid large areas of blur in the synthesized image, and achieve a better image synthesis effect.

[0075] It should be noted that the image recognition method provided in the embodiment of the present application can be executed by an image recognition device or a control module in the image recognition device for executing the image recognition method. In the embodiment of the present application, the image recognition device provided in the embodiment of the present application is described by taking the image recognition device executing the image recognition method as an example.

[0076] Figure 7 : is a schematic diagram of the structure of an image recognition device provided in an embodiment of the present application. The image recognition device may include:

[0077] An acquisition module 701 is used to acquire a target image sequence, wherein the target image sequence includes multiple frames of images;

[0078] A first determination module 702, configured to determine at least one motion region in a target image sequence;

[0079] A second determination module 703 is used to determine, for each motion region, an edge density feature quantity and an edge gradient direction feature quantity of the motion region;

[0080] The third determination module 704 is used to determine the motion region as a target motion region when the edge density feature quantity and the edge gradient direction feature quantity meet the target condition.

[0081] In an embodiment of the present application, after determining the motion region of the moving object in the target image sequence, the edge density feature quantity and the edge gradient direction feature quantity of the motion region are determined. In this way, when it is determined that the edge density feature quantity and the edge gradient direction feature quantity meet the target conditions, the motion region is determined as the target motion region, and the identification of the motion region is completed. Compared with the related art, the embodiment of the present application does not need to establish a mixed Gaussian model. The motion region can be identified through the edge density feature quantity and the edge gradient direction feature quantity of the motion region. The calculation amount is small and the recognition speed is fast. Therefore, the efficiency of motion region recognition can be improved.

[0082] In some possible implementations of the embodiment of the present application, the second determining module 703 may include:

[0083] A first determining unit, used to determine a circumscribed rectangular area corresponding to the motion area;

[0084] A second determining unit is used to determine a structure tensor matrix corresponding to the motion region according to a first gradient of the motion region in the first direction, a second gradient of the motion region in the second direction, a first offset of the motion region in the first direction, and a second offset of the motion region in the second direction; wherein the first direction is perpendicular to the second direction;

[0085] A decomposition unit is used to perform singular value decomposition on the structure tensor matrix using the coordinates of the center point of the circumscribed rectangular area and the first distance as parameters of the structure tensor matrix to obtain a first eigenvector and a second eigenvector corresponding to the structure tensor matrix; wherein the first distance is the distance from the center point to the vertex of the circumscribed rectangular area;

[0086] The third determining unit is used to determine the edge density feature quantity and the edge gradient direction feature quantity according to the first eigenvector and the second eigenvector.

[0087] In some possible implementations of the embodiments of the present application, the third determining unit may be specifically configured to:

[0088] The sum of the first eigenvector and the second eigenvector is determined as an edge density feature quantity;

[0089] The quotient of the first difference and the edge density feature is determined as the edge gradient direction feature; wherein the first difference is the difference between the first eigenvector and the second eigenvector, and the first eigenvector is greater than the second eigenvector.

[0090] In some possible implementations of the embodiments of the present application, the target conditions may include: an edge density feature is greater than a target edge density feature, and / or an edge gradient direction feature is less than a target edge gradient direction feature; wherein the target edge density feature is an edge density feature corresponding to the area of ​​the motion region, and the target edge gradient direction feature is an edge gradient direction feature corresponding to the area of ​​the motion region.

[0091] In an embodiment of the present application, the corresponding target edge density feature quantity and the target edge gradient direction feature quantity can be determined according to the area of ​​the motion region. The edge density feature quantity and the edge gradient direction feature quantity can be constrained by the area of ​​the motion region, which can improve the accuracy of recognition of the motion region and reduce the error recognition rate of the motion region.

[0092] In some possible implementations of the embodiments of the present application, the image recognition device provided by the embodiments of the present application may further include:

[0093] A compensation module, configured to perform motion compensation processing on a first motion region other than a target motion region in at least one motion region;

[0094] A synthesis module is used to synthesize multiple frames of images based on the target motion region and the first motion region after motion compensation processing to obtain a target image.

[0095] In an embodiment of the present application, by performing motion compensation processing on areas other than the target motion area in at least one motion area, and not performing motion compensation processing on the target motion area, it is possible to avoid large areas of blur in the synthesized image, and achieve a better image synthesis effect.

[0096] The image recognition device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0097] The image recognition device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0098] The image recognition device provided in the embodiment of the present application can realize Figures 1 to 6 To avoid repetition, the various processes in the image recognition method embodiment are not described here.

[0099] Optional, such as Figure 8 As shown, an embodiment of the present application also provides an electronic device 800, including a processor 801, a memory 802, and a program or instruction stored in the memory 802 and executable on the processor 801. When the program or instruction is executed by the processor 801, each process of the above-mentioned image recognition method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0100] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0101] In some possible implementations of the embodiments of the present application, the processor 801 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0102] In some possible implementations of the embodiments of the present application, the memory 802 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the image recognition method according to the present application.

[0103] Fig. 9 It is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

[0104] The electronic device 900 includes but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, and a processor 910 and other components.

[0105] Those skilled in the art will appreciate that the electronic device 900 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 910 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig. 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0106] Among them, the processor 910 is used to obtain a target image sequence, wherein the target image sequence includes multiple frame images; determine at least one motion area in the target image sequence; for each motion area, determine the edge density feature value and the edge gradient direction feature value of the motion area; when the edge density feature value and the edge gradient direction feature value meet the target conditions, determine the motion area as the target motion area.

[0107] In an embodiment of the present application, after determining the motion region of the moving object in the target image sequence, the edge density feature quantity and the edge gradient direction feature quantity of the motion region are determined. In this way, when it is determined that the edge density feature quantity and the edge gradient direction feature quantity meet the target conditions, the motion region is determined as the target motion region, and the identification of the motion region is completed. Compared with the related art, the embodiment of the present application does not need to establish a mixed Gaussian model. The motion region can be identified through the edge density feature quantity and the edge gradient direction feature quantity of the motion region. The calculation amount is small and the recognition speed is fast. Therefore, the efficiency of motion region recognition can be improved.

[0108] In some possible implementations of the embodiments of the present application, the processor 910 may be specifically configured to:

[0109] Determine the circumscribed rectangular area corresponding to the motion area;

[0110] Determine a structure tensor matrix corresponding to the motion region according to a first gradient of the motion region in the first direction, a second gradient of the motion region in the second direction, a first offset of the motion region in the first direction, and a second offset of the motion region in the second direction; wherein the first direction is perpendicular to the second direction;

[0111] The coordinates of the center point of the circumscribed rectangular area and the first distance are used as parameters of the structure tensor matrix, and the structure tensor matrix is ​​subjected to singular value decomposition to obtain the first eigenvector and the second eigenvector corresponding to the structure tensor matrix; wherein the first distance is the distance from the center point to the vertex of the circumscribed rectangular area;

[0112] An edge density feature quantity and an edge gradient direction feature quantity are determined according to the first eigenvector and the second eigenvector.

[0113] In some possible implementations of the embodiments of the present application, the processor 910 may be specifically configured to:

[0114] The sum of the first eigenvector and the second eigenvector is determined as an edge density feature quantity;

[0115] The quotient of the first difference and the edge density feature is determined as the edge gradient direction feature; wherein the first difference is the difference between the first eigenvector and the second eigenvector, and the first eigenvector is greater than the second eigenvector.

[0116] In some possible implementations of the embodiments of the present application, the processor 910 may be specifically configured to:

[0117] When the edge density feature is greater than the target edge density feature, and / or the edge gradient direction feature is less than the target edge gradient direction feature, the motion area is determined as the target motion area; wherein the target edge density feature is the edge density feature corresponding to the area of ​​the motion area, and the target edge gradient direction feature is the edge gradient direction feature corresponding to the area of ​​the motion area.

[0118] In an embodiment of the present application, the corresponding target edge density feature quantity and the target edge gradient direction feature quantity can be determined according to the area of ​​the motion region. The edge density feature quantity and the edge gradient direction feature quantity can be constrained by the area of ​​the motion region, which can improve the accuracy of recognition of the motion region and reduce the error recognition rate of the motion region.

[0119] In some possible implementations of the embodiments of the present application, the processor 910 may also be configured to:

[0120] A motion compensation process is performed on a first motion region other than a target motion region in at least one motion region; and a synthesis process is performed on multiple frame images based on the target motion region and the first motion region after the motion compensation process to obtain a target image.

[0121] In an embodiment of the present application, by performing motion compensation processing on areas other than the target motion area in at least one motion area, and not performing motion compensation processing on the target motion area, it is possible to avoid large areas of blur in the synthesized image, and achieve a better image synthesis effect.

[0122] It should be understood that in the embodiment of the present application, the input unit 904 may include a graphics processor (Graphics Processing Unit, GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 907 includes a touch panel 9071 and other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. Other input devices 9072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 909 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 910 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 910.

[0123] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned image recognition method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0124] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a non-transitory computer readable storage medium, such as ROM, RAM, magnetic disk or optical disk.

[0125] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image recognition method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0126] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0127] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0129] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An image recognition method, It is characterized in that The method comprises: Acquire a target image sequence, wherein the target image sequence includes multiple frames of images; determining at least one motion region in the target image sequence; For each of the motion regions, determining an edge density feature quantity and an edge gradient direction feature quantity of the motion region; In a case where the edge density feature quantity and the edge gradient direction feature quantity meet a target condition, determining the motion region as a target motion region; The step of determining the edge density feature quantity and the edge gradient direction feature quantity of the motion region comprises: Determine a circumscribed rectangular area corresponding to the motion area; Determine a structure tensor matrix corresponding to the motion region according to a first gradient of the motion region in the first direction, a second gradient of the motion region in the second direction, a first offset of the motion region in the first direction, and a second offset of the motion region in the second direction; wherein the first direction is perpendicular to the second direction; Taking the coordinates of the center point of the circumscribed rectangular area and the first distance as the parameters of the structure tensor matrix, performing singular value decomposition on the structure tensor matrix to obtain a first eigenvector and a second eigenvector corresponding to the structure tensor matrix; wherein the first distance is the distance from the center point to the vertex of the circumscribed rectangular area; Determining the edge density feature quantity and the edge gradient direction feature quantity according to the first feature vector and the second feature vector; The step of determining the edge density feature quantity and the edge gradient direction feature quantity according to the first feature vector and the second feature vector comprises: Determine the sum of the first eigenvector and the second eigenvector as the edge density feature value; The quotient of the first difference and the edge density feature is determined as the edge gradient direction feature; wherein the first difference is the difference between the first eigenvector and the second eigenvector, and the first eigenvector is greater than the second eigenvector.

2. The method according to claim 1, It is characterized in that The target conditions include: The edge density feature is greater than the target edge density feature, and / or the edge gradient direction feature is less than the target edge gradient direction feature; wherein, The target edge density feature quantity is an edge density feature quantity corresponding to the area of ​​the motion region, and the target edge gradient direction feature quantity is an edge gradient direction feature quantity corresponding to the area of ​​the motion region.

3. The method according to claim 2, It is characterized in that After determining the motion region as a target motion region, the method further includes: Performing motion compensation processing on a first motion region other than the target motion region in the at least one motion region; Based on the target motion region and the first motion region after motion compensation processing, multiple frames of images are synthesized to obtain a target image.

4. An image recognition device, It is characterized in that The device comprises: An acquisition module, used for acquiring a target image sequence, wherein the target image sequence includes multiple frames of images; A first determination module, configured to determine at least one motion region in the target image sequence; A second determination module is used to determine, for each of the motion regions, an edge density feature quantity and an edge gradient direction feature quantity of the motion region; A third determination module is used to determine the motion region as a target motion region when the edge density feature quantity and the edge gradient direction feature quantity meet a target condition; The second determining module includes: A first determining unit, configured to determine a circumscribed rectangular area corresponding to the motion area; A second determining unit is used to determine a structure tensor matrix corresponding to the motion region according to a first gradient of the motion region in the first direction, a second gradient of the motion region in the second direction, a first offset of the motion region in the first direction, and a second offset of the motion region in the second direction; wherein the first direction is perpendicular to the second direction; A decomposition unit, configured to perform singular value decomposition on the structure tensor matrix with the coordinates of the center point of the circumscribed rectangular area and the first distance as parameters of the structure tensor matrix, so as to obtain a first eigenvector and a second eigenvector corresponding to the structure tensor matrix; wherein the first distance is the distance from the center point to the vertex of the circumscribed rectangular area; A third determining unit, configured to determine the edge density feature quantity and the edge gradient direction feature quantity according to the first feature vector and the second feature vector; The third determining unit is specifically configured to: Determine the sum of the first eigenvector and the second eigenvector as the edge density feature value; The quotient of the first difference and the edge density feature is determined as the edge gradient direction feature; wherein the first difference is the difference between the first eigenvector and the second eigenvector, and the first eigenvector is greater than the second eigenvector.

5. The device according to claim 4, It is characterized in that The target conditions include: The edge density feature is greater than the target edge density feature, and / or the edge gradient direction feature is less than the target edge gradient direction feature; wherein, The target edge density feature quantity is an edge density feature quantity corresponding to the area of ​​the motion region, and the target edge gradient direction feature quantity is an edge gradient direction feature quantity corresponding to the area of ​​the motion region.

6. The device according to claim 5, It is characterized in that The device also includes: A compensation module, configured to perform motion compensation processing on a first motion region other than the target motion region in the at least one motion region; A synthesis module is used to synthesize multiple frames of images based on the target motion region and the first motion region after motion compensation processing to obtain a target image.

Citation Information

Patent Citations

  • Information processing apparatus and method for controlling the same, and background determination method

    CN103488283A

  • Method and system for detecting people wearing burka in video images

    CN106022278A

  • Moving platform moving object detection method and system based on infrared image

    CN106874949A

  • An image quality judgment method and a robot face recognition system

    CN109215010A

  • Scale adaptive target tracking method applied to mine laneway mobile inspection image

    CN110428450A