Image processing method, device and computer storage medium
By generating smoke simulation videos, using the state transfer equations of background images and smoke images, the problem of insufficient training data of shared power truck warehouse fire detection model is solved, and the richness and effectiveness of the data set is achieved.
Patent Information
- Application Number
- CN202210144315.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2042-02-17
AI Technical Summary
The prior art is difficult to collect a large number of diverse smoke image data sets for fire detection model training in shared power truck warehouses.
By generating smoke simulation videos, the state transfer equations of the background image and smoke image are used to initialize the state transfer parameters, and the smoke simulation video is generated based on the fusion parameters to provide a data basis.
It provides a variety of smoke image data sets for smoke detection models, improving the data richness and effectiveness of model training.
Smart Images

Figure CN114549381B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, device and computer storage medium. Background Art
[0002] With the development of shared electric bicycle business, battery safety and fire protection issues in electric bicycle warehouses in large, medium and small cities across the country have become increasingly prominent. In order to solve the safety problems of electric bicycle warehouses, real-time smoke detection algorithms based on deep learning methods have received widespread attention.
[0003] In the prior art, in order to implement a real-time smoke detection algorithm based on deep learning methods, it is necessary to collect a large and diverse smoke image dataset. However, a fire in a shared moped warehouse is a low-probability abnormal event, and due to the complexity of the warehouse scene and the uncertainty of environmental factors, it is difficult to collect a large and diverse smoke image dataset for model training.
[0004] Therefore, those skilled in the art are committed to developing an image processing method, device and computer storage medium that can generate a large number of diverse smoke images. Summary of the invention
[0005] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention is: how to collect a large number of diverse smoke image data sets for model training.
[0006] To achieve the above object, the present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides an image processing method, which includes: acquiring a background image and a smoke image; initializing a state transfer equation of the smoke image based on the original image parameters of the smoke image, and determining the state transfer parameters of the smoke image in a state transfer process, wherein one state transfer change corresponds to a set of state transfer parameters; determining fusion parameters based on the state transfer parameters and the image parameters of the background image, and generating a smoke simulation video based on the fusion parameters.
[0008] In the embodiment of the present invention, since a background image and a smoke image can be obtained, after the state transfer equation of the smoke image is initialized, the state transfer parameters of the smoke image in the state transfer process are determined, and the fusion parameters are determined according to the state transfer parameters and the image parameters of the obtained background image. Therefore, smoke simulation videos with different smoke forms under the same background image can be generated based on the fusion parameters, thereby providing a data basis for the training of the smoke detection model.
[0009] In a preferred embodiment of the present invention, the original image parameters include image transparency, image size, coordinates of the upper left corner of the image and motion speed; the state transfer equation of the smoke image includes: image transparency Image size s = s + r; the coordinates of the upper left corner of the image (x, y) = (x + v x ,y+v y ); Movement speed Among them, r is a random number between [0,1), f is the transparency attenuation coefficient, and a is the acceleration coefficient.
[0010] In a preferred embodiment of the present invention, before determining the fusion parameters according to the state transfer parameters and the image parameters of the background image, the method further includes: judging whether the image transparency o of the smoke image in the state transfer process is greater than a preset transparency threshold threshold, and judging whether the smoke image in the state transfer process can be transferred within the target object area; if the image transparency o is not greater than the preset transparency threshold threshold, or the smoke image cannot be transferred within the target object area, reinitializing the state transfer equation of the smoke image; determining the fusion parameters according to the state transfer parameters and the image parameters of the background image includes: if the image transparency o is greater than the preset transparency threshold threshold, and the smoke image can be transferred within the target object area, determining the fusion parameters according to the state transfer parameters and the image parameters of the background image.
[0011] In a preferred embodiment of the present invention, the above-mentioned determination of whether the smoke image in the process of state transfer can be transferred within the target object area includes: obtaining the coordinates of the upper left corner point (x, y) and the coordinates of the lower right corner point (x+s, y+s) of the smoke image in the process of state transfer; determining whether the coordinates of the upper left corner point (x, y) and the coordinates of the lower right corner point (x+s, y+s) meet preset conditions, and the preset conditions include: x is greater than x 1 , y is greater than y 1 , (x+s) is less than x 2 , (y+s) is less than y 2 ; Among them, (x 1 ,y 1 ) is the coordinate of the upper left corner of the target object area, (x 2 ,y 2 ) are the coordinates of the lower right corner point of the target object area.
[0012] In a preferred embodiment of the present invention, after obtaining the background image, the method further comprises: determining the target object area from the background image; determining first coordinate information of the target object area, wherein the first coordinate information comprises: the coordinates of the upper left corner point (x 1 ,y 1 ) and the coordinates of the lower right corner point (x 2 ,y 2 ).
[0013] In a preferred embodiment of the present invention, the above-mentioned determination of fusion parameters based on the state transition parameters and the image parameters of the background image includes: determining the pixel value of each image frame in the smoke simulation video according to the formula I=αF+(1-α)B; wherein I is the pixel value of the image frame in the smoke simulation video, F is the pixel value of the smoke image, B is the pixel value of the background image, α is the value of the image transparency of the smoke image after normalization, and α is a value between [0,1].
[0014] In a preferred embodiment of the present invention, after acquiring the smoke image, the method further comprises: converting the smoke image into a grayscale image; according to the formula: The smoke image is converted from a three-channel image to a four-channel image including image transparency; wherein max is the maximum pixel value in the grayscale image, and p is the pixel value in the grayscale image.
[0015] In a preferred embodiment of the present invention, after the smoke simulation video is obtained, the method further comprises: determining second coordinate information of the smoke area in the smoke simulation video according to the coordinates (x, y) of the upper left corner point of the smoke image in the state transition process and the image size s, wherein the second coordinate information includes the minimum value (x, y) of the coordinates of the upper left corner point of the smoke area 3 ,y 3 ) and the maximum value (x 4 ,y 4 ); displaying the second coordinate information in the smoke simulation video.
[0016] In a second aspect, the present invention provides an image processing device, comprising: an acquisition unit and a processing unit; the acquisition unit is used to acquire a background image and a smoke image; the processing unit is used to initialize the state transfer equation of the smoke image based on the original image parameters of the smoke image, and determine the state transfer parameters of the smoke image in the state transfer process, one state transfer change corresponds to a set of state transfer parameters; determine fusion parameters according to the state transfer parameters and the image parameters of the background image, and generate a smoke simulation video based on the fusion parameters.
[0017] In a third aspect, the present invention provides an image processing device, comprising a memory and a processor. The memory is used to store computer-executable instructions, and the processor is connected to the memory via a bus. When the image processing device is running, the processor executes the computer-executable instructions stored in the memory, so that the image processing device performs the image processing method provided by the first aspect and various possible implementations thereof.
[0018] In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium comprising computer execution instructions, which, when executed on a computer, enable an image processing device to execute the image processing method provided in the first aspect and its various possible implementations.
[0019] In a fifth aspect, a computer program product is provided, which includes computer instructions. When the computer instructions are executed on a computer, an image processing device executes the image processing method provided in the first aspect and various possible implementations thereof.
[0020] It should be noted that the above-mentioned computer instructions may be stored in whole or in part on a computer-readable storage medium. The computer-readable storage medium may be packaged together with a processor executing the image processing device, or may be packaged separately from the processor executing the image processing device, which is not limited in the embodiment of the present invention.
[0021] The description of the second, third, fourth and fifth aspects of the present invention can refer to the detailed description of the first aspect; and the beneficial effects described in the second, third, fourth and fifth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.
[0022] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flowchart of a preferred embodiment of the image processing method provided by the embodiment of the present invention;
[0024] Figure 2 It is one of the structural schematic diagrams of the image processing device provided by the embodiment of the present invention;
[0025] Figure 3 This is the second structural schematic diagram of the image processing device provided by the embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0027] It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0028] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present invention is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0029] In order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", etc. are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. are not limiting the quantity and execution order.
[0030] While some exemplary embodiments of the present invention have been described for the purpose of illustration, it should be understood that the present invention may be implemented in other ways not specifically shown in the drawings.
[0031] The above implementation is described in detail below with reference to specific embodiments and drawings.
[0032] like Figure 1As shown, an embodiment of the present invention provides an image processing method, which can be applied to an image processing device. The image processing device can be a component, an integrated circuit, or a chip in a terminal, a mobile electronic device such as a laptop, or a non-mobile electronic device such as a server. The image processing method may include: S101-S103:
[0033] S101: An image processing device obtains a background image and a smoke image.
[0034] Optionally, the process of the image processing device acquiring the background image includes: the image processing device can acquire daily videos of the shared power-assisted vehicle warehouse collected by the warehouse monitoring system, and then extract background image frames from the acquired daily videos, wherein the background image frames refer to image frames captured by the fixed camera when there are no moving objects within the shooting range, or image frames captured by the fixed camera within the shooting range when the movement frequency of the moving object is less than a first threshold, wherein the first threshold can be a movement frequency threshold preset by the user, that is, a moving object with a movement frequency less than the first threshold can be regarded as a stationary object. Afterwards, the image processing device can determine the extracted background image frames as the background image.
[0035] Optionally, after acquiring the background image, the image processing device may determine the target object area from the background image, and the target object area may be an image area centered on the image area of the flammable object in the background image. For example, the flammable object may be a tram or a battery. Afterwards, the image processing device may determine the first coordinate information of the target object area, and the first coordinate information includes: the coordinates of the upper left corner point (x 1 ,y 1 ) and the coordinates of the lower right corner (x 2 ,y 2 ).
[0036] Optionally, the process of the image processing device acquiring the smoke image includes: the image processing device can collect the smoke image with a pure background through network download or user input. The smoke image is a four-channel image including image transparency.
[0037] Optionally, when the collected smoke image is an RGB three-channel image, the image processing device may convert the smoke image from a three-channel image to a four-channel image including image transparency. The specific process includes: the image processing device first converts the smoke image into a grayscale image; then, according to the formula: Convert the smoke image from a three-channel image to a four-channel image including image transparency; where max is the maximum pixel value in the grayscale image and p is the pixel value in the grayscale image.
[0038] For example, the smoke image converted to grayscale includes pixel 1, pixel 2, and pixel 3. If pixel 1 corresponds to pixel value 1, pixel 2 corresponds to pixel value 2, and pixel 3 corresponds to pixel value 3, and the maximum pixel value in the grayscale image is pixel value 3, then the image transparency o corresponding to pixel 1 is The image transparency o corresponding to pixel 2 is The image transparency o corresponding to pixel 3 is 255.
[0039] Optionally, after converting the smoke image from a three-channel image to a four-channel image including image transparency, the image processing device may save the four-channel image locally in a png format.
[0040] S102: The image processing device initializes a state transfer equation of the smoke image based on original image parameters of the smoke image, and determines state transfer parameters of the smoke image in a state transfer process.
[0041] Among them, a state transition change corresponds to a set of state transition parameters.
[0042] Optionally, the original image parameters may include image transparency, image size, coordinates of the upper left corner of the image, and movement speed. The state transfer equation of the smoke image may include:
[0043] Image transparency
[0044] Image size s = s + r;
[0045] The coordinates of the upper left corner of the image (x, y) = (x + v x ,y+v y );
[0046] Movement speed
[0047] Among them, r is a random number between [0,1), f is the transparency attenuation coefficient, and a is the acceleration coefficient.
[0048] The image processing device initializes the state transfer equation of the smoke image based on the original image parameters of the smoke image, which means that after determining the original image parameters of the smoke image, the image processing device can substitute the original image parameters into the state transfer equation respectively, so that the state transfer equation is continuously iterated.
[0049] For example, take the image transparency in the state transfer equation as an example. The image transparency in the original image parameter is o 0 , then the first iteration is The second iteration is One iteration represents a state transition change, so the state transition parameters of the smoke image after each state transition change can be determined.
[0050] Optionally, after determining the state transfer parameters of the smoke image in the state transfer process, the image processing device may determine whether the image transparency o of the smoke image in the state transfer process is greater than a preset transparency threshold threshold, and determine whether the smoke image in the state transfer process can be transferred within the target object area. If the image transparency o is not greater than the preset transparency threshold threshold, or the smoke image cannot be transferred within the target object area, it is necessary to re-initialize the state transfer equation of the smoke image; if the image transparency o is greater than the preset transparency threshold threshold, and the smoke image can be transferred within the target object area, S103 may be executed.
[0051] Optionally, the image processing device determines whether the smoke image in the state transfer process can be transferred within the target object area, specifically comprising: the image processing device obtains the coordinates of the upper left corner point (x, y) and the coordinates of the lower right corner point (x+s, y+s) of the smoke image in the state transfer process; then, determines whether the coordinates of the upper left corner point (x, y) and the coordinates of the lower right corner point (x+s, y+s) meet preset conditions, and the preset conditions include: x is greater than x 1 , y is greater than y 1 , (x+s) is less than x 2 , (y+s) is less than y 2 ; Among them, (x 1 ,y 1 ) is the coordinate of the upper left corner of the target object area, (x 2 ,y 2 ) is the coordinate of the lower right corner point of the target object area.
[0052] S103: The image processing device determines a fusion parameter according to the state transition parameter and the image parameter of the background image, and generates a smoke simulation video based on the fusion parameter.
[0053] Optionally, the image processing device determines the fusion parameter according to the state transition parameter and the image parameter of the background image, which may specifically include: the image processing device determines the pixel value of each image frame in the smoke simulation video according to the formula I=αF+(1-α)B; wherein I is the pixel value of the image frame in the smoke simulation video, F is the pixel value of the smoke image, B is the pixel value of the background image, α is the value of the image transparency of the smoke image after normalization, and α is a value between [0,1]. That is, the image transparency of the smoke image may be normalized first so that the image transparency becomes a value between [0,1], and then the pixel value of each image frame in the smoke simulation video is determined according to the formula I=αF+(1-α)B. It can be understood that when the image transparency is 0, the pixel value of the target pixel in the fused image frame is the pixel value of the background image, and when the image transparency is 1, the pixel value of the target pixel in the fused image frame is the pixel value of the smoke image.
[0054] Optionally, after obtaining the smoke simulation video, in order to facilitate model training, it is usually necessary to mark the smoke area in the smoke simulation video. Since the coordinates (x, y) of the upper left corner point of the smoke image in the state transition process and the image size s are known in the process of obtaining the smoke simulation video, the image processing device can determine the second coordinate information of the smoke area in the smoke simulation video according to the coordinates (x, y) of the upper left corner point of the smoke image in the state transition process and the image size s, and display the second coordinate information in the smoke simulation video. The second coordinate information includes the minimum value (x 3 ,y 3 ) and the maximum value (x 4 ,y 4 That is, the image processing device can loop through the coordinates (x, y) of the upper left corner of all smoke images in the state transition process to obtain the minimum value (x 3 ,y 3 ); loop through the coordinates of the lower right corner of all smoke images in the state transition process (x+s, y+s), and get the maximum value (x 4 ,y 4 ).
[0055] In the embodiment of the present invention, since a background image and a smoke image can be obtained, after the state transfer equation of the smoke image is initialized, the state transfer parameters of the smoke image in the state transfer process are determined, and the fusion parameters are determined according to the state transfer parameters and the image parameters of the obtained background image. Therefore, smoke simulation videos with different smoke forms under the same background image can be generated based on the fusion parameters, thereby providing a data basis for the training of the smoke detection model.
[0056] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0057] The image processing method provided in the embodiment of the present application can be executed by an image processing device or a control module for image processing in the image processing device. In the embodiment of the present application, the image processing device provided in the embodiment of the present application is described by taking the image processing device executing the image processing method as an example.
[0058] It should be noted that the embodiment of the present application can divide the functional modules of the image processing device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0059] like Figure 2 As shown, an embodiment of the present application provides an image processing device 200. The image processing device 200 includes: an acquisition unit 201 and a processing unit 202. The acquisition unit 201 can be used to acquire a background image and a smoke image; the processing unit 202 can be used to initialize the state transfer equation of the smoke image based on the original image parameters of the smoke image, and determine the state transfer parameters of the smoke image in the state transfer process, and one state transfer change corresponds to a set of state transfer parameters; determine fusion parameters according to the state transfer parameters and the image parameters of the background image, and generate a smoke simulation video based on the fusion parameters.
[0060] Optionally, the original image parameters include image transparency, image size, coordinates of the upper left corner of the image, and motion speed; the state transfer equation of the smoke image includes: image transparency Image size s = s + r; the coordinates of the upper left corner of the image (x, y) = (x + v x ,y+v y ); Movement speed Among them, r is a random number between [0,1), f is the transparency attenuation coefficient, and a is the acceleration coefficient.
[0061] Optionally, before determining the fusion parameters according to the state transfer parameters and the image parameters of the background image, the processing unit 202 can also be used to determine whether the image transparency o of the smoke image in the state transfer process is greater than a preset transparency threshold threshold, and determine whether the smoke image in the state transfer process can be transferred within the target object area; if the image transparency o is not greater than the preset transparency threshold threshold, or the smoke image cannot be transferred within the target object area, then reinitialize the state transfer equation of the smoke image; the processing unit 202 can specifically be used to: if the image transparency o is greater than the preset transparency threshold threshold, and the smoke image can be transferred within the target object area, then determine the fusion parameters according to the state transfer parameters and the image parameters of the background image, and generate a smoke simulation video based on the fusion parameters.
[0062] Optionally, the processing unit 202 may be specifically configured to obtain the coordinates of the upper left corner point (x, y) and the lower right corner point (x+s, y+s) of the smoke image in the state transition process; and determine whether the coordinates of the upper left corner point (x, y) and the lower right corner point (x+s, y+s) meet a preset condition, wherein the preset condition includes: x is greater than x 1 , y is greater than y 1 , (x+s) is less than x 2 , (y+s) is less than y 2 ; Among them, (x 1 ,y 1 ) is the coordinate of the upper left corner of the target object area, (x 2 ,y 2 ) is the coordinate of the lower right corner point of the target object area.
[0063] Optionally, the processing unit 202 may also be configured to determine the target object region from the background image; determine first coordinate information of the target object region, the first coordinate information comprising: the coordinates of the upper left corner point (x 1 ,y 1 ) and the coordinates of the lower right corner point (x 2 ,y 2 ).
[0064] Optionally, the processing unit 202 can be specifically used to determine the pixel value of each image frame in the smoke simulation video according to the formula I=αF+(1-α)B; wherein I is the pixel value of the image frame in the smoke simulation video, F is the pixel value of the smoke image, B is the pixel value of the background image, α is the value of the image transparency of the smoke image after normalization, and α is a value between [0,1].
[0065] Optionally, after acquiring the smoke image, the processing unit 202 may also be used to convert the smoke image into a grayscale image; according to the formula: The smoke image is converted from a three-channel image to a four-channel image including image transparency; wherein max is the maximum pixel value in the grayscale image, and p is the pixel value in the grayscale image.
[0066] Optionally, after the smoke simulation video is obtained, the processing unit 202 may also be used to determine second coordinate information of the smoke area in the smoke simulation video according to the coordinates (x, y) of the upper left corner point of the smoke image in the state transition process and the image size s, wherein the second coordinate information includes the minimum value (x, y) of the coordinates of the upper left corner point of the smoke area 3 ,y 3 ) and the maximum value (x 4 ,y 4 ); displaying the second coordinate information in the smoke simulation video.
[0067] Of course, the image processing device 200 provided in the embodiment of the present application includes but is not limited to the above-mentioned units.
[0068] The image processing device provided by the embodiment of the present invention can obtain a background image and a smoke image, and after initializing the state transfer equation of the smoke image, determine the state transfer parameters of the smoke image in the state transfer process, and determine the fusion parameters according to the state transfer parameters and the image parameters of the acquired background image. Therefore, based on the fusion parameters, a smoke simulation video with different smoke forms under the same background image can be generated, thereby providing a data basis for the training of the smoke detection model.
[0069] The present application also provides a method Figure 3 The image processing device shown includes a processor 11, a memory 12, a communication interface 13, and a bus 14. The processor 11, the memory 12, and the communication interface 13 may be connected via the bus 14.
[0070] The processor 11 is the control center of the image processing device, and can be a processor or a general term for multiple processing elements. For example, the processor 11 can be a general-purpose central processing unit (CPU) or other general-purpose processors. The general-purpose processor can be a microprocessor or any conventional processor.
[0071] As an embodiment, the processor 11 may include one or more CPUs, such as Figure 3 CPU 0 and CPU 1 are shown in .
[0072] The memory 12 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0073] In a possible implementation, the memory 12 may exist independently of the processor 11, and the memory 12 may be connected to the processor 11 via a bus 14 to store instructions or program codes. When the processor 11 calls and executes the instructions or program codes stored in the memory 12, the deployment method of the service function chain provided in the embodiment of the present application can be implemented.
[0074] In another possible implementation, the memory 12 may also be integrated with the processor 11 .
[0075] The communication interface 13 is used to connect with other devices via a communication network. The communication network may be Ethernet, wireless access network, wireless local area network (WLAN), etc. The communication interface 13 may include a receiving unit for receiving data and a sending unit for sending data.
[0076] The bus 14 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0077] It should be pointed out that Figure 3 The structure shown does not constitute a limitation on the image processing device. Figure 3 In addition to the components shown, the image processing device may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0078] The embodiment of the present invention further provides a computer-readable storage medium, which includes computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer executes the steps executed by the image processing device in the image processing method provided in the above embodiment.
[0079] An embodiment of the present invention also provides a computer program product, which can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program product can implement the image processing method provided in the above embodiment and execute each step performed by the image processing device.
[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for a terminal to execute the methods described in each embodiment of the present invention.
[0081] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. An image processing method, It is characterized in that include: Get background image and smoke image; Initializing the state transfer equation of the smoke image based on the original image parameters of the smoke image, and determining the state transfer parameters of the smoke image in the state transfer process, where one state transfer change corresponds to a set of state transfer parameters; Determining fusion parameters according to the state transition parameters and image parameters of the background image, and generating a smoke simulation video based on the fusion parameters; The state transfer equation is used to describe the iteration rule of multiple image parameters of the smoke image during the state transfer process.
2. The image processing method according to claim 1, It is characterized in that The original image parameters include image transparency, image size, coordinates of the upper left corner of the image and movement speed; the state transfer equation of the smoke image includes: Image transparency Image size s = s + r; The coordinates of the upper left corner of the image (x, y) = (x + v x ,y+v y ); Movement speed Among them, r is a random number between [0,1), f is the transparency attenuation coefficient, and a is the acceleration coefficient.
3. The image processing method according to claim 2, It is characterized in that Before determining the fusion parameters according to the state transition parameters and the image parameters of the background image, the method further includes: Determine whether the image transparency o of the smoke image in the process of state transfer is greater than a preset transparency threshold threshold, and determine whether the smoke image in the process of state transfer can be transferred within the target object area; If the image transparency o is not greater than the preset transparency threshold threshold, or the smoke image cannot be transferred within the target object area, then reinitializing the state transfer equation of the smoke image; The determining of the fusion parameter according to the state transition parameter and the image parameter of the background image comprises: If the image transparency o is greater than the preset transparency threshold threshold, and the smoke image can be transferred within the target object area, a fusion parameter is determined according to the state transfer parameter and the image parameter of the background image.
4. The image processing method according to claim 3, It is characterized in that The determining whether the smoke image in the state transfer process can be transferred within the target object area includes: Obtaining the coordinates of the upper left corner point (x, y) and the lower right corner point (x+s, y+s) of the smoke image in the state transition process; Determine whether the coordinates of the upper left corner point (x, y) and the lower right corner point (x+s, y+s) meet the preset conditions, wherein the preset conditions include: x is greater than x 1 , y is greater than y 1 , (x+s) is less than x 2 , (y+s) is less than y 2 ; Among them, (x 1 ,y 1 ) is the coordinate of the upper left corner of the target object area, (x 2 ,y 2 ) is the coordinate of the lower right corner point of the target object area.
5. The image processing method according to claim 4, It is characterized in that After obtaining the background image, the method further includes: Determining the target object area from the background image; Determine the first coordinate information of the target object area, the first coordinate information includes: the coordinates of the upper left corner point (x 1 ,y 1 ) and the coordinates of the lower right corner point (x 2 ,y 2 ).
6. The image processing method according to claim 1, It is characterized in that The determining of the fusion parameter according to the state transition parameter and the image parameter of the background image comprises: Determine the pixel value of each image frame in the smoke simulation video according to the formula I=αF+(1-α)B; Wherein, I is the pixel value of the image frame in the smoke simulation video, F is the pixel value of the smoke image, B is the pixel value of the background image, α is the value of the image transparency of the smoke image after normalization, and α is a value between [0,1].
7. The image processing method according to any one of claims 1 to 6, It is characterized in that After acquiring the smoke image, the method further includes: Converting the smoke image into a grayscale image; According to the formula: Converting the smoke image from a three-channel image to a four-channel image including image transparency; Among them, max is the maximum pixel value in the grayscale image, and p is the pixel value in the grayscale image.
8. The image processing method according to any one of claims 2 to 6, It is characterized in that After generating the smoke simulation video, the method further includes: According to the coordinates (x, y) of the upper left corner of the smoke image in the state transition process and the image size s, second coordinate information of the smoke area in the smoke simulation video is determined, wherein the second coordinate information includes the minimum value (x, y) of the coordinates of the upper left corner of the smoke area 3 ,y 3 ) and the maximum value (x 4 ,y 4 ); The second coordinate information is displayed in the smoke simulation video.
9. An image processing device, It is characterized in that include: Acquisition unit and processing unit; The acquisition unit is used to acquire the background image and the smoke image; The processing unit is used to initialize the state transfer equation of the smoke image based on the original image parameters of the smoke image, and determine the state transfer parameters of the smoke image in the state transfer process, and one state transfer change corresponds to a set of state transfer parameters; Determining fusion parameters according to the state transition parameters and image parameters of the background image, and generating a smoke simulation video based on the fusion parameters; The state transfer equation is used to describe the iteration rule of multiple image parameters of the smoke image during the state transfer process.
10. An image processing device, It is characterized in that It includes a memory and a processor; the memory is used to store computer-executable instructions, and the processor is connected to the memory via a bus; When the image processing device is running, the processor executes the computer-executable instructions stored in the memory, so that the image processing device performs the image processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer is enabled to execute the image processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Multi-feature fused smoke identification method based on videos
CN103996045A
Low SNR(Signal to Noise Ratio) motion small target tracking and identification method
CN104835178A