A kind of multi-channel video joining method, system and electronic device
Technical field
The invention belongs to video-splicing technical field more particularly to a kind of multi-channel video joining methods, system and electronics dress
It sets.
Background technique
Two-way or multi-channel video are exactly spliced into video all the way by so-called video-splicing, are output on a display screen.
This splicing is an important topic of monitoring field research.In addition, with the development of science and technology, running records, is complete
Orientation camera shooting, the development in the fields such as space flight camera shooting, is also added to new catalyst for the research of video-splicing, promotes video-splicing
Technology development, also brings new challenge to video-splicing technology.
In terms of video-splicing research, traditional video-splicing method be when acquiring video, using synchronizer trigger come
Video collector is driven simultaneously, to realize the synchronism of multi-channel video.The control of this method is got up more complex, and is easy to
The problem of due to route Length discrepancy and there is deviation, it is often more important that, this method is only applicable to identical format and resolution ratio
Video collector, it is then helpless for the video collector of different resolution.In addition, with the raising of image resolution ratio,
Clock frequency also increases accordingly, be in very short time restriction, and realization is synchronous just extremely difficult, thus image after splicing
It is of low quality.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of multi-channel video joining method, it is intended to after solving existing video-splicing
The not high problem of picture quality.
The embodiments of the present invention are implemented as follows, a kind of multi-channel video joining method, comprising the following steps:
According to multi-channel video connecting method, frame memory is divided into multiple memory spaces;
Data line sequentially is written in each memory space, so circulation is until write each all data of road video;
Each row data of the frame memory are sequentially read, and are shown according to read data;
Wherein, each memory space has multirow writing address.
The another object of the embodiment of the present invention is to provide a kind of multi-channel video splicing system, the system comprises:
Frame storage control module, for according to multi-channel video connecting method, frame memory to be divided into multiple memory spaces;
Frame memory writing module, for data line sequentially to be written in each memory space, so circulation is until write
Each all data of road video;
Frame memory read goes out module, for sequentially reading each row data of the frame memory, and according to read data
It is shown;
Wherein, each memory space has multirow writing address.
The another object of the embodiment of the present invention is to provide a kind of electronic device, and the electronic device uses above system.
Frame memory is divided into multiple memory spaces, then first according to multi-channel video connecting method by the embodiment of the present invention
Data line, so circulation sequentially is written until writing each all data of road video in each memory space, then sequentially reads
Each row data of frame memory, and shown according to read data, multi-channel video can be spliced, without same
Step triggering, easily controllable, synchronism is good, and picture quality is high.
Detailed description of the invention
Fig. 1 is the implementation flow chart of multi-channel video joining method provided in an embodiment of the present invention;
Fig. 2 is two-path video splicing effect figure (left and right arrangement);
Fig. 3 is two-path video splicing effect figure (upper and lower arrangement);
Tri- road video-splicing effect picture of Tu4Shi;
Tetra- road video-splicing effect picture of Tu5Shi (uniformly arrangement);
Tetra- road video-splicing effect picture (non-homogeneous arrangement) of Tu6Shi;
Fig. 7 is multi-channel video splicing system architecture diagram provided in an embodiment of the present invention;
Fig. 8 is frame memory writing module specific workflow figure in the embodiment of the present invention;
Fig. 9 is that frame memory read goes out module specific workflow figure in the embodiment of the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
Frame memory is divided into multiple memory spaces, then first according to multi-channel video connecting method by the embodiment of the present invention
Data line, so circulation sequentially is written until writing each all data of road video in each memory space, then sequentially reads
Each row data of frame memory, and shown according to read data, multi-channel video can be spliced, without same
Step triggering, easily controllable, synchronism is good, and picture quality is high.
Several embodiments are set forth below realization of the invention is described in detail.
Embodiment one
Fig. 1 shows the implementation process of multi-channel video joining method provided in an embodiment of the present invention, and details are as follows.
In step s101, according to multi-channel video connecting method, frame memory is divided into multiple memory spaces.
The embodiment of the present invention has various video connecting method.Fig. 2,3 show two-path video connecting method, wherein Fig. 2
For left and right arrangement, Fig. 3 is upper and lower arrangement.Fig. 4 shows three road video-splicing modes.Fig. 5,6 show four road video-splicings
Mode.The road Zhong Ge of embodiment of the present invention video both can be the video directly shot by camera, or in various storages
The video stored in device, the two, which has both, all may be used.
Now be described in detail for four road video-splicing modes shown in Fig. 6, the four roads video respectively by camera a,
Camera b, camera c and camera d directly shoot generation, i.e., generate tetra- road video of a, b, c, d respectively.Herein according to a, b, c,
Tetra- road video-splicing mode of d, is divided into memory space A, memory space B, memory space C for 480 × 320 frame memory and deposits
Space D is stored up, wherein memory space A is 480 × 160, and memory space B, C, D are 160 × 160.Wherein, each memory space tool
There is a multirow writing address, such as the memory space A has a 160 row writing address, the memory space B, memory space C and deposits
Storage space D all has 160 row writing address.In addition, the frame memory can be SRAM, SDRAM, DDR or DDR2.
The embodiment of the present invention for convenience of data be written frame memory, by frame memory be divided into multiple memory spaces it
Before, the road Hai Duige video distribution row caching, the row caches the data line to receive corresponding road video.
In addition, the road Hai Duige video cut and format is converted before to each road video distribution row caching.Specifically
Ground first obtains multi-channel video signal, and analog signal therein is converted to digital signal, to form multi-path digital signal.Because existing
It is various there is camera signals format, therefore analog signal therein need to be converted to digital signal, to form multi-path digital signal, makes
This method is compatible with different type camera.It can be applied to the video of a variety of different-formats in this way, such as RAW DATA format
The video data of two kinds of different-formats of CCD camera of CMOS camera and yuv format, which can also splice, (to be converted YUV signal
For RAW DATA rgb signal), the camera for being particularly suitable for vehicle-mounted front and back different-format is spliced.
In step s 102, data line sequentially is written in each memory space, so circulation is until write each road video
All data.
Sequentially data line is written in each memory space in the embodiment of the present invention, and so circulation is until write each road video institute
There are data.As shown in fig. 6, being regarded later on the memory space B write-in road b first in the data line of the memory space A write-in road a video
The road d video finally is written in memory space D then in the data line of the memory space C write-in road c video in the data line of frequency
Data line, this writes one number time for one, and so circulation is until write tetra- all data of road video of a, b, c, d.
In step s 103, each row data of the frame memory are sequentially read, and are shown according to read data.
The embodiment of the present invention sequentially reads each row data of the frame memory, and is shown according to read data.
As shown in fig. 6, first reading the data in the frame memory storage space A line by line, i.e., first show a width picture of the road a video;
Then the data of memory space B the first row, the number of the data of memory space C the first row and memory space D the first row are sequentially read
According to these data constitute the frame memory data line;Then the data of the second row of memory space B, memory space C the is read
The data of the second row of data and memory space D of two rows, these data constitute the another data line of frame memory;Class according to this
It pushes away, will show a width picture of three video of the road a, b, c simultaneously.
Embodiment two
Fig. 7 shows multi-channel video splicing system framework provided in an embodiment of the present invention, which includes frame storage control
Module 1, frame memory writing module 2 and frame memory read go out module 3.Wherein, the frame storage control module 1 is used for according to more
Frame memory 4 is divided into multiple memory spaces by road video-splicing mode.The frame memory writing module 2 is for sequentially existing
Data line is written in each memory space, and so circulation is until write each all data of road video.The frame memory read depanning
Block 3 is shown for sequentially reading each row data of the frame memory 4 according to read data.Wherein, each storage
Space has multirow writing address.
Frame storage control module described in the embodiment of the present invention 1 is also used to cache each road video distribution row, the system
It further include carrying out the cutting conversion module of cutting and format conversion to each road video and controlling read operation and write operation
Read-write Catrol module 5.
It should be noted that above-mentioned each module concrete operating principle is as it was noted above, be not repeated here herein.In addition,
The modules of above-mentioned multi-channel video splicing system can be the module of software module, hardware module or software and hardware combining, soft
Part module section can be stored in a computer readable storage medium, such as ROM/RAM, disk, CD.
The data line of the road Zhong Jiangge of embodiment of the present invention video is input to corresponding line caching, therefore need to calculate each road video
Row caching received data number, if certain all the way video line caching received data number reach with corresponding to the road video
The number of memory space a line writing address, the road Ze Jianggai video line cache corresponding to received data write-in and the road video
Memory space, then other each road video lines caching received datas are sequentially written corresponding in the frame memory 4
Memory space.If each road video line caching received data number reaches the memory space a line writing address that is corresponding to it simultaneously
Number, the road Ze Jiangge video line caching received data the respective stored space in the frame memory 4 is sequentially written.This
Data in each row caching are written to frame memory 4 by the control for being in the frame memory writing module 2, are specifically controlled
Journey is as follows.
It is empty according to the storage divided before by frame memory writing module 2 in writing in the time for the frame memory 4
Between control and be written in frame memory 4.The display screen time-sequence control module 6 finally exported is being read according to the timing requirements of output
In number validity period, the data in output caching 7 are constantly read.Frame memory read goes out module 3 according to the data in output caching 7
Number is to determine whether carry out read operation.If the data amount check in output caching 7 shows required number less than a line, that is, generate reading
Signal is controlled, reads data from frame memory 4.During Read-write Catrol, guarantee read operation is needed prior to write operation
It is different according to read-write period, switch read/write address.
Fig. 8 shows 2 specific workflow of frame memory writing module, first judges that each road video line caching is received herein
Data amount check whether reach the number with memory space a line writing address corresponding to the road video, if reaching, enter should
Road write request state.Into after write request state, the commencing signal of writing on the road is drawn high, indicates the beginning of continuous write operation.It writes
After operation starts, the continuous write state on the road is jumped to, frame storage write-in is determined according to the memory space of row field signal and distribution
The first address of address after being continuously written into the data (i.e. data line) of fixed quantity, is drawn high and continuously writes complete signal, indicate this
It writes and counts up into.In this way, each road video data is written to corresponding position according to such process.
Since there are four road videos, possible four road videos reach the output requirement of row caching simultaneously, it is therefore desirable to carry out excellent
First grade judgement.When starting, the data amount check in the road a video line caching is first determined whether, if not satisfied, the road b is judged again, if not
Meet, continues to judge the road c, finally judge the road d, sequentially judged according to this.In writing number progress, then need to ask according to upper one
State is sought to select next row caching for needing to judge.For example, if laststate is request and the burst shape of the road b row caching
State need to then judge the data amount check in row caching according to c-> d-> a-> b sequence.If not according to this require into
Row, judgement is according to a-> b-> c-> d sequence every time, it is likely that after once writing number, the road a row is cached again
Reach the number of requirement, so that state of a control be caused to rest on the solicited status on the road a always, frame can not be written in other three roads videos
In memory.
Fig. 9 shows frame memory read and goes out 3 specific workflow of module, due to frame memory writing module 2 control under,
Every frame image according to it is required be combined into come position store, so frame memory read go out module 3 only need to according to output when
Sequence requirement, reads data point by point, can complete splicing function.Specifically, if data amount check is less than a line in output caching 7,
Read request state is jumped to, sends reading request to frame memory 4.It is read whether processing is in the judgement of read request state,
Enter continuous read states if being not finished, the continuous data read in frame memory 4 read data line, data line every time
It all reads, then terminates this read operation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.