Image processing method, device, equipment and storage medium

By acquiring the image sequence and performing difference frame and binarization processing, the number of frames is dynamically adjusted to adapt to the motion state of the target object, which solves the inefficiency problem caused by the complexity of the motion detection algorithm in the existing technology and achieves fast and simple motion. Detection, suitable for scenarios such as baby monitoring.

CN113793366BActive Publication Date: 2024-09-06BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111015049.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2024-09-06
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

Existing motion detection algorithms have high computational complexity in infant monitoring scenarios, resulting in low detection efficiency and inability to issue alarms in a timely manner, especially when the background is dynamically changing or the light is stable.

Method used

By obtaining the image sequence, determine the difference frame image between adjacent frames, and perform binarization processing based on the target recognition parameters to obtain a binary image sequence, and dynamically adjust the number of frames to adapt to the motion state of the target object, achieving fast and simple Motion detection.

Benefits of technology

It achieves low computational cost and high-efficiency motion detection, reduces algorithm complexity, simplifies the development and implementation process, and is suitable for real-time monitoring requirements in specific application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113793366B
    Figure CN113793366B
Patent Text Reader

Abstract

The present disclosure relates to an image processing method, device, equipment and storage medium, the method comprising: acquiring an image sequence; the images in the image sequence include a target object; the image sequence includes a continuous multi-frame image captured of a target object that is in an active state in a video within a period, or the image sequence includes a continuous multi-frame image captured of a target object that performs a preset action in a video; determining a difference frame image between two adjacent frames of the image sequence to obtain a difference frame image sequence; based on a target recognition parameter, binarizing the difference frame image sequence to obtain a binary image sequence; the target recognition parameter represents the pixel value range of the target object, and the binary image sequence represents the motion state of the target object. The image processing method provided by the present disclosure can realize the detection of moving objects through fast and simple calculations, and has extremely low cost of use, low algorithm complexity, and is easy for developers to understand and implement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] At present, in the application scenario of baby monitoring, baby monitors are used to collect baby images in real time, and then based on the motion detection algorithm, it is determined whether the baby in the image is in a dangerous situation. When the baby is in a more dangerous situation, the baby monitor can promptly issue an alarm to remind parents to pay attention. Baby monitors achieve the above functions through motion detection technology. The main purpose of motion detection is to extract the change area from the background image in the real-time sequence image. Currently, the more commonly used motion detection algorithms are background subtraction, time difference method and optical flow method. The existing algorithms have good noise resistance to dynamic background changes or camera motion, and can effectively extract and track moving targets even in complex environments. However, this leads to the high complexity of the existing motion detection algorithms, which require a certain understanding cost and have a certain threshold for users. In addition, in the scene of baby monitoring with a relatively stable background and light, the computational complexity of the existing algorithms will reduce the detection efficiency, resulting in untimely alarms.

[0003] Therefore, in scenarios where universality requirements are not very high, how to provide a fast, simple and low-computational cost real-time motion detection solution is an urgent problem to be solved. Summary of the invention

[0004] The present disclosure provides an image processing method, device, equipment and storage medium, which has low algorithm complexity, is easy to implement, has low implementation investment cost, and is very efficient when applied in specific application scenarios. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, including:

[0006] Acquire an image sequence; the images in the image sequence include a target object; the image sequence includes a continuous plurality of frames of images acquired during a period of time from a target object that is in an active state in a video, or the image sequence includes a continuous plurality of frames of images acquired from a target object that performs a preset action in a video;

[0007] Determine a difference frame image between two adjacent frame images in the image sequence to obtain a difference frame image sequence;

[0008] Based on the target recognition parameter, the difference frame image sequence is binarized to obtain a binary image sequence; the target recognition parameter represents the pixel value range of the target object, and the binary image sequence represents the motion state of the target object.

[0009] In an exemplary embodiment, when the image sequence includes a plurality of consecutive frames of images captured during a period of a target object in an active state in a video, the method further includes:

[0010] The binary image sequence is used as the binary image sequence corresponding to the current period;

[0011] Determine the number of frames of the image acquired in the next cycle according to the binary image sequence corresponding to the current cycle;

[0012] According to the number of frames of the image acquired in the next cycle, the step of acquiring the image sequence until the binary image sequence is obtained is performed to obtain the binary image sequence corresponding to the next cycle.

[0013] In an exemplary embodiment, determining the number of frames of images acquired in the next cycle according to the binary image sequence corresponding to the current cycle includes:

[0014] For each binary image in the binary image sequence corresponding to the current cycle, determine the number of target pixels in the binary image, where the pixel value of the target pixel is a first preset value;

[0015] Determine the change degree value corresponding to the binary image according to the number of target pixels and the total number of pixels in the binary image;

[0016] Determine the number of binary images whose degree of change is greater than or equal to a preset degree value according to the degree of change corresponding to each binary image in the binary image sequence corresponding to the current period;

[0017] If the number exceeds the preset number, the number of frames of the image acquired in the next period is determined according to the preset frame growth rate and the number of frames of the image sequence corresponding to the current period; the preset number is determined based on the total number of binary images in the binary image sequence corresponding to the current period.

[0018] In an exemplary embodiment, when the image sequence includes a plurality of consecutive frames of images captured of a target object performing a preset action in a video, acquiring the image sequence includes:

[0019] A motion guidance request and a continuous multi-frame image sent by a user account are received, where the motion guidance request is used to instruct to generate guidance information corresponding to a preset action based on the continuous multi-frame image.

[0020] In an exemplary embodiment, after acquiring the image sequence, the method further includes:

[0021] A preprocessing operation is performed on the image sequence to obtain a preprocessed image sequence; the preprocessing operation includes at least one of the following: rasterization, resolution adjustment, and noise reduction.

[0022] In an exemplary embodiment, the two adjacent frames of images include a first frame of image and a second frame of image;

[0023] Determining a difference frame image between two adjacent frame images in an image sequence includes:

[0024] Determine a first digital matrix based on the pixel value of each pixel in the first frame image;

[0025] Determine a second digital matrix based on the pixel value of each pixel in the second frame image;

[0026] The first digital matrix is ​​subtracted from the second digital matrix to obtain a third digital matrix; the third digital matrix represents the pixel value of each pixel in the difference frame image.

[0027] In an exemplary embodiment, the target recognition parameters include pixel thresholds of preset color channels;

[0028] Based on the target recognition parameters, the difference frame image sequence is binarized to obtain a binary image sequence, including:

[0029] For each difference frame image in the difference frame image sequence, a pixel whose pixel value meets a pixel threshold in the difference frame image is determined as a target pixel;

[0030] The pixel value of the target pixel is adjusted to a first preset value, and the pixel value of each pixel in the difference frame image except the target pixel is adjusted to a second preset value, so as to obtain a binary image corresponding to the difference frame image.

[0031] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:

[0032] The acquisition module is configured to execute acquisition of an image sequence; the images in the image sequence include a target object; the image sequence includes a continuous plurality of frames of images acquired from a target object in an active state in a video within a period, or the image sequence includes a continuous plurality of frames of images acquired from a target object performing a preset action in a video;

[0033] A first determining module is configured to determine a difference frame image between two adjacent frame images in an image sequence to obtain a difference frame image sequence;

[0034] The first processing module is configured to perform binarization processing on the difference frame image sequence based on the target recognition parameter to obtain a binary image sequence; the target recognition parameter represents the pixel value range of the target object, and the binary image sequence represents the motion state of the target object.

[0035] In an exemplary embodiment, when the image sequence includes a plurality of consecutive frames of images captured from a target object in an active state in a video within a period, the apparatus further includes:

[0036] A second determining module is configured to execute the binary image sequence as the binary image sequence corresponding to the current period;

[0037] A third determination module is configured to determine the number of frames of images acquired in the next cycle according to the binary image sequence corresponding to the current cycle;

[0038] The execution module is configured to execute the step of acquiring an image sequence according to the number of frames of the image acquired in the next cycle until a binary image sequence is obtained, so as to obtain a binary image sequence corresponding to the next cycle.

[0039] In an exemplary embodiment, the third determining module includes:

[0040] A first determining unit is configured to determine the number of target pixels in each binary image in the binary image sequence corresponding to the current cycle, wherein the pixel value of the target pixel is a first preset value;

[0041] A second determining unit is configured to determine a change degree value corresponding to the binary image according to the number of target pixels and the total number of pixels in the binary image;

[0042] A third determining unit is configured to determine the number of binary images whose change degree values ​​are greater than or equal to a preset degree value according to the change degree values ​​corresponding to each binary image in the binary image sequence corresponding to the current period;

[0043] The fourth determination unit is configured to determine the number of frames of the image acquired in the next period according to the preset frame growth rate and the number of frames of the image sequence corresponding to the current period if the number exceeds the preset number; the preset number is determined based on the total number of binary images in the binary image sequence corresponding to the current period.

[0044] In an exemplary embodiment, when the image sequence includes a plurality of consecutive frames of images captured of a target object performing a preset action in a video, the acquisition module is configured to execute:

[0045] A motion guidance request and an image sequence sent by a user account are received; the image sequence includes a continuous multi-frame image of a target object performing a preset action, and the motion guidance request is used to indicate the generation of guidance information corresponding to the preset action based on the continuous multi-frame image.

[0046] In an exemplary embodiment, the apparatus further comprises:

[0047] The preprocessing module is configured to perform a preprocessing operation on the image sequence to obtain a preprocessed image sequence; the preprocessing operation includes at least one of the following: rasterization, resolution adjustment, and noise reduction.

[0048] In an exemplary embodiment, the two adjacent frames of images include a first frame of image and a second frame of image;

[0049] The first determination module is configured to execute:

[0050] Determine a first digital matrix based on the pixel value of each pixel in the first frame image;

[0051] Determine a second digital matrix based on the pixel value of each pixel in the second frame image;

[0052] The first digital matrix is ​​subtracted from the second digital matrix to obtain a third digital matrix; the third digital matrix represents the pixel value of each pixel in the difference frame image.

[0053] In an exemplary embodiment, the target recognition parameters include pixel thresholds of preset color channels;

[0054] The first processing module is configured to execute:

[0055] For each difference frame image in the difference frame image sequence, a pixel whose pixel value meets a pixel threshold in the difference frame image is determined as a target pixel;

[0056] The pixel value of the target pixel is adjusted to a first preset value, and the pixel value of each pixel in the difference frame image except the target pixel is adjusted to a second preset value, so as to obtain a binary image corresponding to the difference frame image.

[0057] In an exemplary embodiment, the apparatus further comprises:

[0058] The motion state analysis module is configured to determine the motion state of the target object according to the binary image sequence and analyze the motion state of the target object.

[0059] In an exemplary embodiment, the apparatus further comprises:

[0060] The motion correction module is configured to generate corresponding correction suggestions if the analysis result of the motion state of the target object includes that the motion state of the target object is a state to be corrected.

[0061] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0062] processor;

[0063] a memory for storing processor-executable instructions;

[0064] The processor is configured to execute instructions to implement the image processing method of the first aspect as described above.

[0065] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image processing method of the first aspect described above.

[0066] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program, wherein the computer program implements the image processing method of the first aspect when executed by a processor.

[0067] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0068] By acquiring an image sequence; the images in the image sequence include the target object; the image sequence includes a continuous multi-frame image captured of the target object that is in an active state in the video within a period, or the image sequence includes a continuous multi-frame image captured of the target object performing a preset action in the video; determining the difference frame image between two adjacent frames in the image sequence to obtain a difference frame image sequence; based on the target recognition parameter, binarizing the difference frame image sequence to obtain a binary image sequence; the target recognition parameter represents the pixel value range of the target object, and the binary image sequence represents the motion state of the target object. The image processing method provided by the present disclosure can realize the detection of moving objects through fast and simple calculations, and has extremely low cost of use, low algorithm complexity, and is easy for developers to understand and implement.

[0069] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0071] Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment;

[0072] Figure 2 is a flowchart of an image processing method according to an exemplary embodiment;

[0073] Figure 3 is a flow chart showing a method of determining a difference frame image between two adjacent frame images in an image sequence according to an exemplary embodiment;

[0074] Figure 4 It is a flowchart showing a method of performing binarization processing on a difference frame image sequence based on target recognition parameters to obtain a binary image sequence according to an exemplary embodiment;

[0075] Figure 5 is a schematic diagram of a binary image sequence according to an exemplary embodiment;

[0076] Figure 6 is a flowchart of another image processing method according to an exemplary embodiment;

[0077] Figure 7 is a flowchart showing a method of determining the number of frames of images acquired in the next cycle according to a binary image sequence corresponding to the current cycle according to an exemplary embodiment;

[0078] Figure 8 is a block diagram of an image processing device according to an exemplary embodiment;

[0079] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0080] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0081] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0082] In some specific application scenarios, such as when the light intensity of the light source is stable and there is no flicker or the flicker frequency is an integer multiple of the camera sampling rate, or when the color of the moving object is significantly different from the surrounding environment, etc., the requirements for the recognition of the moving object are not very high. The existing motion detection algorithms such as background subtraction, time difference and optical flow are relatively complex, require a certain understanding cost, and have a certain threshold for users; and these algorithms require a large amount of calculations and are relatively inefficient.

[0083] In view of this, the present disclosure provides an image processing method, device, equipment and storage medium, which can obtain more practical detection results through fast and simple calculations based on specific requirements (mainly requirements for light and object color), and the cost of use is extremely low, which can be understood and implemented by general developers.

[0084] See also Figure 1 , which is a schematic diagram of an application environment of an image processing method according to an exemplary embodiment, and the application environment may include a server 01 and a terminal 02. Optionally, the server 01 and the terminal 02 may be connected via a wireless link or a wired link, which is not limited in the present disclosure.

[0085] In an optional embodiment, the server 01 can be used to obtain a binary image sequence based on the acquired image sequence. Specifically, the server 01 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the operating system running on the server 01 may include but is not limited to IOS, Linux, Windows, Unix, Android systems, etc.

[0086] In an optional embodiment, the terminal 02 can assist the server 01 in obtaining a device for an image sequence. The terminal can be a provider of an image sequence, used to send the image sequence to the server 01. Optionally, after the server 01 obtains the binary image sequence, the binary image sequence can be sent to other terminals 02 for display on other terminals 02. Specifically, the terminal 02 can include but is not limited to image acquisition devices such as digital cameras and gopro sports cameras, as well as electronic devices such as smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc.; wherein the operating system running on the electronic device can include but is not limited to Android system, IOS system, linux, windows, etc.

[0087] In addition, it should be noted that Figure 1 What is shown is only one application environment of the image processing method provided by the present disclosure. In practical applications, other application environments may also be included, such as obtaining a binary image sequence, which may also be implemented on the terminal 02 .

[0088] Figure 2 is a flowchart of an image processing method according to an exemplary embodiment. Figure 2 As shown, the image processing method is used for Figure 1 Taking the server as an example, the following steps are included:

[0089] In step S201, an image sequence is acquired; the images in the image sequence include a target object.

[0090] The image sequence includes a plurality of continuous image frames captured from a target object in an active state in a video within a period, or the image sequence includes a plurality of continuous image frames captured from a target object performing a preset action in a video.

[0091] In the embodiment of the present disclosure, the image sequence may be obtained by the server from the terminal. The terminal may be an image acquisition device, for example, the target object may be acquired by a camera arranged on the terminal. The target object may be a predetermined object whose motion state is to be observed, or any suspicious object that needs to be detected from the environment.

[0092] The purpose of the disclosed embodiments is to obtain the approximate activity content of the target object from the image sequence, for example, to understand the activity status of a baby from the monitoring video taken by a baby monitoring system, or to capture suspicious moving targets from the monitoring video taken by an alarm monitoring system, or to understand whether the user's movements are standard in dance or fitness scenes based on the action videos uploaded by the user.

[0093] In an optional embodiment, acquiring the image sequence may include the following steps:

[0094] A motion guidance request and an image sequence sent by a user account are received; the image sequence includes a continuous multi-frame image of a target object performing a preset action, and the motion guidance request is used to indicate the generation of guidance information corresponding to the preset action based on the continuous multi-frame image.

[0095] Among them, the user account is an account that has been pre-registered with the server, and the server can provide relevant sports guidance to the user corresponding to the user account. For example, in scenes such as dance and fitness, for users who have not received professional training or are unable to determine whether their dance movements or fitness movements are standardized due to other reasons, the sports guidance function provided by the server can be used. Specifically, the user can use a device with a camera, such as a mobile phone, to shoot a continuous multi-frame image of himself or others performing a preset action in full. The preset action may include any dance action or fitness action, and then send a sports guidance request to the server and upload the captured image sequence. The server responds to the sports guidance request, obtains a corresponding binary image sequence based on the image sequence, and then generates corresponding guidance information based on the binary image sequence. The guidance information may include suggestions on whether the preset action is standard and how to correct it if it is not standard.

[0096] It should be noted that the user information involved in this disclosure (including but not limited to user device information, user personal information, etc.) is all information authorized by the user or fully authorized by all parties.

[0097] In an optional embodiment, after acquiring the image sequence, the method of the present disclosure may further include the following steps:

[0098] A preprocessing operation is performed on the image sequence to obtain a preprocessed image sequence; the preprocessing operation includes at least one of the following: rasterization, resolution adjustment, and noise reduction.

[0099] Rasterization, also known as gridding, is the process of converting an image represented by a vector graphics format into a bitmap for display or printer output. The present disclosure takes into account that the format of the acquired image sequence may be a vector image, that is, an object-oriented image or a drawing image. The elements that constitute the vector image are some points, lines, rectangles, polygons, circles, arcs, etc., which are all obtained by mathematical formula calculation. Images in this format must be rasterized and converted into a bitmap with a grid structure before the subsequent steps can be processed.

[0100] Resolution adjustment is used to unify the size of images in an image sequence, which can improve image processing efficiency.

[0101] Image denoising, also known as denoising, is a technique used to reduce noise in digital images due to the interference of imaging devices and external environmental noise during the digitization and transmission process. Before processing the image, the image can be denoised as needed to reduce interference.

[0102] In step S203, a difference frame image between two adjacent frame images in the image sequence is determined to obtain a difference frame image sequence.

[0103] In the embodiment of the present disclosure, two adjacent frames of images refer to two frames of images captured continuously in time. The object whose position has changed at any time can be determined by the difference frame image between the two adjacent frames of images.

[0104] In an optional embodiment, the two adjacent frame images include a first frame image and a second frame image; the difference frame image between the two adjacent frame images in the above-mentioned determined image sequence may include: Figure 3 The following steps:

[0105] In step S301, a first digital matrix is ​​determined based on the pixel value of each pixel in a first frame image.

[0106] In step S303, a second digital matrix is ​​determined based on the pixel value of each pixel in the second frame image.

[0107] In step S305, the first digital matrix is ​​subtracted from the second digital matrix to obtain a third digital matrix; the third digital matrix represents the pixel value of each pixel in the difference frame image.

[0108] In a specific implementation, the first frame image is marked as C frame (control frame) and cached, the second frame image is marked as T frame (target frame), and a technology that can process and render images in real time, such as OpenGL and Metal, is used to perform real-time calculation and rendering to obtain a difference frame image. The input parameters are the rasterized data of the C frame and the T frame, that is, the first digital matrix: C matrix, and the second digital matrix: T matrix; then, the third digital matrix corresponding to the difference frame image is obtained by subtracting the C matrix from the T matrix: Dp (D-previous) matrix; wherein the digital matrix is ​​a multidimensional vector composed of the pixel values ​​of all pixels in the image.

[0109] In step S205, based on the target recognition parameters, the difference frame image sequence is binarized to obtain a binary image sequence.

[0110] The target recognition parameter represents the pixel value range of the target object, and the binary image sequence represents the motion state of the target object.

[0111] In the embodiment of the present disclosure, the target recognition parameter includes a pixel threshold of a preset color channel, and the preset color channel may include red, green, and blue color channels. The target recognition parameter needs to be debugged according to the actual application scenario. Specifically, a manual parameter adjustment method can be used, or a set of automatic parameter adjustment algorithms can be trained for automatic parameter adjustment. The present disclosure does not limit the method for determining the target recognition parameter. The target recognition parameter can characterize the pixel value range corresponding to the target object on the red, green, and blue color channels.

[0112] Based on the target recognition parameters, the difference frame image sequence is binarized, and the motion state of the target object can be clearly observed in the obtained binary image sequence.

[0113] In an optional implementation, a subjective evaluation is performed on the binary image, and the corresponding target recognition parameters are adjusted. For example, when there is too much information loss (not clear) in the binary image, the target recognition parameters can be lowered to solve the problem. Conversely, when there is too much noise (clutter) in the binary image, more information can be removed by increasing the target recognition parameters. For scenes with little change, the step of adjusting the target recognition parameters only needs to be performed once.

[0114] In an optional embodiment, the above-mentioned binary image sequence obtained by performing binarization processing on the difference frame image sequence based on the target recognition parameter may include the following: Figure 4 The following steps:

[0115] In step S401 , for each difference frame image in the difference frame image sequence, a pixel whose pixel value satisfies a pixel threshold in the difference frame image is determined as a target pixel.

[0116] In step S403, the pixel value of the target pixel is adjusted to a first preset value, and the pixel value of each pixel in the difference frame image except the target pixel is adjusted to a second preset value, so as to obtain a binary image corresponding to the difference frame image.

[0117] Based on the above specific embodiments, a filter is used to erase the signals whose values ​​in the Dp matrix do not meet the pixel threshold, and the remaining signals that meet the pixel threshold are amplified to the maximum value. In this way, the difference frame image can be binarized, and the output result is a binary image. When applied in the RGB color space, the first preset value can be (255, 255, 255), and the second preset value can be (0, 0, 0). The corresponding binary image is a black and white image, and the white area is the target object, such as Figure 5 As shown, Figure 5 is a schematic diagram of an exemplary binary image sequence provided by the present disclosure, which shows that the target object (person) is in a state of waving his hand downward.

[0118] In the disclosed embodiment, the terminal image acquisition device can acquire images of the target object in motion in real time, that is, the image sequence includes multiple consecutive frames of images acquired from the target object in the video in a period; at this time, in step S201, the server periodically executes to obtain an image sequence of a preset number of frames from the terminal, and calculates to obtain a binary image sequence corresponding to each period. In order to ensure that the target object has continuous image input during the motion process, the server can dynamically adjust the number of frames of the image sequence acquired in each period to adapt to the different change speeds of the target object.

[0119] Based on this, in an optional implementation, after step S205, the method of the present disclosure further includes: Figure 6 The following steps:

[0120] In step S601, the binary image sequence is used as the binary image sequence corresponding to the current period.

[0121] In step S603, the number of frames of images acquired in the next cycle is determined according to the binary image sequence corresponding to the current cycle.

[0122] In a specific embodiment, determining the number of frames of the image acquired in the next cycle according to the binary image sequence corresponding to the current cycle may include: Figure 7 The following steps:

[0123] In step S701, for each binary image in the binary image sequence corresponding to the current period, the number of target pixels in the binary image is determined, and the pixel value of the target pixel is a first preset value.

[0124] In step S703, the change degree value corresponding to the binary image is determined according to the number of target pixels and the total number of pixels in the binary image.

[0125] The change degree value may be the ratio of the number of target pixels to the total number of pixels in the binary image, representing the proportion of the target object in the binary image. The change degree value may also represent the difference between two adjacent frames in the original image sequence.

[0126] In step S705, the number of binary images having a change degree value greater than or equal to a preset value is determined according to the change degree value corresponding to each binary image in the binary image sequence corresponding to the current period.

[0127] After determining the change degree value corresponding to each binary image, each change degree value is compared with the preset degree value. According to the size relationship between the change degree value and the preset degree value, it is further judged whether the target object is in a rapidly changing state, so as to dynamically adjust the number of frames of the image acquired by the server accordingly, so that it can meet the demand without wasting the server's computing resources and power consumption due to continuously acquiring image sequences with a higher acquisition frame number, thereby improving the image processing efficiency.

[0128] It should be noted that the above dynamic adjustment of the number of frames of the image acquired by the server can be achieved by adjusting the acquisition frame rate of the terminal image acquisition device, and can also be achieved by adjusting the sampling frequency of the server itself.

[0129] In step S707, if the number exceeds the preset number, the number of frames of the image acquired in the next period is determined according to the preset frame growth rate and the number of frames of the image sequence corresponding to the current period; the preset number is determined based on the total number of binary images in the binary image sequence corresponding to the current period.

[0130] The number of binary images whose degree of change is greater than or equal to a preset degree value in the binary image sequence corresponding to the current period is counted; if the number exceeds the preset number, the number of frames of the image acquired in the next period is increased by a certain preset frame growth rate based on the number of frames of the image sequence corresponding to the current period; the preset number may be 1 / 2 of the total number of binary images in the binary image sequence corresponding to the current period.

[0131] Among them, increasing the number of frames of images acquired in the next cycle can be achieved by increasing the acquisition frame rate of the image acquisition device, or by adjusting the sampling frequency of the server itself; taking increasing the acquisition frame rate of the image acquisition device as an example, in the first cycle, the frame rate is 4 frames / s, and the server acquires an image sequence once in a cycle of 5 seconds. Then, the image sequence acquired by the server in the first cycle includes 20 frames of images. The server processes the 20 frames of images to obtain a binary image sequence corresponding to the first cycle, and the number of binary images in the binary image sequence is 19 frames; then for each binary image, the corresponding change degree value is calculated; if the number of binary images with a change degree value greater than or equal to the preset degree value in the 19 frames of binary images is 11 frames, which exceeds the preset number of 10 frames, then the acquisition frame rate of the image acquisition device is increased according to the preset frame number increase of 2 frames / s, that is, the acquisition frame rate of the image acquisition device is adjusted to 6 frames / s, and the corresponding number of frames of images acquired in the next cycle is 30 frames.

[0132] In step S605, according to the number of frames of the image acquired in the next cycle, the step of acquiring an image sequence until a binary image sequence is obtained is performed to obtain a binary image sequence corresponding to the next cycle.

[0133] Based on the increased number of frames of the image acquired in the next cycle, the above steps S201-S205 are repeatedly executed to obtain a binary image sequence corresponding to the next cycle, so that the target object in a rapidly changing state can be adapted to obtain the complete motion state of the target object.

[0134] The image processing method provided by the embodiments of the present disclosure, when applied in application scenarios such as factory supervision and detection of infant activities, can quickly detect the movement of objects, thereby facilitating subsequent timely alarms or reminders. Since no complex recognition is required, the computing cost and response speed are much faster than traditional intelligent recognition methods such as neural networks, allowing consumers to roughly understand the content of the object's activities.

[0135] The binary image sequence finally obtained by the image processing method provided by the embodiment of the present disclosure can be used as a display frame or a recording frame. And because the binary image has only two color information in total, the information that does not need to be paid attention to is deleted, and only the content related to the activities of the target object is retained. This can greatly protect the non-disclosure of the place and the privacy of the user for some sensitive places or individuals.

[0136] In addition, in the application scenario of video transmission, compared with the processing method of the input original image sequence, the image processing method provided by the embodiment of the present disclosure removes most of the irrelevant information and finally obtains a binary image sequence, which can make the transmitted video data have the opportunity to achieve a very high compression rate and extremely high fidelity.

[0137] Figure 8 FIG. 1 is a block diagram of an image processing device according to an exemplary embodiment. Figure 8 , the device includes an acquisition module 801, a first determination module 802 and a first processing module 803, wherein:

[0138] The acquisition module 801 is configured to execute acquisition of an image sequence; the images in the image sequence include a target object; the image sequence includes a continuous multi-frame image acquired from a target object in an active state in a video within a period, or the image sequence includes a continuous multi-frame image acquired from a target object performing a preset action in a video;

[0139] The first determining module 802 is configured to determine a difference frame image between two adjacent frame images in an image sequence to obtain a difference frame image sequence;

[0140] The first processing module 803 is configured to perform binarization processing on the difference frame image sequence based on the target recognition parameter to obtain a binary image sequence; the target recognition parameter represents the pixel value range of the target object, and the binary image sequence represents the motion state of the target object.

[0141] In an exemplary embodiment, when the image sequence includes a plurality of consecutive frames of images captured from a target object in an active state in a video within a period, the apparatus further includes:

[0142] A second determining module is configured to execute the binary image sequence as the binary image sequence corresponding to the current period;

[0143] A third determination module is configured to determine the number of frames of images acquired in the next cycle according to the binary image sequence corresponding to the current cycle;

[0144] The execution module is configured to execute the step of acquiring an image sequence according to the number of frames of the image acquired in the next cycle until a binary image sequence is obtained, so as to obtain a binary image sequence corresponding to the next cycle.

[0145] In an exemplary embodiment, the third determining module includes:

[0146] A first determining unit is configured to determine the number of target pixels in each binary image in the binary image sequence corresponding to the current cycle, wherein the pixel value of the target pixel is a first preset value;

[0147] A second determining unit is configured to determine a change degree value corresponding to the binary image according to the number of target pixels and the total number of pixels in the binary image;

[0148] A third determining unit is configured to determine the number of binary images whose change degree values ​​are greater than or equal to a preset degree value according to the change degree values ​​corresponding to each binary image in the binary image sequence corresponding to the current period;

[0149] The fourth determination unit is configured to determine the number of frames of the image acquired in the next period according to the preset frame growth rate and the number of frames of the image sequence corresponding to the current period if the number exceeds the preset number; the preset number is determined based on the total number of binary images in the binary image sequence corresponding to the current period.

[0150] In an exemplary embodiment, when the image sequence includes a plurality of consecutive frames of images captured of a target object performing a preset action in a video, the acquisition module 801 is configured to execute:

[0151] A continuous multi-frame image of a motion guidance request sent by a user account is received, where the motion guidance request is used to instruct to generate guidance information corresponding to a preset action based on the continuous multi-frame image.

[0152] In an exemplary embodiment, the apparatus further comprises:

[0153] The preprocessing module is configured to perform a preprocessing operation on the image sequence to obtain a preprocessed image sequence; the preprocessing operation includes at least one of the following: rasterization, resolution adjustment, and noise reduction.

[0154] In an exemplary embodiment, the two adjacent frames of images include a first frame of image and a second frame of image;

[0155] The first determining module 802 is configured to execute:

[0156] Determine a first digital matrix based on the pixel value of each pixel in the first frame image;

[0157] Determine a second digital matrix based on the pixel value of each pixel in the second frame image;

[0158] The first digital matrix is ​​subtracted from the second digital matrix to obtain a third digital matrix; the third digital matrix represents the pixel value of each pixel in the difference frame image.

[0159] In an exemplary embodiment, the target recognition parameters include pixel thresholds of preset color channels;

[0160] The first processing module 803 is configured to execute:

[0161] For each difference frame image in the difference frame image sequence, a pixel whose pixel value meets a pixel threshold in the difference frame image is determined as a target pixel;

[0162] The pixel value of the target pixel is adjusted to a first preset value, and the pixel value of each pixel in the difference frame image except the target pixel is adjusted to a second preset value, so as to obtain a binary image corresponding to the difference frame image.

[0163] In an exemplary embodiment, the image processing device further includes a motion state analysis module:

[0164] The motion state analysis module is configured to determine the motion state of the target object according to the binary image sequence and analyze the motion state of the target object.

[0165] In dance, fitness and other scenarios, some users need to obtain professional guidance because they have not received professional training or for other reasons, which makes them unable to determine whether their movements are standard and they do not want others to know.

[0166] In view of this, the image processing device provided by the embodiment of the present disclosure can help users improve the standardization of some of their activities through the motion state analysis module under the premise of protecting user privacy. For example, the user can record his or her dance movements or fitness movements in advance to form an image sequence, and then upload the image sequence to the image processing device. The image sequence containing the user's dance movements or fitness movements is sequentially obtained by the acquisition module 801, the first determination module 802 and the first processing module 803 to obtain the corresponding binary image sequence, so as to eliminate the background information and the user's related privacy information, and only retain the content related to the user's movement, so as to protect the user's privacy; the obtained binary image sequence is further processed by the motion state analysis module, and the processing process may include analyzing the user's movement based on the standard movement to obtain the result of whether the user's movement is standard.

[0167] In an exemplary embodiment, the image processing apparatus further includes:

[0168] The motion correction module is configured to generate corresponding correction suggestions if the analysis result of the motion state of the target object includes that the motion state of the target object is a state to be corrected.

[0169] In a specific embodiment, the motion state analysis module includes a display device, which is used to display a binary image sequence, and the displayed binary image sequence can be analyzed and judged manually; for example, the display device displays the above-mentioned processed binary image sequence including the user's movements, and then an expert or coach analyzes the displayed content. If the analysis shows that the user's movements are not standard, the expert or coach manually inputs corresponding correction suggestions.

[0170] In another specific embodiment, a large number of videos corresponding to standard dance movements or standard fitness movements are pre-stored in the database, and the motion state analysis module automatically retrieves the corresponding standard movement videos from the database through a preset program, and then compares them with the binary image sequence containing the user's movements to obtain the result of whether the user's movements are standard, and generates information that the target object's motion state is a state to be corrected if it is not standard;

[0171] The motion correction module, in response to the information that the motion state of the target object is a state to be corrected, can further analyze the binary image sequence containing the user's movements through a preset program to generate corresponding correction suggestions, or can send guidance task information and the binary image sequence containing the user's movements to a terminal bound to an expert or coach to obtain correction suggestions with feedback from the expert or coach.

[0172] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0173] In an exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing instructions executable by the processor; wherein, when the processor is configured to execute the instructions stored in the memory, it implements any one of the image processing methods provided in the embodiments of the present disclosure.

[0174] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a server. Fig. 9 is a block diagram of an electronic device for image processing according to an exemplary embodiment. Fig. 9As shown, the server 900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 910 (the central processing unit 910 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 930 for storing data, and one or more storage media 920 (such as one or more mass storage devices) for storing application programs 923 or data 922. Among them, the memory 930 and the storage medium 920 can be short-term storage or permanent storage. The program stored in the storage medium 920 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 910 can be configured to communicate with the storage medium 920 and execute a series of instruction operations in the storage medium 920 on the server 900. The server 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input and output interfaces 940, and / or one or more operating systems 921, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM, etc.

[0175] The input / output interface 940 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 900. In one example, the input / output interface 940 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 940 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0176] It can be understood by those skilled in the art that Fig. 9 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown.

[0177] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 930 including instructions, and the instructions can be executed by the central processor 910 of the server 900 to complete the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0178] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, any one of the image processing methods provided in the embodiments of the present disclosure is implemented.

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

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

Claims

1. An image processing method, characterized in that: include: Acquire an image sequence; the images in the image sequence include a target object; the image sequence includes a continuous multi-frame image captured of a target object in an active state in a video within a period, or the image sequence includes a continuous multi-frame image captured of a target object performing a preset action in a video; Determine a difference frame image between two adjacent frame images in the image sequence to obtain a difference frame image sequence; Based on the target recognition parameter, the difference frame image sequence is binarized to obtain a binary image sequence; the target recognition parameter represents the pixel value range of the target object, and the binary image sequence represents the motion state of the target object; When the image sequence includes a continuous plurality of frames of images captured from a target object in an active state in a video within a period, the method further includes: Taking the binary image sequence as the binary image sequence corresponding to the current period; Determining the number of frames of images acquired in the next cycle according to the binary image sequence corresponding to the current cycle; According to the number of frames of the image acquired in the next cycle, the step of acquiring the image sequence until a binary image sequence is obtained is performed to obtain the binary image sequence corresponding to the next cycle.

2. The image processing method according to claim 1, characterized in that: Determining the number of frames of images acquired in the next cycle according to the binary image sequence corresponding to the current cycle includes: For each binary image in the binary image sequence corresponding to the current cycle, determine the number of target pixels in the binary image, the pixel value of the target pixel being a first preset value; Determining a change degree value corresponding to the binary image according to the number of the target pixels and the total number of pixels in the binary image; Determine the number of binary images whose degree of change is greater than or equal to a preset degree value according to the degree of change corresponding to each binary image in the binary image sequence corresponding to the current period; If the number of binary images whose degree of change is greater than or equal to the preset degree value exceeds a preset number, the number of frames of images acquired in the next period is determined according to the preset frame growth rate and the number of frames of the image sequence corresponding to the current period; the preset number is determined based on the total number of binary images in the binary image sequence corresponding to the current period.

3. The image processing method according to claim 1, characterized in that: When the image sequence includes a plurality of continuous frames of images captured of a target object performing a preset action in a video, the step of acquiring the image sequence includes: A motion guidance request and the continuous multiple-frame images sent by a user account are received, wherein the motion guidance request is used to instruct to generate guidance information corresponding to the preset action based on the continuous multiple-frame images.

4. The image processing method according to any one of claims 1 to 3, characterized in that: After acquiring the image sequence, the method further includes: A preprocessing operation is performed on the image sequence to obtain a preprocessed image sequence; the preprocessing operation includes at least one of the following: rasterization, resolution adjustment, and noise reduction.

5. The image processing method according to claim 1, characterized in that: The two adjacent frames of images include a first frame of image and a second frame of image; The determining of a difference frame image between two adjacent frame images in the image sequence comprises: Determine a first digital matrix based on the pixel value of each pixel in the first frame of image; Determine a second digital matrix based on the pixel value of each pixel in the second frame of image; The first digital matrix is ​​subtracted from the second digital matrix to obtain a third digital matrix; the third digital matrix represents the pixel value of each pixel in the difference frame image.

6. The image processing method according to claim 1, characterized in that: The target recognition parameters include pixel thresholds of preset color channels; The step of performing binarization processing on the difference frame image sequence based on the target recognition parameter to obtain a binary image sequence includes: For each difference frame image in the difference frame image sequence, determining a pixel in the difference frame image whose pixel value meets the pixel threshold as a target pixel; The pixel value of the target pixel is adjusted to a first preset value, and the pixel value of each pixel in the difference frame image except the target pixel is adjusted to a second preset value, so as to obtain a binary image corresponding to the difference frame image.

7. An image processing device, characterized in that: include: An acquisition module is configured to acquire an image sequence; the images in the image sequence include a target object; the image sequence includes a continuous multi-frame image acquired from a target object in an active state in a video within a period, or the image sequence includes a continuous multi-frame image acquired from a target object performing a preset action in a video; A first determining module is configured to determine a difference frame image between two adjacent frame images in the image sequence to obtain a difference frame image sequence; A first processing module is configured to perform binarization processing on the difference frame image sequence based on a target recognition parameter to obtain a binary image sequence; the target recognition parameter represents a pixel value range of the target object, and the binary image sequence represents a motion state of the target object; When the image sequence includes a continuous plurality of frames of images collected from a target object in an active state in a video within a period, the device further includes: A second determining module is configured to execute the binary image sequence as the binary image sequence corresponding to the current period; A third determination module is configured to determine the number of frames of images acquired in the next cycle according to the binary image sequence corresponding to the current cycle; The execution module is configured to execute the step of acquiring the image sequence until a binary image sequence is obtained according to the number of frames of the image acquired in the next cycle, and obtain the binary image sequence corresponding to the next cycle.

8. The image processing device according to claim 7, characterized in that: The third determining module comprises: A first determining unit is configured to determine, for each binary image in the binary image sequence corresponding to the current cycle, the number of target pixels in the binary image, wherein the pixel value of the target pixel is a first preset value; A second determining unit is configured to determine a change degree value corresponding to the binary image according to the number of the target pixels and the total number of pixels in the binary image; A third determining unit is configured to determine the number of binary images whose change degree values ​​are greater than or equal to a preset degree value according to the change degree values ​​corresponding to each binary image in the binary image sequence corresponding to the current period; The fourth determination unit is configured to determine the number of frames of images acquired in the next period according to the preset frame growth rate and the number of frames of the image sequence corresponding to the current period if the number of binary images whose change degree value is greater than or equal to the preset degree value exceeds the preset number; the preset number is determined based on the total number of binary images in the binary image sequence corresponding to the current period.

9. The image processing device according to claim 7, characterized in that: When the image sequence includes a plurality of consecutive frames of images captured of a target object performing a preset action in a video, the acquisition module is configured to execute: A motion guidance request and the continuous multiple-frame images sent by a user account are received, wherein the motion guidance request is used to instruct to generate guidance information corresponding to the preset action based on the continuous multiple-frame images.

10. The image processing device according to any one of claims 7 to 9, characterized in that: The device also includes: The preprocessing module is configured to perform a preprocessing operation on the image sequence to obtain a preprocessed image sequence; the preprocessing operation includes at least one of the following: rasterization, resolution adjustment, and noise reduction.

11. The image processing device according to claim 7, characterized in that: The two adjacent frames of images include a first frame of image and a second frame of image; The first determining module is configured to execute: Determine a first digital matrix based on the pixel value of each pixel in the first frame of image; Determine a second digital matrix based on the pixel value of each pixel in the second frame of image; The first digital matrix is ​​subtracted from the second digital matrix to obtain a third digital matrix; the third digital matrix represents the pixel value of each pixel in the difference frame image.

12. The image processing device according to claim 7, characterized in that: The target recognition parameters include pixel thresholds of preset color channels; The first processing module is configured to execute: For each difference frame image in the difference frame image sequence, determining a pixel in the difference frame image whose pixel value meets the pixel threshold as a target pixel; The pixel value of the target pixel is adjusted to a first preset value, and the pixel value of each pixel in the difference frame image except the target pixel is adjusted to a second preset value, so as to obtain a binary image corresponding to the difference frame image.

13. The image processing device according to any one of claims 7 to 9, characterized in that: The device also includes: The motion state analysis module is configured to determine the motion state of the target object according to the binary image sequence and analyze the motion state of the target object.

14. The image processing device according to claim 13, characterized in that: The device also includes: The motion correction module is configured to generate corresponding correction suggestions if the analysis result of analyzing the motion state of the target object includes that the motion state of the target object is a state to be corrected.

15. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image processing method according to any one of claims 1 to 6. 16 . A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the image processing method according to claim 1 .

17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the image processing method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Motion cycle analysis-based method and device for identifying abnormal human behavior

    CN101739557A

  • Method for detecting movement of airborne displays

    CN104700430A

  • Method and equipment for monitoring object moving state

    CN106781167A

  • Behavior monitoring method and device, computer equipment and readable storage medium

    CN110532988A

  • Behavior detection method and device, equipment and storage medium

    CN111860030A