Method and apparatus for calculating target deformation degree based on vertical projection histogram

By acquiring image sequences for background modeling and vertical projection histogram analysis, the problem of unsatisfactory object deformation detection accuracy in existing technologies is solved, achieving efficient and accurate determination of deformation degree.

CN116152286BActive Publication Date: 2025-11-21UNIV OF JINAN
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310287402.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-20
Publication Date
2025-11-21
Estimated Expiration
2043-03-20

AI Technical Summary

Technical Problem

Existing object deformation detection methods lack sufficient accuracy and cannot meet the real-time monitoring needs of industrial production, especially for detecting minute deformations of parts under temperature changes or external forces.

Method used

Background modeling is performed by acquiring a sequence of N consecutively captured images. The grayscale standard deviation of the background image is calculated, and the grayscale feature differences of the target area are analyzed using the vertical projection histogram. The target deformation coefficient is defined to determine the degree of deformation.

Benefits of technology

It enables real-time, accurate, and efficient determination of the degree of deformation in the target area, meeting the real-time monitoring needs of industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116152286B_ABST
    Figure CN116152286B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for calculating the deformation degree of a target based on a vertical projection histogram, and the method comprises the following steps: acquiring a sequence of N frames of images which are continuously shot, and performing background modeling to obtain a background image; calculating the gray standard deviation of each pixel of the background image; performing vertical projection on a selected target region in the background image, and calculating the gray feature of the target region in the background image and a real-time frame image; judging the gray feature difference of the target region between the background image and the real-time frame; and calculating the deformation degree of the target region according to the gray feature difference of the target region between the background image and the real-time frame. The application not only realizes the deformation degree judgment of the target region, but also can accurately and efficiently judge the deformation degree of the target region on the basis of meeting real-time performance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a method and device for calculating the deformation degree of a target based on a vertical projection histogram, and belongs to the technical field of image processing. BACKGROUND

[0002] In the industrial production process, many parts are usually assembled on the equipment. Due to the high temperature of the special environment, or the use for too long time, or the action of external force, some parts will have a slight deformation, thereby causing an accident hazard, and thus the corresponding real-time monitoring is needed. Moreover, in the future, flexible materials may be more used in electronic devices, so that the electronic devices can have a certain degree of bending deformation. In production, the deformation state of the electronic device needs to be detected in real time to avoid excessive deformation of the device. However, the existing object deformation detection precision is not ideal, and still cannot meet the production requirements.

[0003] Texture is an important visual cue, which is a feature that is ubiquitous in images but difficult to describe. Texture analysis technology has always been an active research field in computer vision, image processing, image analysis, image retrieval, etc. Texture feature extraction is a key link for successful image texture description, classification and segmentation, because the extracted texture features directly affect the quality of subsequent processing. There are four common texture research methods, namely structure method, statistical method, model method and spectral method. The structure analysis method analyzes the shape and arrangement distribution characteristics of texture primitives from the structure angle of the texture image. Most textures can be described as a random variable, especially natural textures, which show great randomness from the local analysis. From the overall analysis and statistical sense, texture has certain regularity. From the perspective of regional statistics, the method of analyzing texture image is called statistical-based texture analysis method. The model method regards the distribution of texture primitives as a certain mathematical model, and uses the corresponding methods in statistics, signal analysis, etc. to analyze the texture model and obtain some texture features. The spectral method transforms the texture image in the spatial domain to the frequency domain, and uses signal processing methods such as Fourier transform to obtain texture features that are not easy to obtain in the spatial domain, such as period, power spectrum, etc.

[0004] Texture research has important applications in many fields, such as target recognition and analysis, product inspection, medical image analysis, remote sensing image analysis, document processing, three-dimensional reconstruction, image retrieval, military camouflage, and motion analysis, etc. Texture is mainly applied in two categories in the field of target recognition and analysis, one is target surface characteristic analysis and identification, and the other is target region segmentation. When there is relative motion between the target and the camera, some specific texture features in the image will change accordingly, and detecting and describing such changes can describe the relative motion between the two.

[0005] Therefore, based on the characteristics and applications of texture, the present application proposes a method for calculating the deformation degree of a target based on a vertical projection histogram. Summary of the Invention

[0006] To address the aforementioned issues, this invention proposes a method and apparatus for calculating the degree of deformation of a target based on a vertical projection histogram, which enables the determination of the degree of deformation in a target region.

[0007] The technical solution adopted by this invention to solve its technical problem is as follows:

[0008] In a first aspect, the present invention provides a method for calculating the degree of deformation of a target based on a vertical projection histogram, comprising the following steps:

[0009] Obtain a sequence of N consecutively captured images, perform background modeling to obtain a background image, where N is a natural number greater than 2;

[0010] Calculate the grayscale standard deviation for each pixel of the background image;

[0011] The selected target region in the background image is vertically projected, and the grayscale features of the target region in the background image and the real-time frame image are calculated.

[0012] Determine the difference in grayscale features between the target region and the background image and the real-time frame;

[0013] The degree of deformation of the target region is calculated based on the difference in grayscale features between the target region and the real-time frame.

[0014] As one possible implementation of this embodiment, the step of acquiring a sequence of N consecutively captured images and performing background modeling to obtain a background image includes:

[0015] Acquire a sequence of N consecutive frames of images over a period of time, in which no target appears in the images;

[0016] Each frame of the image sequence is converted to grayscale.

[0017] Edge detection is performed on the image using the Canny operator;

[0018] The average grayscale value at each pixel location in the N-frame image sequence is calculated to obtain the background grayscale value at that location.

[0019] As one possible implementation of this embodiment, the formula for calculating the background grayscale value is:

[0020]

[0021] in, g is the average gray value at pixel position (i,j). t (i,j) is the gray value at pixel position (i,j) in the current t-th frame, and N is the number of frames in the continuous image sequence.

[0022] As one possible implementation of this embodiment, the formula for calculating the grayscale standard deviation for each pixel of the background image is:

[0023]

[0024] Where, σ b (i,j) represents the standard deviation of the grayscale value at pixel position (i,j), g t (i,j) is the gray value at pixel position (i,j) in the t-th frame of the N-frame image sequence. is the average gray value at pixel position (i,j), and N is the number of frames in the image sequence.

[0025] As one possible implementation of this embodiment, the step of vertically projecting the selected target region in the background image and calculating the grayscale features of the target region in the background image and the real-time frame image includes:

[0026] Select the target rectangle area in the background image, where (x1, y1) is the upper left corner of the target rectangle and (x2, y2) is the lower right corner of the target rectangle;

[0027] Perform a vertical projection on the target rectangular region in the background image to obtain the vertical projection histogram of the target rectangular region;

[0028] Calculate the mean pixel grayscale value of the target rectangular region in the background image:

[0029]

[0030] in, The average grayscale value of the pixels in the target area. Let (x1, y1) be the gray value at pixel position (i, j), (x2, y2) be the top left corner of the target rectangle, and (x2, y2) be the bottom right corner of the target rectangle.

[0031] Calculate the mean of the standard deviation of pixel gray levels in the target rectangular region of the background image:

[0032]

[0033] in, σ is the mean of the standard deviation of pixel gray levels in the target region. b (i,j) is the grayscale standard deviation at pixel position (i,j) in the target region, (x1,y1) is the top left corner of the target rectangle, and (x2,y2) is the bottom right corner of the target rectangle;

[0034] Perform a vertical projection on the target rectangular region in the real-time frame image to obtain the vertical projection histogram of the target rectangular region.

[0035] Calculate the mean pixel grayscale value of the target rectangular region in the real-time frame image:

[0036]

[0037] in, This represents the average grayscale value of the pixels within the target rectangular region of the real-time frame image. Let (x1, y1) be the grayscale value at pixel position (i, j), (x1, y1) be the top left corner of the target rectangle, and (x2, y2) be the bottom right corner of the target rectangle.

[0038] As one possible implementation of this embodiment, the determination of the difference in grayscale features between the target region and the real-time frame includes:

[0039] Determine the mean pixel grayscale value of the target rectangular region in a real-time frame image. Is it in If the target is within the range of 'internal', it is considered that the degree of deformation is small; otherwise, it is considered that the degree of deformation is large.

[0040] As one possible implementation of this embodiment, the step of calculating the deformation degree of the target region based on the difference in grayscale features between the target region in the background image and the real-time frame includes:

[0041] Define a target deformation coefficient to represent the degree of deformation of the target region;

[0042] The target deformation coefficient is calculated as k:

[0043]

[0044] Where k is the target deformation coefficient. This represents the average grayscale value of the pixels within the target rectangular region of the real-time frame. This represents the average grayscale value of the pixels within the target rectangular region of the background image. This is the mean of the standard deviation of the pixel grayscale values ​​in the target rectangular region of the background image.

[0045] Secondly, an embodiment of the present invention provides an apparatus for calculating the degree of deformation of a target based on a vertical projection histogram, comprising:

[0046] The background image acquisition module is used to acquire a sequence of N consecutively captured images, perform background modeling to obtain a background image, where N is a natural number greater than 2;

[0047] The grayscale standard deviation calculation module is used to calculate the grayscale standard deviation for each pixel of the background image;

[0048] The grayscale feature calculation module is used to perform vertical projection on the selected target region in the background image and calculate the grayscale features of the target region in the background image and the real-time frame image.

[0049] The grayscale feature difference judgment module is used to judge the difference in grayscale features between the target area and the background image and the real-time frame;

[0050] The deformation degree calculation module is used to calculate the degree of deformation of the target area based on the difference in grayscale features between the target area in the background image and the real-time frame.

[0051] Thirdly, a computer device includes a processor, a memory, and a bus, the memory storing machine-readable instructions executable by the processor, wherein when the computer device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for calculating the degree of deformation of a target based on a vertical projection histogram as described above.

[0052] Fourthly, embodiments of the present invention provide a storage medium storing a computer program, which, when run by a processor, executes the steps of any of the methods described above for calculating the degree of target deformation based on a vertical projection histogram.

[0053] The technical solutions of the embodiments of the present invention can have the following beneficial effects:

[0054] The technical solution of this invention acquires a sequence of N consecutively captured images, performs background modeling to obtain a background image; calculates the grayscale standard deviation for each pixel in the background image; performs vertical projection on a selected target region in the background image, and calculates the grayscale features of the target region in the background image and the real-time frame image; determines the difference in grayscale features between the target region in the background image and the real-time frame; and calculates the degree of deformation of the target region based on the difference in grayscale features between the background image and the real-time frame. This invention obtains a projection histogram of the target region by performing vertical projection on the image, extracts the feature information of the histogram to calculate the grayscale features of the target region in the background image and the real-time frame image, and calculates the degree of deformation of the target region based on the difference in grayscale features between the background image and the real-time frame. This not only achieves the determination of the degree of deformation of the target region, but also accurately and efficiently determines the degree of deformation of the target region while meeting real-time requirements. Attached Figure Description

[0055] Figure 1 This is a flowchart illustrating a method for calculating the degree of target deformation based on a vertical projection histogram, according to an exemplary embodiment.

[0056] Figure 2 This is a schematic diagram illustrating a target rectangular frame region according to an exemplary embodiment;

[0057] Figure 3 This is a schematic diagram of an apparatus for calculating the degree of deformation of a target based on a vertical projection histogram, according to an exemplary embodiment.

[0058] Figure 4 This is a flowchart illustrating, according to an exemplary embodiment, a method for calculating the degree of target deformation using the apparatus described in this invention. Detailed Implementation

[0059] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0060] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure of the invention, components and arrangements of specific examples are described below. Furthermore, reference numerals and / or letters may be repeated in different examples. This repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. Descriptions of well-known components, processing techniques, and processes are omitted in this invention to avoid unnecessarily limiting the invention.

[0061] like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for calculating the degree of deformation of a target based on a vertical projection histogram, comprising the following steps:

[0062] Obtain a sequence of N consecutively captured images, perform background modeling to obtain a background image, where N is a natural number greater than 2;

[0063] Calculate the grayscale standard deviation for each pixel of the background image;

[0064] The selected target region in the background image is vertically projected, and the grayscale features of the target region in the background image and the real-time frame image are calculated.

[0065] Determine the difference in grayscale features between the target region and the background image and the real-time frame;

[0066] The degree of deformation of the target region is calculated based on the difference in grayscale features between the target region and the real-time frame.

[0067] As one possible implementation of this embodiment, the step of acquiring a sequence of N consecutively captured images and performing background modeling to obtain a background image includes:

[0068] Acquire a sequence of N consecutive frames of images over a period of time, in which no target appears in the images;

[0069] Each frame of the image sequence is converted to grayscale.

[0070] Edge detection is performed on the image using the Canny operator;

[0071] The average grayscale value at each pixel location in the N-frame image sequence is calculated to obtain the background grayscale value at that location.

[0072] As one possible implementation of this embodiment, the formula for calculating the background grayscale value is:

[0073]

[0074] in, g is the average gray value at pixel position (i,j). t (i,j) is the gray value at pixel position (i,j) in the current t-th frame, and N is the number of frames in the continuous image sequence.

[0075] As one possible implementation of this embodiment, the formula for calculating the grayscale standard deviation for each pixel of the background image is:

[0076]

[0077] Where, σ b (i,j) represents the standard deviation of the grayscale value at pixel position (i,j), g t (i,j) is the gray value at pixel position (i,j) in the t-th frame of the N-frame image sequence. is the average gray value at pixel position (i,j), and N is the number of frames in the image sequence.

[0078] As one possible implementation of this embodiment, the step of vertically projecting the selected target region in the background image and calculating the grayscale features of the target region in the background image and the real-time frame image includes:

[0079] Select the target rectangular area in the background image, such as Figure 2 As shown, (x1, y1) is the top left corner of the target rectangle, and (x2, y2) is the bottom right corner of the target rectangle;

[0080] Perform a vertical projection on the target rectangular region in the background image to obtain the vertical projection histogram of the target rectangular region;

[0081] Calculate the mean pixel grayscale value of the target rectangular region in the background image:

[0082]

[0083] in, The average grayscale value of the pixels in the target area. Let (x1, y1) be the gray value at pixel position (i, j), (x2, y2) be the top left corner of the target rectangle, and (x2, y2) be the bottom right corner of the target rectangle.

[0084] Calculate the mean of the standard deviation of pixel gray levels in the target rectangular region of the background image:

[0085]

[0086] in, σ is the mean of the standard deviation of pixel gray levels in the target region. b (i,j) is the grayscale standard deviation at pixel position (i,j) in the target region, (x1,y1) is the top left corner of the target rectangle, and (x2,y2) is the bottom right corner of the target rectangle;

[0087] Perform a vertical projection on the target rectangular region in the real-time frame image to obtain the vertical projection histogram of the target rectangular region.

[0088] Calculate the mean pixel grayscale value of the target rectangular region in the real-time frame image:

[0089]

[0090] in, This represents the average grayscale value of the pixels within the target rectangular region of the real-time frame image. Let (x1, y1) be the grayscale value at pixel position (i, j), (x1, y1) be the top left corner of the target rectangle, and (x2, y2) be the bottom right corner of the target rectangle.

[0091] As one possible implementation of this embodiment, the determination of the difference in grayscale features between the target region and the real-time frame includes:

[0092] Determine the mean pixel grayscale value of the target rectangular region in a real-time frame image. Is it in If the target is within the range of 'internal', it is considered that the degree of deformation is small; otherwise, it is considered that the degree of deformation is large.

[0093] As one possible implementation of this embodiment, the step of calculating the deformation degree of the target region based on the difference in grayscale features between the target region in the background image and the real-time frame includes:

[0094] Define a target deformation coefficient to represent the degree of deformation of the target region;

[0095] The target deformation coefficient is calculated as k:

[0096]

[0097] Where k is the target deformation coefficient. This represents the average grayscale value of the pixels within the target rectangular region of the real-time frame. This represents the average grayscale value of the pixels within the target rectangular region of the background image. This is the mean of the standard deviation of the pixel grayscale values ​​in the target rectangular region of the background image.

[0098] like Figure 3 As shown in the figure, an embodiment of the present invention provides an apparatus for calculating the degree of deformation of a target based on a vertical projection histogram, comprising:

[0099] The background image acquisition module is used to acquire a sequence of N consecutively captured images, perform background modeling to obtain a background image, where N is a natural number greater than 2;

[0100] The grayscale standard deviation calculation module is used to calculate the grayscale standard deviation for each pixel of the background image;

[0101] The grayscale feature calculation module is used to perform vertical projection on the selected target region in the background image and calculate the grayscale features of the target region in the background image and the real-time frame image.

[0102] The grayscale feature difference judgment module is used to judge the difference in grayscale features between the target area and the background image and the real-time frame;

[0103] The deformation degree calculation module is used to calculate the degree of deformation of the target area based on the difference in grayscale features between the target area in the background image and the real-time frame.

[0104] This invention takes a sequence of N consecutive frames of images over a period of time, performs background modeling to obtain a background image, calculates the mean and standard deviation of grayscale for each pixel in the background image, selects a target region in the image, performs vertical projection on the target region, obtains the grayscale features of the target region in the background image and the real-time frame image, determines the difference in grayscale features between the background image and the real-time frame, defines a target deformation coefficient based on the difference in grayscale features between the background image and the real-time frame, and calculates the degree of deformation of the target region. Figure 4 As shown, the specific process of calculating the degree of target deformation using the device described in this invention is as follows.

[0105] Step 1: Take a sequence of N consecutive frames of images over a period of time, and perform background modeling to obtain the background image. This step includes the following steps:

[0106] Step 1: Take a sequence of N consecutive frames of images over a period of time, where no target appears in the images;

[0107] Step 2: Convert each frame of the image sequence to grayscale;

[0108] Step 3: Use the Canny operator to perform edge detection on the image;

[0109] Step 4: Calculate the average grayscale value for each pixel position in this N-frame sequence; this average value is the background grayscale value for that position. Let the grayscale value at pixel position (i,j) in the current t-th frame be g. t (i,j), then the average background of the N-frame image sequence is calculated according to the following formula:

[0110]

[0111] in, is the average gray value at pixel position (i,j), and N is the number of frames in the continuous image sequence.

[0112] Step 2: Calculate the grayscale standard deviation for each pixel of the background image. This step includes the following steps:

[0113] Step 1: Calculate the standard deviation σ of the gray levels at corresponding positions in this N-frame sequence. b (i,j), the formula for calculating the standard deviation is as follows:

[0114]

[0115] Where, σ b (i,j) represents the standard deviation of the grayscale value at pixel position (i,j), g t (i,j) is the gray value at pixel position (i,j) in the t-th frame of the N-frame image sequence. is the average gray value at pixel position (i,j), and N is the number of frames in the image sequence.

[0116] Step 3: Select the target region in the image, perform vertical projection on the target region, and obtain the grayscale features of the target region in the background image and the real-time frame image. This step includes the following steps:

[0117] Step 1: Select the target area in the image, such as... Figure 2 The rectangle shown is defined as follows, where (x1, y1) is the top left corner of the target rectangle and (x2, y2) is the bottom right corner of the target rectangle.

[0118] Step 2: Perform a vertical projection on the target region in the background image to obtain the vertical projection histogram of the target region.

[0119] Step 3: Calculate the mean gray value of the pixels in this target region in the background image. The calculation formula is as follows:

[0120]

[0121] in, The average grayscale value of the pixels in the target area. Let (x1, y1) be the grayscale value at pixel position (i, j), (x1, y1) be the top left corner of the target rectangle, and (x2, y2) be the bottom right corner of the target rectangle.

[0122] Step 4: Calculate the mean of the standard deviation of the pixel gray levels of this target region in the background image. The calculation formula is as follows:

[0123]

[0124] in, σ is the mean of the standard deviation of pixel gray levels in the target region. b (i,j) represents the grayscale standard deviation at pixel position (i,j) in the target region, (x1,y1) represents the top left corner of the target rectangle, and (x2,y2) represents the bottom right corner of the target rectangle.

[0125] Step 5: Perform vertical projection on the target region in the real-time frame image to obtain the vertical projection histogram of the target region;

[0126] Step 6: Calculate the mean pixel grayscale value of this target region in the real-time frame image. The calculation formula is as follows:

[0127]

[0128] in, The average grayscale value of the pixels in the target area. Let (x1, y1) be the grayscale value at pixel position (i, j), (x1, y1) be the top left corner of the target rectangle, and (x2, y2) be the bottom right corner of the target rectangle.

[0129] Step 4: Determine the difference in grayscale features between the target region and the background image and the real-time frame. The specific details are as follows:

[0130] Step 1: Judgment Is it in Inside;

[0131] Step 2: If exist The internal deformation of the target is considered to be relatively small.

[0132] Step 3: If Not here The interior is considered to have a relatively large degree of deformation.

[0133] Step 5: Based on the difference in grayscale features between the target region and the real-time frame, define the target deformation coefficient and calculate the degree of deformation of the target region. The specific details are as follows:

[0134] Step 1: Define the target deformation coefficient to represent the degree of deformation of the target region;

[0135] Step 2: The target deformation coefficient is k, and the calculation formula is as follows:

[0136]

[0137] Where k is the target deformation coefficient. The average grayscale value of pixels in the target region of the real-time frame. The average grayscale value of the target region of the background image. This is the mean of the standard deviation of the pixel grayscale values ​​in the target region of the background image.

[0138] An embodiment of the present invention provides a computer device including a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for calculating the degree of target deformation based on the vertical projection histogram as described above.

[0139] An embodiment of the present invention provides a computer device including a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the methods described above for calculating the degree of target deformation based on a vertical projection histogram.

[0140] Specifically, the aforementioned memory and processor can be general-purpose memory and processor, without any specific limitations. When the processor runs the computer program stored in the memory, it can execute the aforementioned method for calculating the degree of target deformation based on the vertical projection histogram.

[0141] Those skilled in the art will understand that the structure of the computer device does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine some components, or split some components, or have different component arrangements.

[0142] In some embodiments, the computer device may further include a touchscreen for displaying a graphical user interface (e.g., an application launch screen) and receiving user actions on the graphical user interface (e.g., launching an application). Specifically, the touchscreen may include a display panel and a touch panel. The display panel may be configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or similar type. The touch panel can collect user touch or non-touch operations on or near it and generate pre-set operation instructions, such as user actions using fingers, styluses, or any suitable object or accessory on or near the touch panel. Additionally, the touch panel may include a touch detection device and a touch controller. The touch detection device detects the user's touch orientation and posture, and detects the signals generated by the touch operation, transmitting the signals to the touch controller. The touch controller receives touch information from the touch detection device, converts it into information that the processor can process, sends it to the processor, and can also receive and execute commands from the processor. Furthermore, touch panels can be implemented using various types of sensors, including resistive, capacitive, infrared, and surface acoustic wave sensors, as well as any future technologies. Moreover, the touch panel can cover the display panel. Users can operate on or near the touch panel, which is covered by the graphical user interface displayed on the display panel. After detecting the operation on or near the touch panel, the touch panel transmits it to the processor to determine the user input. The processor then responds to the user input by providing corresponding visual output on the display panel. Additionally, the touch panel and display panel can be implemented as two separate components or integrated together.

[0143] Corresponding to the above application startup method, this embodiment of the invention also provides a storage medium storing a computer program, which, when run by a processor, executes the steps of any of the methods described above for calculating the degree of target deformation based on a vertical projection histogram.

[0144] The application launch device provided in this application embodiment can be specific hardware on the device or software or firmware installed on the device. The device provided in this application embodiment has the same implementation principle and technical effects as the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.

[0145] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0146] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0147] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0148] In addition, the functional modules in the embodiments provided in this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0149] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0150] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0151] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for calculating the degree of target deformation based on vertical projection histogram, characterized in that, Includes the following steps: Obtain a sequence of N consecutively captured images, perform background modeling to obtain a background image, where N is a natural number greater than 2; Calculate the grayscale standard deviation for each pixel of the background image; The selected target region in the background image is vertically projected, and the grayscale features of the target region in the background image and the real-time frame image are calculated. Determine the difference in grayscale features between the target region and the background image and the real-time frame; The degree of deformation of the target region is calculated based on the difference in grayscale features between the target region and the real-time frame. The step of vertically projecting the selected target region in the background image and calculating the grayscale features of the target region in the background image and the real-time frame image includes: Select the target rectangular area in the background image. The top left corner of the target rectangle. The bottom right corner of the target rectangle; Perform a vertical projection on the target rectangular region in the background image to obtain the vertical projection histogram of the target rectangular region; Calculate the mean pixel grayscale value of the target rectangular region in the background image: in, The average grayscale value of the pixels in the target area. pixel position grayscale value at that location The top left corner of the target rectangle. The bottom right corner of the target rectangle; Calculate the mean of the standard deviation of pixel gray levels in the target rectangular region of the background image: in, The mean of the standard deviation of pixel gray levels in the target region. pixel position of the target region The standard deviation of gray level at that location; Perform a vertical projection on the target rectangular region in the real-time frame image to obtain the vertical projection histogram of the target rectangular region. Calculate the mean pixel grayscale value of the target rectangular region in the real-time frame image: in, This represents the average grayscale value of the pixels within the target rectangular region of the real-time frame image. pixel position The grayscale value at that location; The determination of the difference in grayscale features between the target region and the real-time frame includes: Determine the mean pixel grayscale value of the target rectangular region in a real-time frame image. Is it in ( If the target is within the range of 'internal', it is considered that the degree of deformation is small; otherwise, it is considered that the degree of deformation is large.

2. The method for calculating the degree of target deformation based on vertical projection histogram according to claim 1, characterized in that, The step of acquiring a sequence of N consecutively captured images and performing background modeling to obtain a background image includes: Acquire a sequence of N consecutive frames of images over a period of time, in which no target appears in the images; Each frame of the image sequence is converted to grayscale. Edge detection is performed on the image using the Canny operator; The average grayscale value at each pixel location in the N-frame image sequence is calculated to obtain the background grayscale value at that location.

3. The method for calculating the degree of target deformation based on vertical projection histogram according to claim 2, characterized in that, The formula for calculating the background grayscale value is: in, pixel position The average gray value at that location The current pixel position in frame t. The gray value at the specified location, where N is the number of frames in the continuous image sequence.

4. The method for calculating the degree of target deformation based on the vertical projection histogram according to claim 3, characterized in that, The formula for calculating the grayscale standard deviation for each pixel of the background image is: in, pixel position Standard deviation of gray values ​​at that location The pixel position in the t-th frame of an N-frame image sequence. grayscale value at that location pixel position The average grayscale value at point N is the number of frames in the image sequence.

5. The method for calculating the degree of target deformation based on vertical projection histogram according to claim 1, characterized in that, The step of calculating the degree of deformation of the target region based on the difference in grayscale features between the target region in the background image and the real-time frame includes: Define a target deformation coefficient to represent the degree of deformation of the target region; The target deformation coefficient is calculated as follows: : in, The target deformation coefficient, This represents the average grayscale value of the pixels within the target rectangular region of the real-time frame. This represents the average grayscale value of the pixels within the target rectangular region of the background image. This is the mean of the standard deviation of the pixel grayscale values ​​in the target rectangular region of the background image.

6. A device for calculating the degree of deformation of a target based on a vertical projection histogram, characterized in that, include: The background image acquisition module is used to acquire a sequence of N consecutively captured images, perform background modeling to obtain a background image, where N is a natural number greater than 2; The grayscale standard deviation calculation module is used to calculate the grayscale standard deviation for each pixel of the background image; The grayscale feature calculation module is used to perform vertical projection on the selected target region in the background image and calculate the grayscale features of the target region in the background image and the real-time frame image. The grayscale feature difference judgment module is used to judge the difference in grayscale features between the target area and the background image and the real-time frame; The deformation degree calculation module is used to calculate the degree of deformation of the target area based on the difference in grayscale features between the target area in the background image and the real-time frame. The step of vertically projecting the selected target region in the background image and calculating the grayscale features of the target region in the background image and the real-time frame image includes: Select the target rectangular area in the background image. The top left corner of the target rectangle. The bottom right corner of the target rectangle; Perform a vertical projection on the target rectangular region in the background image to obtain the vertical projection histogram of the target rectangular region; Calculate the mean pixel grayscale value of the target rectangular region in the background image: in, The average grayscale value of the pixels in the target area. pixel position grayscale value at that location The top left corner of the target rectangle. The bottom right corner of the target rectangle; Calculate the mean of the standard deviation of pixel gray levels in the target rectangular region of the background image: in, The mean of the standard deviation of pixel gray levels in the target region. pixel position of the target region The standard deviation of gray level at that location; Perform a vertical projection on the target rectangular region in the real-time frame image to obtain the vertical projection histogram of the target rectangular region. Calculate the mean pixel grayscale value of the target rectangular region in the real-time frame image: in, This represents the average grayscale value of the pixels within the target rectangular region of the real-time frame image. pixel position The grayscale value at that location; The determination of the difference in grayscale features between the target region and the real-time frame includes: Determine the mean pixel grayscale value of the target rectangular region in a real-time frame image. Is it in ( If the target is within the range of 'internal', it is considered that the degree of deformation is small; otherwise, it is considered that the degree of deformation is large.

7. A computer device, characterized in that, The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for calculating the degree of target deformation based on a vertical projection histogram as described in any one of claims 1-5.

8. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, performs the steps of the method for calculating the degree of target deformation based on a vertical projection histogram as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Moving object extraction method and moving object extraction device

    CN103793921A

  • Real-time detection method and device for weak and small targets in image sequence

    CN113780110A