Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of image that is used for to abandon the method that cover in the zone, this method can not hide the technical problem of abandoning image except solving prior art attractive in appearancely, but also the picture material that the image of reconstruct abandoned preferably covers.
Another purpose of the present invention is to provide a kind of image that is used for to abandon the device that cover in the zone.
Another object of the present invention is to provide a kind of method for processing video frequency, the abandonment image masking problem in the video is handled on this method automation in real time ground, the picture material that reconstruct abandoned image covers, low-cost, obtain the new video that presents former video " true looks " expeditiously.
Also purpose of the present invention is to provide a kind of processing system for video.
For achieving the above object, technical scheme of the present invention is achieved in that a kind of image that is used for abandons the method that cover in the zone, comprise: determine to abandon in first image position of image, obtain to abandon the zone, store described Pixel Information of abandoning the edge pixel point in zone; Obtain the Pixel Information that constitutes the second image slices vegetarian refreshments according to the Pixel Information that the described edge pixel that abandons the zone is selected; According to the Pixel Information of the described second image slices vegetarian refreshments pixel of described second image is placed described abandonment zone, obtain the 3rd image.
Further, a kind of image abandons the masking device in zone, and comprising: first image abandons regional determining unit, is used for determining that first image abandons the position of image, obtains to abandon the zone, stores described Pixel Information of abandoning the edge pixel point in zone; The second image slices vegetarian refreshments acquiring unit is used for obtaining the Pixel Information that constitutes the second image slices vegetarian refreshments according to the Pixel Information that the described edge pixel that abandons the zone is selected; The 3rd image acquisition unit is used for according to the Pixel Information of the described second image slices vegetarian refreshments pixel of described second image being placed described abandonment zone, obtains the 3rd image.
Further, a kind of processing system for video comprises: video collector is used to gather video image; Frame buffer memory is used to receive and first video image corresponding to current frame video image that temporary video collector transmits; Logic controller is used for the transmission of first video image that the control frame buffer storage stores; Image abandons the zone and covers processor, and it comprises: be used for determining the position of first video image abandonment image, obtain to abandon the zone, store described first image that abandons the Pixel Information of regional edge pixel point and abandon regional determining unit; Be used for obtaining the second image slices vegetarian refreshments acquiring unit of the Pixel Information that constitutes the second video image pixel according to the Pixel Information that the described edge pixel that abandons the zone is selected; Be used for the pixel of described second video image being placed described abandonment zone, obtain the 3rd image acquisition unit of the 3rd video image according to the Pixel Information of the described second video image pixel; The output frame buffer storage is used to receive and the register map picture abandons the 3rd video image that the processor transmission is covered in the zone; Video encoder, the 3rd video image that is used under the control of logic controller the output frame buffer storage being transmitted is encoded the line output of going forward side by side.
Further, a kind of method for processing video frequency comprises: step 1, and video collector is gathered video image; Step 2, frame buffer memory receive and keep in first video image corresponding to current frame video image that video collector transmits;Step 3, image abandonment zone is covered processor and read in first video image from frame buffer memory under the control of logic controller, be used for determining that the first video video image abandons the position of image, obtain to abandon the zone, store described Pixel Information of abandoning the edge pixel point in zone; Obtain the Pixel Information that constitutes the second video image pixel according to described Pixel Information of abandoning the edge pixel point in zone; According to the Pixel Information of the described second video image pixel pixel of described second video image is placed described abandonment zone, obtain the 3rd video image; Step 4, output frame buffer storage receive and the register map picture abandons the 3rd video image that the processor transmission is covered in the zone; After the output frame buffer storage is received a two field picture, be circulated to step 1 and begin to gather a new frame video image, the 3rd video image that the while logic controller is stored the output frame buffer storage sends to Video Decoder; Step 5, video encoder is encoded the line output of going forward side by side to the 3rd video image that the output frame buffer storage transmits.
The present invention has following beneficial effect with respect to prior art:
The first, be used for that image is abandoned the method for covering in the zone and comprised on the one hand and can cover the covering step that needs to abandon image on the original image (first image), hide part edges of regions can with abandon image and realize match well.On the other hand, this method again can the original image of reconstruct on the picture material (second image) blocked of abandoned image, and then obtain to present the new images (the 3rd image) of original image " true looks ".Adopt this method, solved prior art and stayed the inaesthetic technical problem of visual effect that " patch " on the image frame causes by beating mosaic, shade and local fuzzy mode, thereby, the visual effect of entire image also promoted well.
Second, use method for processing video frequency of the present invention and system and handle video: current frame video image (first video image) is passed through video collector successively, frame buffer memory, under the control of logic controller, be sent to image abandonment zone and cover processor, realize abandoning on the video image covering in zone, and the video image content (second video image) blocked of reconstruct abandoned image, and then " reduction " presents the new video image (the 3rd video image) of corresponding original video image " true looks ", then, new video image is through the output frame buffer storage, the transmission of video encoder is shown by display again.Advantage is: can handle to automation in real time successively multi-frame video, the shortcoming of editing and processing is manually carried out in the employing that has overcome prior art, has not only saved the cost of video production, the more important thing is the efficient that has improved Video processing.
Embodiment
For the ease of further understanding, the specific embodiment of the present invention is done detailed description further below in conjunction with accompanying drawing to invention.
The image that is used for of the present invention shown in Figure 1 abandons the method for covering in the zone and comprises: step S1, determine to abandon in first image position of image to obtain to abandon the zone, and store described Pixel Information of abandoning regional edge pixel point; Step S2 obtains the Pixel Information that constitutes the second image slices vegetarian refreshments according to the Pixel Information that the described edge pixel that abandons the zone is selected; Step S3 places described abandonment zone according to the Pixel Information of the described second image slices vegetarian refreshments with the pixel of described second image, obtains the 3rd image.
As shown in Figure 2, step S1 adopts following implementation method to carry out: step S11, determine to abandon in first image position of image; Step S12 obtains to abandon the zone; Step S13 stores described Pixel Information of abandoning the edge pixel point in zone.
As shown in Figure 3, step S12 adopts following implementation method to carry out: step S121, produce the mask image template; Step S122 covers plate to abandoning image; Step S123 removes and abandons image; Step S124 obtains to abandon the zone.
As shown in Figure 4, step S2 adopts following implementation method to carry out: step S21, and adopt the relaxative iteration method to calculate according to described Pixel Information of abandoning the edge pixel point in zone, obtain to constitute the Pixel Information of the second image slices vegetarian refreshments; Step S22, the Pixel Information of storing the described second image slices vegetarian refreshments.
As shown in Figure 5, step S3 adopts following implementation method to carry out: step S31, according to the Pixel Information of the described second image slices vegetarian refreshments pixel of described second image is placed described abandonment zone, and obtain the 3rd image; Step S32 stores the 3rd image.
Fig. 6 has illustrated the another kind of embodiment of method shown in Figure 1, and its flow process comprises: step S1, determine to abandon in first image position of image to obtain to abandon the zone, and store described Pixel Information of abandoning regional edge pixel point; Step S2 ' obtains the Pixel Information of whole pixels of formation second image according to described Pixel Information of abandoning the edge pixel point in zone; Step S3 ', the whole pixels that constitute described second image are integral-filled to described abandonment zone, obtain the 3rd image.
Fig. 7 has illustrated the another kind of embodiment of method shown in Figure 1, and its flow process comprises: step S1, determine to abandon in first image position of image to obtain to abandon the zone, and store described Pixel Information of abandoning regional edge pixel point; Step S2 ", according to described Pixel Information of abandoning the edge pixel point in zone, in described abandonment zone, obtain to generate the Pixel Information of the second image slices vegetarian refreshments; Step S3 ", and in described abandonment zone, obtain the described second image slices vegetarian refreshments according to the Pixel Information of the described second image slices vegetarian refreshments, be arranged in the described abandonment zone, obtain the 3rd image.
With reference to Fig. 8, the relaxative iteration method is improved the Gauss-Seidel iterative method and a kind of accelerated iterative method of obtaining, its principle is: get fixed initial vector from some, calculate the estimated value vector gradually by iterative formula, along with the increase of iterations, can be so that sequence vector converges on the exact solution of equation group.Be applied in the present invention, certain pixel of first image is configured to initial coordinate values (0,0), the x axle is positive direction from left to right, the y axle is positive direction from top to bottom, the coordinate figure of estimated value pixel be (x, y), the pixel of the capable j column position of corresponding i, the capable j column position of described i is in the described abandonment zone.
Based on the Pixel Information of the edge pixel point that abandons the zone, set up potential function and find the solution, be specially:
Pixel Information according to the edge pixel point that abandons the zone is asked gradient respectively, and gradient is defined as follows:
In the formula,
Be the gradient operator symbol, u is a scalar.
Ask divergence again, divergence is defined as follows:
In the formula,Be the divergence operator symbol, u and v be two dimensions of representation vector respectively.
Use Laplacian, Laplacian is defined as follows:
In the formula,
Be the Laplacian symbol, in image, its discrete form is:
In the formula, uI, jRepresent the channel value of the capable j column position of i, the capable j column position of described i is in the described abandonment zone,
Described channel value comprises in different video image format: R, G, B are respectively the redness of a pixel correspondence at rgb space, green and blue valve; Y, U, V are respectively the Y of a pixel correspondence at yuv space, the value of U and V; H, S, L are respectively the H of a pixel correspondence in the HSL space, the value of S and L.
Following formula is used the Gauss-Seidel iteration:
Wherein, k represents iterations, whenever carries out iteration one time, and corresponding k value adds 1, and by iterative, whether judged result restrains, if convergence, and finishing iteration process then, otherwise iteration continues, up to obtaining to restrain the result.Convergence condition is: between twice adjacent iteration, the variation that the channel value of each pixel takes place is no more than certain threshold value of setting..During actual the use, this threshold value can dynamically be set, and during current use, is set at the peaked 1-10% of passage.Such as, the brightness maximum is 100, this value is set at certain value between the 1-10 so, such as 5.
Fig. 9 has illustrated image of the present invention to abandon the masking device in zone, comprise: first image abandons regional determining unit, is used for determining that first image abandons the position of image, obtains to abandon the zone, store described Pixel Information of abandoning the edge pixel point in zone, this unit is corresponding to step S1; The second image slices vegetarian refreshments acquiring unit is used for obtaining the Pixel Information that constitutes the second image slices vegetarian refreshments according to the Pixel Information that the described edge pixel that abandons the zone is selected, and this unit is corresponding to step S2; The 3rd image acquisition unit is used for according to the Pixel Information of the described second image slices vegetarian refreshments pixel of described second image being placed described abandonment zone, obtains the 3rd image, and this unit is corresponding to step S3.
Described first image abandons regional determining unit and comprises: abandon the picture position determination module, be used for determining that first image abandons the position of image, this unit is corresponding to step S11; Abandon the zone and obtain module, be used for obtaining to abandon the zone, this unit is corresponding to step S12; Abandon the area pixel information storage module, be used to store described edge pixel information of abandoning the zone, this unit is corresponding to step S13.
The described second image slices vegetarian refreshments acquiring unit comprises: the Pixel Information processing module, be used for adopting the relaxative iteration method to calculate according to described Pixel Information of abandoning the edge pixel point in zone, obtain to constitute the Pixel Information of the second image slices vegetarian refreshments, this unit is corresponding to step S21; The second image slices vegetarian refreshments memory module, the Pixel Information that is used to store the described second image slices vegetarian refreshments.
Described the 3rd image acquisition unit comprises: the second image slices vegetarian refreshments placement module, be used for the pixel of described second image being placed described abandonment zone according to the Pixel Information of the described second image slices vegetarian refreshments, obtain the 3rd image, this unit is corresponding to step S31; The 3rd image memory module is used to store described the 3rd image, and this unit is corresponding to step S32.
Below, the image concrete with a width of cloth is example, illustrates that the image that is used for of the present invention abandons the method and apparatus that cover in the zone.
Figure 10 has illustrated piece image Pic.I, picture has mainly comprised following element information: main body is that an announcer is broadcasting and reads news (among the figure humanoid shown in), in the background of announcer back, has a setting lamp (shown in the square frame among the figure, dashed region is the part that the setting lamp is covered).The mulle in the upper left corner has been represented the sign of this television channel, for example the sign of certain TV station.We will adopt the present invention to come the mulle among the image Pic.I is hidden now, mask this and abandon image, make spectators can see complete setting lamp, promptly demonstrate the part that the setting lamp is covered, and finally obtain image Pic.II.
Describe for correspondence, we are called first image with image Pic.I, and mulle is called the abandonment image, and the image that reconstruct setting lamp is covered part is called second image, and image Pic.II is called the 3rd image.At first, the position abandoned picture position determination module of mulle in Pic.I determined.The fundamental of image is a pixel, has determined that the position coordinates of pixel just can be determined the position of image.Because channel identication generally is in certain location on picture, so the position of mulle in image Pic.I is easy to determine.
After the position of mulle was determined, the shared zone (drawing among the figure) of mulle obtained by abandoning zone acquisition module.Convenient for the processing of later step, we can scratch mulle and go, and have so just defined and have abandoned regional drawing.Certainly, we also can scratch mulle and carry out follow-up processing, as long as because determined the edge of mulle, the edge is regional with our the described abandonment just of interior part so.Directly scratch the way of removing mulle if adopt, can pluck out mulle quickly and easily, obtain drawing by the mode of covering plate.
Further, with reference to Figure 11, we can produce the mask image template about mulle in advance.The size of template can be made differently as required, and these mask image templates are carried out mark respectively, searches so that distinguish, and then the mask image template behind the mark is stored, and can set up a mask image template database at last.
The edition with parallel text example, in mask image template database according to label lookup to the corresponding templates that meets the mulle characteristic information, extract qualified mask image template.The convergent-divergent that image Pic.I or template is contrasted size is handled, and can pluck out mulle exactly and get final product when covering plate.
Abandon the Pixel Information of the edge pixel point of regional drawing and store by abandoning the area pixel information storage module, Pixel Information comprises: position, brightness, colourity and channel value.
The top left corner pixel point that the Pixel Information processing module of second image acquisition unit is set up with image Pic.I is the coordinate system of initial point, define the initial coordinate values (0 of this pixel, 0), the x axle is positive direction from left to right, the y axle is positive direction from top to bottom, the coordinate figure of estimated value pixel be (x, y), the pixel of the capable j column position of corresponding i.Each pixel value is asked gradient respectively, ask divergence again, use Laplacian and set up potential function.Utilize over-relaxation iteration algorithm to carry out iteration then, when the result restrains, obtain the Pixel Information of the estimated value pixel that places second image in the drawing, thereby also just determined the pixel of second image, the second image slices vegetarian refreshments memory module is stored it.
Corresponding to embodiment shown in Figure 6, obtained the pixel of second image, it is integral-filled to drawing that the second image slices vegetarian refreshments placement module will constitute whole pixels of described second image, finally obtains the 3rd image Pic.II.The mulle edge of Pattern (for convenience of description, illustrate with solid line) with the edge fitting of drawing, zone between two straight lines in pattern is the part that the setting lamp that reconstructs is covered, and the 3rd image memory module is stored Pic.II again.
Corresponding to embodiment shown in Figure 7, the pixel that the second image slices vegetarian refreshments placement module directly will constitute second image generates in drawing, is arranged among the described drawing, finally obtains the 3rd image Pic.II.The star shape edge of Pattern (for convenience of description, illustrate with solid line) with the edge fitting of drawing, zone between two number lines in pattern is the part that the setting lamp that reconstructs is covered, and the 3rd image memory module is stored Pic.II again.
Further, when first video image excessive, even exceed the performance range of equipment, from first image, take out and include the image block of complete abandonment image as first image block, described first image section is a part of first image, as stated above the abandonment image in described first image block is covered processing, forms second image block, second image block is backfilling into the position of first image block in first image, merges and constitute the 3rd image.
Further, it is excessive to abandon image in first video image, excessive even taking-up is also loaded.The first image block geometric ratio of taking out is dwindled, handle after dwindling, second image block that formation is dwindled, according to the method described above, the abandonment image in second image block that dwindles is covered processing, form second image block that dwindles, second image block that will dwindle is amplified to the size identical with first image block, become second image block, described second image block is backfilling in first image, constitute the 3rd image.
Through test, when size of images was 150 * 100 pixels, the processing time was 10ms, generally gets 200 * 100 pixels, and image is narrowed down in this scope, handled to help improving image processing speed.
Figure 12 has illustrated a kind of processing system for video, and this system comprises: video collector is used to gather video image.The video signal that video collector collects can make analog video signal, also can be digital video signal.
Frame buffer memory (FIFO) is used to receive and first video image corresponding to current frame video image that temporary video collector transmits, for example adopts the AL4V8M440 chip of AVERLOGIC company.If the video collector collection is analog video signal, this frame buffer memory also need connect a Video Decoder (not shown), is used for analog video signal is converted to manageable digital video signal.
Logic controller (CPLD) is used for the control of the transmission of first video image that the achieve frame buffer storage stores.
Image abandons the zone and covers processor, under the control of logic controller, read in first video image from frame buffer memory, carry out following processing: determine to abandon in first video image position of image, obtain to abandon the zone, store described Pixel Information of abandoning the edge pixel point in zone; Obtain the Pixel Information that constitutes the second video image pixel according to described Pixel Information of abandoning the edge pixel point in zone; According to the Pixel Information of the described second video image pixel pixel of described second video image is placed described abandonment zone, obtain the 3rd video image.
The output frame buffer storage is used to receive and the register map picture abandons the 3rd video image that the processor transmission is covered in the zone, for example adopts the AL4V8M440 chip of AVERLOGIC company.
Video encoder, the 3rd video image that is used under the control of logic controller the output frame buffer storage being transmitted is encoded the line output of going forward side by side.Described coding is meant and video image is converted to a kind of mode of video format by specific compress technique.In the video flowing transmission at present of paramount importance coding standard have International Telecommunication Association H.261, H.263, the M-JPEG of motion rest image expert group and the MPEG series standard of Motion Picture Experts Group of International Standards Organization, the RealVideo, the WMV of Microsoft that also have Real-Networks that is widely used on the internet in addition and the QuickTime of Apple company etc.
Memory device is used to store the 3rd encoded video image.In actual applications, generally be stored as corresponding video file.
Figure 13 is the flow chart of method for processing video frequency of the present invention, and this method comprises:
Step 1, video collector is gathered video image;
Step 2, frame buffer memory receive and keep in first video image corresponding to current frame video image that video collector transmits;
Step 3, image abandonment zone is covered processor and read in first video image from frame buffer memory under the control of logic controller, be used for determining that the first video video image abandons the position of image, obtain to abandon the zone, store described Pixel Information of abandoning the edge pixel point in zone; Be used for obtaining the Pixel Information that constitutes the second video image pixel according to described Pixel Information of abandoning the edge pixel point in zone; Be used for the pixel of described second video image being placed described abandonment zone, obtain the 3rd video image according to the Pixel Information of the described second video image pixel;
Step 4, output frame buffer storage receive and the register map picture abandons the 3rd video image that the processor transmission is covered in the zone; After the output frame buffer storage is received a two field picture, be circulated to step 1 and begin to gather a new frame video image, the 3rd video image that the while logic controller is stored the output frame buffer storage sends to Video Decoder;
Step 5, video encoder is encoded the line output of going forward side by side to the 3rd video image that the output frame buffer storage transmits.
Below, with a specific embodiment method for processing video frequency of the present invention and system are described.
Show as Figure 14, comprise that video image Video1, video image Video2, video image Video3, video image Video4 and video image Video5 amount to five frame video images composition video flowing and enter processing system for video of the present invention successively.Particularly, at a time, start video collector, video collector begins to gather video image Video1, and video standard can adopt forms such as NTSC, PAL, and video image Video1 both can be an analog signal, also can be digital signal.
When video image Video1 was analog signal, it was manageable digital signal that video image Video1 is carried out mould/number conversion.
Video image Video1 enters frame buffer memory through transmitting, be filled with the two field picture of video image Video1 when frame buffer memory after, open the output enable end of frame buffer memory by logic controller, abandon the zone by image and cover processor and synchronously read in data image signal, image abandons the zone and covers processor the image storage is handled beginning then.
Image abandonment zone is covered processor and is called the algorithm routine that is pre-stored in its flash memory, go up the edge pixel information of abandoning regional (not shown) according to video image Video1 and carry out relaxative iteration processing calculating, reach and cover in the purpose of abandoning the picture material (not shown) that image (not shown) and reconstruct abandoned image block, obtain video image Vidio1 ', and it is stored in the internal memory.
The output frame buffer memory receives image successively and abandons the pixel that the corresponding video image Vidio1 ' of processor storage is covered in the zone.When abandoning the zone, image covers processor with after all the pixels of correspondence send to the output frame buffer memory, the acquisition step that is circulated to the video collector of beginning is carried out the collection of video image Video2, logic controller sends to Video Decoder with the content of being stored in the output frame buffer memory simultaneously, through after the video decoder decodes, demonstrate video image Vidio1 ' by image display.Successively, video processor is handled video image Video2, video image Video3, video image Video4 and video image Video5, obtains video image Video2 ', video image Video3 ', video image Video4 ' and video image Video5 '.
The above only is preferred embodiment of the present invention, is not to be used to limit protection scope of the present invention.