Empty background image generation method and system
By shooting and processing multiple original images, the background image of the target background area is calculated and synthesized, which solves the problems of low efficiency and poor accuracy of outdoor matting in the existing technology, and realizes the generation of high-quality empty background images.
Patent Information
- Application Number
- CN202411222422.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2025-01-21
AI Technical Summary
In the production of TV programs and movie special effects, it is difficult to accurately pick out moving objects in outdoor environments, especially when the shape and position of the objects change rapidly, resulting in low cutout efficiency and poor accuracy.
By shooting multiple original images of the target background area, convert them into grayscale images, and subtract the pixels at the same position to find the pixel pairs with the smallest difference, calculate the mean of the original images of these pixel pairs, and synthesize The background image of the target background area.
It achieves the accurate generation of empty background images in outdoor environments, eliminates the interference of moving people and objects on the image, and improves the accuracy and efficiency of image matting.
Smart Images

Figure CN119342362A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of television broadcast program production, and in particular to a method and system for generating a blank background image. Background Art
[0002] In the production of TV programs and movie special effects, it is often necessary to use intelligent AI technology to determine the position of moving objects in each frame of an image or a video, cut out moving objects, and other operations. To complete these operations, there are two main mainstream technologies. One is to make the moving object appear in front of a fixed-color monochrome background wall for shooting. For example, the most commonly used background wall is a pure green background wall. The person or the object to be moved moves in front of the background wall, and then the taken photos are processed to remove the color of the background wall. The remaining image position is the position to be determined, and the remaining image is the shape of the object to be cut out. The disadvantage of this method is that it requires a monochrome background wall, so it can only be used in the laboratory. It cannot be used outdoors.
[0003] Another method is to use AI technology to find areas with specified features in the image, make judgments based on the features of the object (such as a face or a car shape), and finally find the location and shape of the object to be found, and then perform the cutout operation. The disadvantage of this method is that if the speed and shape of the object are constantly changing, it is difficult to determine its real-time shape, especially when the object being tracked is constantly changing its shape like a person. It is not only inefficient, but also difficult to accurately locate, and sometimes errors may occur, resulting in incomplete cutouts. Summary of the invention
[0004] In view of the above problems existing in the prior art, a method and system for generating an empty background image are provided.
[0005] The specific technical solutions are as follows:
[0006] A method for generating an empty background image, comprising:
[0007] Step S1: taking multiple original images of the target background area and processing them respectively to obtain multiple grayscale images;
[0008] Step S2: performing pairwise subtraction on pixel points at the same position of the grayscale image to obtain a first pixel and a second pixel with the smallest difference;
[0009] Step S3: synthesizing a background image corresponding to the target background area according to the original image averages of all the first pixels and the second pixels.
[0010] On the other hand, the step S1 comprises:
[0011] Step S11: setting a fixed camera position for the target background area, and taking a plurality of original images of the target background area at the fixed camera position;
[0012] Step S12: for each of the original images, read each pixel point in turn and convert them into grayscale values respectively to obtain the grayscale image.
[0013] On the other hand, the step S2 comprises:
[0014] Step S21: extracting grayscale pixels from each grayscale image according to pixel positions to obtain a sequence to be screened;
[0015] Step S22: for each pixel position in the sequence to be screened, sequentially extract a pair of the grayscale pixel points in the sequence to be screened and subtract them to obtain a grayscale difference;
[0016] Step S23: outputting the pair of grayscale pixel points with the smallest grayscale difference as the first pixel and the second pixel at the pixel position.
[0017] On the other hand, the step S3 comprises:
[0018] Step S31: calculating the original image mean of the first pixel and the second pixel;
[0019] Step S32: assigning values in the background image according to the pixel positions corresponding to the first pixel and the second pixel according to the mean value of the original image.
[0020] On the other hand, after executing step S23 and before executing step S3, the method further includes:
[0021] Step S24: determining whether the grayscale difference between the first pixel and the second pixel is greater than a color difference threshold;
[0022] If yes, add one to the color difference count value and go to step S25;
[0023] If not, go to step S25;
[0024] Step S25: Return to step S24 until the statistics of all the first pixels and the second pixels are completed, and determine whether the color difference count value exceeds the color difference discrimination condition;
[0025] If yes, go to step S3;
[0026] If not, the current images corresponding to the first pixel and the second pixel are discarded, and then the process returns to step S21.
[0027] A system for generating an empty background image, comprising:
[0028] An image acquisition module, wherein the image acquisition module captures a plurality of original images of the target background area and processes them respectively to obtain a plurality of grayscale images;
[0029] A pixel screening module, the pixel screening module is connected to the image acquisition module, and the pixel screening module performs pairwise subtraction on pixel points at the same position of the grayscale image to obtain a first pixel and a second pixel with the smallest difference;
[0030] An image synthesis module, wherein the image synthesis module is connected to the pixel screening module, and the image synthesis module synthesizes a background image corresponding to the target background area according to the original image mean of all the first pixels and the second pixels.
[0031] On the other hand, the image acquisition module comprises:
[0032] A shooting module, wherein the shooting module sets a fixed position for the target background area and shoots a plurality of original images of the target background area at the fixed position;
[0033] A grayscale conversion module is connected to the shooting module. For each original image, the grayscale conversion module sequentially reads each pixel and converts each pixel into a grayscale value to obtain the grayscale image.
[0034] On the other hand, the pixel screening module includes:
[0035] A pixel extraction module, wherein the pixel extraction module extracts grayscale pixel points from each grayscale image according to pixel positions to combine and obtain a sequence to be screened;
[0036] A difference generation module, the difference generation module is connected to the pixel extraction module, and the difference generation module sequentially extracts a pair of grayscale pixel points from the sequence to be screened at each pixel position, and subtracts them to obtain a grayscale difference;
[0037] A pixel output module, wherein the pixel output module is connected to the difference generation module, and the pixel output module outputs a pair of the grayscale pixel points with the smallest grayscale difference as the first pixel and the second pixel at the pixel position.
[0038] On the other hand, the image synthesis module includes:
[0039] A mean calculation module, wherein the mean calculation module calculates the original image mean of the first pixel and the second pixel;
[0040] An assignment module, the assignment module is connected to the mean calculation module, and the assignment module assigns values according to the original image mean in the background image according to the pixel positions corresponding to the first pixel and the second pixel.
[0041] On the other hand, the pixel screening module further includes:
[0042] A difference comparison module, wherein the difference comparison module determines whether the grayscale difference between the first pixel and the second pixel is greater than a color difference threshold, and increases the color difference count value by one when the grayscale difference is greater than the color difference threshold;
[0043] A color difference comparison module is connected to the difference comparison module, and the color difference comparison module removes the current image corresponding to the first pixel and the second pixel when the color difference count value exceeds the color difference judgment condition.
[0044] The above technical solution has the following advantages or beneficial effects:
[0045] In view of the problem that the background image synthesis method in the prior art mainly relies on green cloth, matting and other methods, and the effect is not good, in this embodiment, first a series of original images are taken for the target background area, and then for each pixel position involved in the image, the pixel pairs with lower changes are found and the mean is calculated to determine the actual background image at the corresponding position, thereby eliminating the interference of moving people and objects on the image during the shooting process and achieving a better synthesis effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The embodiments of the present invention will be described more fully with reference to the attached drawings, which are provided for illustration and description only and are not intended to limit the scope of the present invention.
[0047] Figure 1 It is an overall schematic diagram of an embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of step S1 of an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of step S2 in an embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram of step S3 in an embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of step S24 in an embodiment of the present invention;
[0052] Figure 6 A schematic diagram of a system in an embodiment of the present invention;
[0053] Figure 7This is a schematic diagram of an image acquisition module in an embodiment of the present invention;
[0054] Figure 8 Schematic diagram of a pixel screening module in an embodiment of the present invention;
[0055] Fig. 9 Schematic diagram of an image synthesis module in an embodiment of the present invention;
[0056] Fig.10 Schematic diagram of a difference comparison module in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0059] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.
[0060] The present invention comprises:
[0061] A method for generating an empty background image, such as Figure 1 As shown, including:
[0062] Step S1: taking multiple original images of the target background area and processing them respectively to obtain multiple grayscale images;
[0063] Step S2: Subtracting pixels at the same position of the grayscale image in pairs to obtain a first pixel and a second pixel with the smallest difference;
[0064] Step S3: synthesizing a background image corresponding to the target background area according to the original image average values of all the first pixels and the second pixels.
[0065] Specifically, in view of the problem that the background image synthesis method in the prior art mainly relies on green cloth, matting and the like, and the effect is not good, in this embodiment, a series of original images are first taken for the target background area and converted into grayscale values.
[0066] Based on the grayscale value, for each pixel position involved in the image, the pixel pairs with lower changes can be found according to the grayscale value. Based on these pixel pairs, the original image mean is calculated to determine the actual background image at the corresponding position, and then the full-frame background image is synthesized, eliminating the interference of moving people and objects on the image during the shooting process, and achieving a better synthesis effect.
[0067] In one embodiment, Figure 2 As shown, step S1 includes:
[0068] Step S11: setting a fixed camera position for the target background area, and taking a plurality of original images of the target background area at the fixed camera position;
[0069] Step S12: For each original image, read each pixel point in turn and convert them into grayscale values to obtain a grayscale image.
[0070] Specifically, in order to achieve a better effect of pixel point screening, in this embodiment, a fixed camera position is set up for the target background area where the background image needs to be photographed, and then multiple continuous original images are taken of the target background area. In order to achieve a better measurement effect of the pixel points later, each pixel point is read in turn and converted into a grayscale value to obtain a grayscale image.
[0071] For example, in ski jumping, a fixed camera is usually set up facing the side of the ski jumping platform to shoot the athletes' movements of sliding down and jumping from the platform and their trajectory in the air.
[0072] During the early stage of shooting, there may be moving staff, equipment or athletes on the diving platform. At this time, you should maintain a fixed camera position and shooting angle, and then take multiple original images of the target background area.
[0073] Depending on the actual scene, you can choose to obtain multiple continuous original images through video shooting or continuous shooting over a period of time; for scenes with relatively cluttered backgrounds, you can also use interval shooting to process them so that the interfering objects can leave the shooting area.
[0074] Then, all images are converted into grayscale images. The conversion method is usually RGB mapping. For example, the mapping method used in one embodiment includes:
[0075] Gray=R*0.299+G*0.587+B*0.114;
[0076] Among them, Gray is the converted grayscale value, R, G, and B correspond to the red channel value, green channel value, and blue channel value of the same pixel respectively. The channel value range is in the range of 0-255, and the grayscale value range is also in the range of 0-255.
[0077] Traverse all pixels to convert into grayscale image.
[0078] Furthermore, for ease of processing, during the shooting process, each original image is first numbered according to the shooting sequence. Assuming that there are n frames of images, the sequence numbers are: 0, 1, 2, ... n-1. The value of n is at least 3.
[0079] In the process of converting the grayscale image, the new grayscale image generated is still n frames, and its sequence number is also 0, 1, 2, ...n-1.
[0080] In one embodiment, Figure 3 As shown, step S2 includes:
[0081] Step S21: extracting grayscale pixels from each grayscale image according to pixel positions to combine them to obtain a sequence to be screened;
[0082] Step S22: for each pixel position in the sequence to be screened, sequentially extract a pair of grayscale pixel points from the sequence to be screened and subtract them to obtain a grayscale difference;
[0083] Step S23: output a pair of grayscale pixel points with the smallest grayscale difference as the first pixel and the second pixel at the pixel position.
[0084] Specifically, in order to achieve a better comparison effect, in this embodiment, grayscale pixels are first extracted from each grayscale image according to the pixel position to combine them to obtain a sequence to be screened. Each sequence to be screened corresponds to a pixel position, and each sequence to be screened is represented by a directed sequence, corresponding to the frame number setting of the grayscale image.
[0085] Then, for each pixel position in the sequence to be screened, a pair of adjacent grayscale pixel points in the sequence to be screened are sequentially subtracted to obtain a grayscale difference.
[0086] When a pair of adjacent grayscale pixels correspond to background objects, their grayscale difference should be small.
[0087] After calculating each pair of grayscale pixel points respectively, a pair of grayscale pixel points with the smallest grayscale difference is output as the first pixel and the second pixel at the pixel position, thereby obtaining a combination of pixel pairs with the smallest change.
[0088] In one embodiment, Figure 4 As shown, step S3 includes:
[0089] Step S31: calculating the original image mean of the first pixel and the second pixel;
[0090] Step S32: assigning values in the background image according to the original image mean value according to the pixel positions corresponding to the first pixel and the second pixel.
[0091] Specifically, after determining the first pixel and the second pixel with the smallest difference, the original image on the corresponding frame number is reversely searched according to the pixel positions corresponding to the first pixel and the second pixel, so as to obtain the first original pixel and the second original pixel corresponding to the original image. The RGB channels of the first original pixel and the second original pixel are averaged to obtain the original image average.
[0092] Then, according to the pixel positions corresponding to the first pixel and the second pixel, the background image is assigned values according to the original image mean value to form a synthetic background image.
[0093] The process of mean calculation includes:
[0094] The pixel position corresponding to the background image R = (first original pixel R + second original pixel R) / 2
[0095] The pixel position corresponding to the background image G = (first original pixel G + second original pixel G) / 2
[0096] The pixel position B corresponding to the background image=(first original pixel B+second original pixel G) / 2.
[0097] Then perform RGB synthesis to obtain the assigned result.
[0098] In one embodiment, Figure 5 As shown, after executing step S23 and before executing step S3, the following steps are also included:
[0099] Step S24: determining whether the grayscale difference between the first pixel and the second pixel is greater than a color difference threshold;
[0100] If yes, add one to the color difference count value and go to step S25;
[0101] If not, go to step S25;
[0102] Step S25: Return to step S24 until the statistics of all first pixels and second pixels are completed, and determine whether the color difference count value exceeds the color difference discrimination condition;
[0103] If yes, go to step S3;
[0104] If not, the image corresponding to the current first pixel and the second pixel is discarded, and then the process returns to step S21.
[0105] Specifically, in order to achieve a better background generation effect, in this embodiment, a color difference distortion counter iDifferentCount is set before starting the processing, and the value is assigned to 0. According to the inventor's experience in image synthesis, for two grayscale color points, when the color difference is less than 10, the image distortion is not obvious, and when it is greater, it can be clearly seen, so the color difference threshold is set to 10. After obtaining the grayscale difference, the grayscale difference is compared with the color difference threshold, and if the difference is large, the color difference count value is increased by one.
[0106] After the statistics of all the first pixels and the second pixels are completed, the color difference count value is divided by the total number of pixels of the background image to determine whether the proportion of pixels with larger color differences in the total image is greater than a preset limit, such as 10%. If it is greater, the images corresponding to the current first pixels and the second pixels are discarded and re-screened.
[0107] A system for generating an empty background image, such as Figure 6 As shown, including:
[0108] Image acquisition module 1, the image acquisition module 1 takes multiple original images of the target background area and processes them respectively to obtain multiple grayscale images;
[0109] A pixel screening module 2, the pixel screening module 2 is connected to the image acquisition module 1, and the pixel screening module 2 performs pairwise subtraction on pixel points at the same position of the grayscale image to obtain a first pixel and a second pixel with the smallest difference;
[0110] The image synthesis module 3 is connected to the pixel screening module 2, and the image synthesis module 3 synthesizes a background image corresponding to the target background area according to the original image mean value of all the first pixels and the second pixels.
[0111] Specifically, in view of the problem that the background image synthesis method in the prior art mainly relies on green cloth, matting and other methods, and the effect is not good, in this embodiment, the image acquisition module 1 first shoots a series of original images for the target background area and converts them into grayscale values. Based on the grayscale value, the pixel screening module 2 can find pixel pairs with lower changes according to the grayscale value for each pixel position involved in the image. The image synthesis module 3 calculates the mean of the original image based on these pixel pairs to determine the actual background image at the corresponding position, and then synthesizes the full-frame background image, eliminating the interference of moving people and objects on the image during the shooting process, and achieving a better synthesis effect.
[0112] In one embodiment, Figure 7 As shown, the image acquisition module 1 includes:
[0113] The shooting module 11 sets a fixed camera position for the target background area and shoots a plurality of original images of the target background area at the fixed camera position;
[0114] The grayscale conversion module 12 is connected to the shooting module 11. The grayscale conversion module 12 reads each pixel of each original image in sequence and converts them into grayscale values respectively to obtain a grayscale image.
[0115] Specifically, in order to achieve a better effect of pixel point screening, in this embodiment, the shooting module 11 sets up a fixed camera position for the target background area where the background image needs to be photographed, and then shoots multiple continuous original images of the target background area. In order to achieve a better measurement effect of the pixel points later, the grayscale conversion module 12 also reads each pixel point in turn and converts them into grayscale values respectively to obtain a grayscale image.
[0116] In one embodiment, Figure 8 As shown, the pixel screening module 2 includes:
[0117] The pixel extraction module 21 extracts grayscale pixels from each grayscale image according to pixel positions to obtain a sequence to be screened;
[0118] A difference generation module 22, the difference generation module 22 is connected to the pixel extraction module 21, and the difference generation module 22 sequentially extracts a pair of grayscale pixel points from the sequence to be screened at each pixel position, and subtracts them to obtain a grayscale difference;
[0119] The pixel output module 23 is connected to the difference generation module 22. The pixel output module 23 outputs a pair of grayscale pixel points with the smallest grayscale difference as the first pixel and the second pixel at the pixel position.
[0120] Specifically, in order to achieve a better comparison effect, the pixel extraction module 21 in this embodiment first extracts grayscale pixel points from each grayscale image according to the pixel position to combine them to obtain a sequence to be screened. Each sequence to be screened corresponds to a pixel position, and each sequence to be screened is represented by a directed sequence, corresponding to the frame number setting of the grayscale image.
[0121] Then, the difference generation module 22 sequentially subtracts a pair of adjacent grayscale pixels from the sequence to be screened at each pixel position to obtain a grayscale difference. When a pair of adjacent grayscale pixels corresponds to a background object, the grayscale difference should be small.
[0122] After calculating each pair of grayscale pixel points respectively, the pixel output module 23 outputs a pair of grayscale pixel points with the smallest grayscale difference as the first pixel and the second pixel at the pixel position, thereby obtaining a combination of pixel pairs with the smallest change.
[0123] In one embodiment, Fig. 9 As shown, the image synthesis module 3 includes:
[0124] A mean calculation module 31, the mean calculation module 31 calculates the mean of the original image for the first pixel and the second pixel;
[0125] The value assignment module 32 is connected to the mean value calculation module 31 , and the value assignment module 32 assigns values according to the original image mean value in the background image according to the pixel positions corresponding to the first pixel and the second pixel.
[0126] Specifically, after determining the first pixel and the second pixel with the smallest difference, the mean calculation module 31 reversely searches the original image on the corresponding frame number according to the pixel positions corresponding to the first pixel and the second pixel, thereby obtaining the first original pixel and the second original pixel corresponding to the original image. The RGB channels of the first original pixel and the second original pixel are averaged to obtain the original image mean.
[0127] Then, the assignment module 32 assigns values in the background image according to the original image mean value according to the pixel positions corresponding to the first pixel and the second pixel to form a synthetic background image.
[0128] In one embodiment, Fig.10 As shown, the pixel screening module 2 also includes:
[0129] A difference comparison module 24, the difference comparison module 24 determines whether the grayscale difference between the first pixel and the second pixel is greater than a color difference threshold, and increases the color difference count value by one when the grayscale difference is greater than the color difference threshold;
[0130] The color difference comparison module 25 is connected to the difference comparison module 24. When the color difference count value is greater than the color difference threshold, the color difference comparison module 25 removes the image corresponding to the current first pixel and the second pixel.
[0131] Specifically, in order to achieve a better background generation effect, in this embodiment, a color difference distortion counter iDifferentCount is set before starting the processing, and is assigned a value of 0. According to the inventor's experience in image synthesis, for two grayscale color points, when the color difference is less than 10, the image distortion is not obvious, and when it is greater, it can be clearly seen, so the color difference threshold is set to 10. After obtaining the grayscale difference, the difference comparison module 24 compares the grayscale difference with the color difference threshold, and if the difference is large, the color difference count value is increased by one.
[0132] After the statistics of all the first pixels and the second pixels are completed, the color difference comparison module 25 divides the color difference count value by the total number of pixels of the background image to determine whether the proportion of pixels with larger color differences in the total image is greater than a preset limit, such as 10%. If it is greater, the images corresponding to the current first pixels and the second pixels are discarded and re-screened.
[0133] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0134] Those skilled in the art will appreciate that various aspects of the present invention, or possible implementations of various aspects, can be specifically implemented as systems, methods or computer program products. Therefore, various aspects of the present invention, or possible implementations of various aspects, can adopt the form of complete hardware embodiments, complete software embodiments (including firmware, resident software, etc.), or combined software and hardware embodiments, all collectively referred to as "circuit", "module" or "system" here. In addition, various aspects of the present invention, or possible implementations of various aspects, can adopt the form of computer program products, which refer to computer-readable program codes stored in computer-readable media.
[0135] The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium includes but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or apparatuses, or any suitable combination of the foregoing, such as random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable read-only memory (CD-ROM).
[0136] The processor in the computer reads the computer-readable program code stored in the computer-readable medium, so that the processor can execute the functional actions specified in each step or the combination of steps in the flowchart; and generate a device for implementing the functional actions specified in each block or the combination of blocks in the block diagram.
[0137] It should be understood that the processor in the computer can be understood as one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components implemented to execute the aforementioned computer-readable program codes.
[0138] Computer readable program code can be executed completely on the local computer of the user, partially on the local computer of the user, as a separate software package, partially on the local computer of the user and partially on the remote computer, or executed completely on the remote computer or server.It should also be noted that in some alternative embodiments, the functions noted in each step in the flow chart or each block in the block diagram may not occur in the order noted in the figure.For example, depending on the function involved, two steps shown in succession or two blocks may actually be executed roughly simultaneously, or these blocks may sometimes be executed in reverse order.
[0139] The above are only preferred embodiments of the present invention, and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating an empty background image, characterized in that: include: Step S1: taking multiple original images of the target background area and processing them respectively to obtain multiple grayscale images; Step S2: performing pairwise subtraction on pixel points at the same position of the grayscale image to obtain a first pixel and a second pixel with the smallest difference; Step S3: synthesizing a background image corresponding to the target background area according to the original image averages of all the first pixels and the second pixels.
2. The generation method according to claim 1, characterized in that: The step S1 comprises: Step S11: setting a fixed camera position for the target background area, and taking a plurality of original images of the target background area at the fixed camera position; Step S12: for each of the original images, read each pixel point in turn and convert them into grayscale values respectively to obtain the grayscale image.
3. The generation method according to claim 1, characterized in that: The step S2 comprises: Step S21: extracting grayscale pixels from each grayscale image according to pixel positions to obtain a sequence to be screened; Step S22: for each pixel position in the sequence to be screened, sequentially extract a pair of the grayscale pixel points in the sequence to be screened and subtract them to obtain a grayscale difference; Step S23: outputting the pair of grayscale pixel points with the smallest grayscale difference as the first pixel and the second pixel at the pixel position.
4. The generation method according to claim 3, characterized in that: The step S3 comprises: Step S31: calculating the original image mean of the first pixel and the second pixel; Step S32: assigning values in the background image according to the pixel positions corresponding to the first pixel and the second pixel according to the mean value of the original image.
5. The generation method according to claim 3, characterized in that: After executing step S23 and before executing step S3, the method further includes: Step S24: determining whether the grayscale difference between the first pixel and the second pixel is greater than a color difference threshold; If yes, add one to the color difference count value and go to step S25; If not, go to step S25; Step S25: Return to step S24 until the statistics of all the first pixels and the second pixels are completed, and determine whether the color difference count value exceeds the color difference discrimination condition; If yes, go to step S3; If not, the current images corresponding to the first pixel and the second pixel are discarded, and then the process returns to step S21.
6. A system for generating an empty background image, characterized in that: include: An image acquisition module, wherein the image acquisition module captures a plurality of original images of the target background area and processes them respectively to obtain a plurality of grayscale images; A pixel screening module, the pixel screening module is connected to the image acquisition module, and the pixel screening module performs pairwise subtraction on pixel points at the same position of the grayscale image to obtain a first pixel and a second pixel with the smallest difference; An image synthesis module, wherein the image synthesis module is connected to the pixel screening module, and the image synthesis module synthesizes a background image corresponding to the target background area according to the original image mean of all the first pixels and the second pixels.
7. The generation system according to claim 6, characterized in that: The image acquisition module comprises: A shooting module, wherein the shooting module sets a fixed position for the target background area and shoots a plurality of original images of the target background area at the fixed position; A grayscale conversion module is connected to the shooting module. For each original image, the grayscale conversion module sequentially reads each pixel and converts each pixel into a grayscale value to obtain the grayscale image.
8. The generation system according to claim 6, characterized in that The pixel screening module comprises: A pixel extraction module, wherein the pixel extraction module extracts grayscale pixel points from each grayscale image according to pixel positions to combine and obtain a sequence to be screened; A difference generation module, the difference generation module is connected to the pixel extraction module, and the difference generation module sequentially extracts a pair of grayscale pixel points from the sequence to be screened at each pixel position, and subtracts them to obtain a grayscale difference; A pixel output module, wherein the pixel output module is connected to the difference generation module, and the pixel output module outputs a pair of the grayscale pixel points with the smallest grayscale difference as the first pixel and the second pixel at the pixel position.
9. The generation system according to claim 8, characterized in that The image synthesis module comprises: A mean calculation module, wherein the mean calculation module calculates the original image mean of the first pixel and the second pixel; An assignment module, the assignment module is connected to the mean calculation module, and the assignment module assigns values according to the original image mean in the background image according to the pixel positions corresponding to the first pixel and the second pixel.
10. The generation system according to claim 8, characterized in that The pixel screening module also includes: a difference comparison module, the difference comparison module determines whether the grayscale difference between the first pixel and the second pixel is greater than a color difference threshold, and increases the color difference count value by one when the grayscale difference is greater than the color difference threshold; A color difference comparison module is connected to the difference comparison module, and the color difference comparison module removes the current image corresponding to the first pixel and the second pixel when the color difference count value exceeds the color difference judgment condition.