Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In addition, descriptions in this application as to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicit to the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
Referring to fig. 1, a flow chart of an output method of multi-channel image data provided in the present application is schematically illustrated, where the method may be performed by an output device of multi-channel image data, and the output device of multi-channel image data may be specifically implemented in a form of software or hardware. Generally, the method is applied to a middle and low end SOC (system on chip) of which hardware equipment does not support multi-path camera image data input and single-path output, and the embodiment of the application provides an output method of multi-path image data, which comprises the following steps:
step S1: sequentially acquiring target data, wherein each target data comprises effective data acquired by a plurality of channel cameras and a target frame synchronization signal;
step S2: when the target frame synchronization signal is detected, respectively acquiring the effective data of each channel from the target data;
step S3: and respectively outputting the effective data of each channel in the form of outputting a complete frame of image each time.
As described in step S1, the target data is converted data acquired and output from the cameras, and image data of the multiple channel cameras is output through the AHD, then converted from analog signals into digital signals through the conversion IC, and then packed and delivered to the SOC, where the target data includes valid data of the multiple channel cameras, and the valid data may be data of a complete frame of image, data of a half-frame of image, or partial data of a frame of image. In this embodiment, the manner of outputting the one-way camera data is a layout manner obtained by adding a frame synchronization signal and a line synchronization signal to effective data of an image and aggregating the effective data, the frame synchronization signal, and the line synchronization signal in a preset manner. In this embodiment, target data is sequentially obtained, where each target data includes valid data acquired by cameras of multiple channels, a target frame synchronization signal, and a line synchronization signal, and at this time, the valid data, the target frame synchronization signal, and the line synchronization signal in the target data are combined in a manner that the data of the single-channel camera is output, the target frame synchronization signal is used by the SOC to determine that the data can be processed in a process of receiving the data, and the line synchronization signal includes a line header of an image, where the line header includes channel information, line information of image frame data to which the line header belongs, frame number information of a frame sequence of the image frame to which the line header belongs, and the like.
As described in the above steps S2-S3, when the target frame synchronization signal of the target data is detected, that is, the SOC can process the target data, the valid data of each channel is independent from the valid data of the other channels, when the target frame synchronization signal is detected, the valid data of each channel can be acquired from the target data, then the valid data of each channel is output in the form of a complete frame image each time, further, the image data can be displayed, and the video display of each camera is completed by repeating the above steps and performing the display.
Therefore, the received target data comprise effective data acquired by the multiple channel cameras and a target frame synchronization signal, even if the middle-low end SOC has no corresponding hardware facilities, the target data can be still identified, and then the image data of each channel is restored from the target data, so that the image data acquired by the multiple channel cameras can be output on the basis of low cost.
In an embodiment, the valid data of each channel carries identification information corresponding to each channel, and the step S2 includes:
step S20: and respectively acquiring the effective data of each channel corresponding to the identification information from the target data according to the identification information.
In this embodiment, the identification information is information for identifying channels, and when image data is converted from an analog signal to a digital signal to form the target data, the identification information corresponding to each channel is added to the valid data, so that when an image of each channel is subsequently restored, the valid data of each channel can be obtained according to the identification information.
In one embodiment, the step S3 includes:
step S31: judging whether the current effective data of each channel is the image data of a complete frame image;
step S32: if the current effective data is the image data of a complete frame image, outputting the current effective data;
step S33: if the current effective data is not the image data of a complete frame image, judging whether the current effective data is in a correlation relationship with the subsequent effective data, wherein the subsequent effective data is the effective data of the channel acquired from the next received target data, and the correlation relationship is used for indicating that the two effective data belong to the same frame image;
step S34: if the correlation exists, combining the current effective data with the subsequent effective data to update the current effective data, and returning to execute the step of judging whether the current effective data of each channel is the image data of a complete frame of image.
As described in the above steps S31-S32, when acquiring the image data of the current frame of each channel, it may be specified to process the data of one channel preferentially, or process the data of all channels simultaneously, or process the data of a part of channels simultaneously, or process the data of each channel in a preset order of priority. Firstly, current effective data of a channel is obtained from target data, and then whether the current effective data is image data of a complete frame of image is judged. It is to be understood that the currently acquired target data may include data of multiple channels, and the data amount of each channel may be the same or different, for example, the effective data of the a channel is data of a complete frame image, while the effective data of the B channel is only data of a field image, the effective data of the C channel is data of a field of a previous frame and a field of a current frame, or data of a field of a current frame and a field of a next frame; therefore, it is first determined whether the current valid data is the complete image data of the same frame image, and it is specifically determined whether the data of each channel is the complete data of one frame image by the line header of the target data, for example, the line header includes the relative frame information and the real line information, where the frame information is the frame number of the frame where the line is located, for example, the frame number of the continuous frame image of a video can be cycled from 0 to 7; the line information is a line number of the line in a real and complete frame image, usually, a starting line number of the complete frame image is 1, and an ending line number is a line height n (n is an integer greater than 1) of the frame image, when it is determined that the frame numbers of each line in the current valid data are consistent, and the line numbers in the line information are arranged from the number 1 to the number n, it is determined that the current valid data is data of the complete frame image. If the line sequence numbers of the current effective data with consistent frame sequence numbers are only arranged from sequence number 1 to sequence number n-m (wherein m is less than n, and m is an integer greater than zero), the current effective data is the first half frame of the image frame corresponding to the frame sequence numbers, and the data can be cached; if the only line sequence numbers of the current valid data with the consistent frame sequence number are arranged from the sequence number n-m (wherein m < n) to the sequence number n, the current valid data is possibly the second half frame of the image frame corresponding to the frame sequence number, and the current valid data is merged with the cached data.
As described in the above steps S33-S34, when it is determined that the current valid data is not image data of a complete frame image, it is determined whether the current valid data is associated with the following valid data, the following valid data is valid data of a channel acquired from next received target data, the association is a relationship that two valid data are both data belonging to the same frame image, for example, when two valid data are respectively data belonging to the same frame image and respectively complementary two partial data, the two valid data are combined to obtain image data of a complete frame image, the determination can be made through row information in the row header and sequence number information of a frame in a frame sequence, when it is determined that the current valid data is associated with the following valid data, the current valid data is combined with the following valid data, so as to update the current valid data in the cache, and returning to step S31, namely, determining whether the merged current valid data is image data of a complete frame image, if yes, outputting the image data.
When the current valid data and the following valid data are combined to form image data of a complete frame image, that is, it is described that the remaining data of the frame image needs to be supplemented, the above steps S33-S34 are repeated, that is, target data of the next time is received, then valid data is obtained from the corresponding channel, for convenience of distinction, the third valid data is named as third valid data, then whether the third valid data is related to data combined in the previous two times is judged, if yes, the third valid data is combined with the valid data combined in the previous two times, then whether the combined valid data is image data of the complete frame image is judged, if yes, the image data is output, and so on until valid data obtained from the channel for multiple times can be combined to form image data of the frame image, and then the image data is output.
For example, the target data includes valid data of the a channel and the B channel, and a target frame synchronization signal and a line synchronization signal, when the target frame synchronization signal is detected, the valid data of the a channel and the B channel are obtained through the identification information, respectively, and then it is determined whether the data of the a channel and the B channel are image data of a complete frame image, in this embodiment, the valid data of the a channel is image data of a complete frame image with the a channel as a reference, at this time, the current valid data of the a channel can be directly output, the current valid data of the B channel is data of a half frame image, at this time, it is determined that the current valid data of the B channel is not image data of a complete frame image, then the current valid data is buffered, when the next target data is received, and the frame synchronization signal of the target data is detected, the next valid data of the a channel and the B channel are obtained again, respectively, and then, when judging that the later effective data of the channel A is data of a complete frame image, outputting the data, and when judging that the current effective data of the channel B is in a correlation with the later effective data, indicating that the later effective data of the channel B is also image data of a half frame image, combining the current effective data and the later effective data of the channel B to obtain image data of the complete frame image, and then outputting the image data.
In another embodiment, the target data further includes a C channel, and if the data amount of the effective data of the C channel in each target data is one-third of the image data of the frame image, the above steps are repeated until the effective data of the C channel acquired three times are combined to obtain the image data of a complete frame image, and then the image data is output.
It should be noted that, the data amount of the valid data of each channel is not limited herein, and may be data of a complete frame image, or may also be data of a half frame, a third frame, or a fourth frame, or may be data of a half frame image of the current frame and data of a third frame image of the previous frame, and the above steps are repeated, if the data is an incomplete frame image, the data is buffered, and if the data is a complete frame image, or the data is a complete frame image after being merged, the data is output, that is, all the valid data is finally output in the form of data of a complete frame image.
In another embodiment, if it is determined that the current valid data of the channel has no association with the following valid data, it indicates that there may be a situation of data loss or order confusion in the process of processing data, the current valid data may be cached, and when the valid data having an association with the current valid data is acquired in the following processing process, the current valid data and the following valid data are merged; alternatively, the current valid data is deleted.
In one embodiment, the step S1 includes:
step S01: sequentially acquiring image data of each channel;
step S02: sequentially converting the image data acquired by each channel from an analog signal to a digital signal, wherein the digital signal comprises effective data of an image;
step S03: and acquiring the target frame synchronization signal, and packaging the effective data in the digital signals of each channel acquired each time and the target frame synchronization signal to form the target data.
In this embodiment, the target data is obtained from the multiple channels of cameras, first, image data of the multiple channels of cameras are output through the AHD, that is, image data corresponding to each channel can be obtained from the multiple channels through the AHD, then, in the process of converting an analog signal into a digital signal by the conversion IC, the image data is packed to obtain the target data according to a single-channel camera data output mode, that is, effective data in the digital signal of each channel is obtained first, and then, the effective data of each channel obtained each time, the line header and the obtained target frame synchronization signal are packed to form the target data.
In another embodiment, valid data in the digital signal of each channel and a frame synchronization signal of each channel corresponding to the valid data are acquired, at this time, the frame synchronization signal of each channel can be defaulted as extra valid data of the channel, the extra valid data and the extra valid data are processed together, and then the valid data of each channel acquired each time and the frame synchronization signal of each channel corresponding to the channel, the line header and the acquired target frame synchronization signal are packaged to form the target data. For example, as shown in FIG. 2, the packed target data is shown, where LH is the line header of the target data, big-FB is the target frame sync signal, ch0-FB, ch1-FB, ch2-FB, and ch3-FB are the frame sync signals of channel 0, channel 1, channel 2, and channel 3, ch0-cur, ch1-cur, ch2-cur, and ch3-cur are the valid data of the current frame image of channel 0, channel 1, channel 2, and channel 3, respectively, and ch1-pre, ch2-pre, and ch3-pre are the valid data of the previous frame image of channel 1, channel 2, and channel 3, respectively. The specific forming process comprises the following steps: since the data of each channel includes valid data of an image, a frame synchronization signal and a line synchronization signal from the data acquired from the camera head through each channel, in the present embodiment, the valid data of the image of each channel and the frame synchronization signal are acquired together, that is, the current valid data (ch0-cur, ch1-cur and ch1-pre, ch2-cur and ch2-pre, ch3-cur and ch3-pre) and the frame synchronization signal (ch0-FB, ch1-FB, ch2-FB, 3-FB) corresponding to each channel are acquired at first, and then the frame synchronization information of each channel is processed as additional valid data with its corresponding image valid data set, and then packed with a Line Header (LH) and a target frame synchronization signal (big-FB), at this time, since the frame synchronization information of each channel is defaulted to be extra valid data, when the target data is sent to the SOC, the program for acquiring the valid data can be entered only by detecting the target frame synchronization signal without detecting the frame synchronization signal of each channel.
In one embodiment, the step S03 includes:
step S031: and generating the target frame synchronization signal according to the frame synchronization signal of the digital signal of any channel.
In this embodiment, each image data is converted from an analog signal to a digital signal by a conversion IC, where the digital signal includes valid data of an image, a frame synchronization signal, and a line synchronization signal, in this embodiment, the frame synchronization signal of the image data of one channel is used as a target frame synchronization signal of the target data, specifically, the frame synchronization signal of the image data of any channel is obtained, and then the frame synchronization signal is converted to obtain the target frame synchronization signal, for example, 45 lines of the frame synchronization signal of the image data of the a channel, only 1 line of the frame synchronization signal is used to generate the target frame synchronization signal, so that the capacity occupied by the target frame synchronization signal is as small as possible, more spaces are reserved for placing the valid data of each channel, the remaining 44 lines are used as an extra valid data set with the image valid data in the a channel, and then the line synchronization signals of each line are combined to obtain a line header of the target data, and then, the target frame synchronization signal is used as a common frame synchronization signal of the image data of each channel, and the common frame synchronization signal, the line header and the effective data of each image data are packed to obtain target data, wherein the target data at the moment comprises an aggregate data formed by aggregating the effective data of each channel, a common target frame synchronization signal and a line header. It should be noted that, in the process of forming the target data, while the target frame synchronization signal is added, since valid data of a real image transmitted by each channel needs to be received, in order to avoid data loss, the conversion IC needs to buffer the target frame synchronization signal, and in order to save space and avoid wasting resources, the buffer should be as small as possible, in addition, generally, the low-end SOC has certain requirements on the processing capacity due to the limitation of hardware facilities, and needs to recognize the frame synchronization signal within 1 line of time, so the target frame synchronization signal is set to 1 line. In another embodiment, the target frame synchronization signal is used as a common frame synchronization signal of the image data of each channel, and the target data is obtained by performing a packing process on the line header, the valid data of each image data and the frame synchronization signal of the corresponding channel, that is, the target data at this time includes an aggregate data composed of the valid data aggregate of each channel and the frame synchronization signal thereof, a common target frame synchronization signal and a line header.
In another embodiment, the common frame synchronization signal may be preset, the conversion IC converts each image data from an analog signal to a digital signal, and then obtains corresponding valid data from each image data, and the preset target frame synchronization signal is used as the common frame synchronization signal for the image data of each channel, and the target data is obtained by performing line header packing processing with the valid data of each image data. Or, acquiring corresponding effective data and corresponding frame synchronization signals from each image data, using preset target frame synchronization signals as common frame synchronization signals of the image data of each channel, and performing line header packaging processing on the effective data of each image data and the frame synchronization signals of the corresponding channels to obtain the target data.
In one embodiment, the step S03 includes:
step S031: acquiring the target frame synchronization signal;
step S032: performing parallel or sequential cyclic sequencing on the effective data in each digital signal and the row data in each channel effective data;
step S033: and packaging each effective data and the target frame synchronous signal after circularly sequencing the row data in each channel effective data in parallel or in sequence to obtain the target data.
In this embodiment, in the process of obtaining the above target data, the above target data may be obtained by performing parallel or sort processing on each valid data in a horizontal layout manner or a vertical layout manner, and then processing the valid data with the target frame synchronization signal and the line header, as shown in fig. 2, the valid data of multiple paths of camera images are collected in a horizontal layout manner, that is, the valid data are parallel, where LH is the line header of the target data, big-FB is the target frame synchronization signal, ch0-FB, ch1-FB, ch2-FB, ch3-FB are respectively the frame synchronization signals of channel 0, channel 1, channel 2, and channel 3, ch0-cur, ch1-cur, ch2-cur, and ch3-cur are respectively the valid data of the current frame images of channel 0, channel 1, channel 2, and channel 3, ch1-pre, pre, ch2-pre and ch3-pre are respectively valid data of a previous frame image of a channel 1, a channel 2 and a channel 3, where a set of the valid data of a current frame image and the valid data of the previous frame image is current valid data of the channel of the target data, in this embodiment, when the target data is acquired, valid data of the channel 0, the channel 1, the channel 2 and the channel 3 can be acquired respectively according to identification information, then the valid data of the previous frame in each channel is spliced with the cached valid data corresponding to the channel to obtain a complete frame image, and then the complete frame image is output, and the valid data of the current frame in the valid data is cached, for example, for the channel 1, the ch1-pre of the previous frame in the current valid data and the cached valid data of the channel 1 having an association relationship are merged and restored to obtain data of the complete frame image, then output and buffer the ch1-cur of the current frame in the current valid data to wait for the ch1-pre of channel 1 to be obtained from the next received target data.
As shown in fig. 3, in order to assemble the valid data in a vertical layout manner to form the target data, that is, form the target data by circularly sorting the line data of each channel, where chx line nx is the x-th line data of the channel x, for example, ch1 line n1, ch2 line n2, and ch3 line n3 are the first line data of the channel 1, the second line data of the channel 2, and the third line data of the channel 3, respectively, that is, in the process of generating the target data, the line data in the valid data of each channel is circularly sorted and then is assembled with a common frame synchronization signal and line header, in the embodiment, in acquiring the target data, the frame number and the line number of the valid data of each channel are determined according to the line header of the target data, and then the valid data of each line are sequentially spliced to restore the image data of a complete frame image, and outputting, if the image is not a complete frame of image, caching the effective data to wait for obtaining the effective data of each channel from the next received target data, repeating the steps until the data of the complete frame of image is spliced and output.
The application also provides an output device of the multi-channel image data, which is used for executing the output method of the multi-channel image data, wherein the output device of the multi-channel image data can be realized in a form of software or hardware, and is usually applied to a middle and low end SOC (system on chip) which does not support multi-channel camera image data input and single-channel output. Referring to fig. 4, the apparatus for outputting multi-channel image data includes:
the system comprises an acquisition target unit 100, a processing unit and a processing unit, wherein the acquisition target unit 100 is used for sequentially acquiring target data, and each target data comprises effective data acquired by a plurality of channel cameras and a target frame synchronization signal;
a signal detection unit 200, configured to, when the target frame synchronization signal is detected, respectively obtain the valid data of each channel from the target data;
an output data unit 300, configured to output the valid data of each channel respectively in a form of outputting a complete frame of image each time.
As described in the above-mentioned target obtaining unit 100, the above-mentioned target data is converted data acquired and output from the cameras, and image data of the multiple channel cameras is output through the AHD, then converted from analog signals into digital signals through the conversion IC, and then packed and delivered to the SOC, where the target data includes valid data of the multiple channel cameras, and the valid data may be data of a complete frame of image, data of a half frame of image, or partial data in a frame of image. In this embodiment, the manner of outputting the one-way camera data is a layout manner obtained by adding a frame synchronization signal and a line synchronization signal to effective data of an image and aggregating the effective data, the frame synchronization signal, and the line synchronization signal in a preset manner. In this embodiment, target data is sequentially obtained, where each target data includes valid data acquired by cameras of multiple channels, a target frame synchronization signal, and a line synchronization signal, and at this time, the valid data, the target frame synchronization signal, and the line synchronization signal in the target data are combined in a manner that the data of the single-channel camera is output, the target frame synchronization signal is used by the SOC to determine that the data can be processed in a process of receiving the data, and the line synchronization signal includes a line header of an image, where the line header includes channel information, line information of image frame data to which the line header belongs, frame number information of a frame sequence of the image frame to which the line header belongs, and the like.
As described in the foregoing detection signal unit 200 and the output data unit 300, when a target frame synchronization signal of the target data is detected, that is, the SOC may process the target data, the valid data of each channel is independent of the valid data of the other channels, when the target frame synchronization signal is detected, the valid data of each channel may be obtained from the target data, and then the valid data of each channel is output in the form of a complete frame image each time, and further, the image data may be displayed, and the video display of each camera is completed by repeating the above steps and performing the display.
Therefore, the received target data comprise effective data acquired by the multiple channel cameras and a target frame synchronization signal, even if the middle-low end SOC has no corresponding hardware facilities, the target data can be still identified, and then the image data of each channel is restored from the target data, so that the image data acquired by the multiple channel cameras can be output on the basis of low cost.
In an embodiment, the valid data of each channel carries identification information corresponding to each channel, and the detection signal unit 200 includes:
and the data acquiring subunit is configured to acquire, according to the identification information, the valid data of each channel corresponding to the identification information from the target data.
In this embodiment, the identification information is information for identifying channels, and when image data is converted from an analog signal to a digital signal to form the target data, the identification information corresponding to each channel is added to the valid data, so that when an image of each channel is subsequently restored, the valid data of each channel can be obtained according to the identification information.
In one embodiment, the output data unit 300 includes:
the first judging subunit is used for judging whether the current effective data of each channel is the image data of a complete frame image;
the output data subunit is used for outputting the current effective data if the current effective data is the image data of a complete frame image;
a second determining subunit, configured to determine, if the current valid data is not image data of a complete frame of image, whether the current valid data has a correlation with subsequent valid data, where the subsequent valid data is valid data of the channel acquired from next received target data, and the correlation is used to indicate that both valid data belong to the same frame of image;
and the first merging subunit is configured to merge the current valid data and the subsequent valid data to update the current valid data if there is a relationship, and return to perform the step of determining whether the current valid data of each channel is image data of a complete frame of image.
As described in the first determining subunit and the output data subunit, when acquiring the image data of the current frame of each channel, it may be specified to preferentially process the data of one channel, or process the data of all channels simultaneously, or process the data of a part of channels simultaneously, or process the data of each channel according to a preset priority order. Firstly, current effective data of a channel is obtained from target data, and then whether the current effective data is image data of a complete frame of image is judged. It is to be understood that the currently acquired target data may include data of multiple channels, and the data amount of each channel may be the same or different, for example, the effective data of the a channel is data of a complete frame image, while the effective data of the B channel is only data of a field image, the effective data of the C channel is data of a field of a previous frame and a field of a current frame, or data of a field of a current frame and a field of a next frame; therefore, it is first determined whether the current valid data is the complete image data of the same frame image, and it is specifically determined whether the data of each channel is the complete data of one frame image by the line header of the target data, for example, the line header includes the relative frame information and the real line information, where the frame information is the frame number of the frame where the line is located, for example, the frame number of the continuous frame image of a video can be cycled from 0 to 7; the line information is a line number of the line in a real and complete frame image, usually, a starting line number of the complete frame image is 1, and an ending line number of the complete frame image is a line height n of the frame image, when it is determined that the frame numbers of each line in the current valid data are consistent, and the line numbers in the line information are arranged from number 1 to number n (n is an integer greater than 1), it is determined that the current valid data is data of the complete frame image. If the line sequence numbers of the current effective data with consistent frame sequence numbers are only arranged from sequence number 1 to sequence number n-m (wherein m is less than n, and m is an integer greater than zero), the current effective data is the first half frame of the image frame corresponding to the frame sequence numbers, and the data can be cached; if the only line sequence numbers of the current valid data with the consistent frame sequence number are arranged from the sequence number n-m (wherein m < n) to the sequence number n, the current valid data is possibly the second half frame of the image frame corresponding to the frame sequence number, and the current valid data is merged with the cached data.
As described in the second determination subunit and the first merging subunit, when it is determined that the current valid data is not image data of a complete frame image, it is determined whether the current valid data is associated with the following valid data, where the following valid data is valid data of a channel acquired from next received target data, and the association is a relationship where two valid data are data belonging to the same frame image, for example, when two valid data are data belonging to the same frame image and complementary data, the two valid data are merged to obtain image data of a complete frame image, the determination may be made through row information in a row header and sequence number information of a frame in a frame sequence, and when it is determined that the current valid data and the following valid data have an association, the current valid data and the following valid data are merged, and updating the current effective data in the cache, and returning to execute the first judgment subunit, namely judging whether the combined current effective data is the image data of a complete frame of image again, and if so, outputting the image data.
When the current effective data and the subsequent effective data are combined to form image data of a complete frame image, that is, the other data of the frame image needs to be supplemented, the steps are repeated, that is, target data of the next time is received, then effective data is obtained from the corresponding channel, for convenience of distinction, the effective data is named as third effective data, whether the third effective data is in a relation with data combined in the previous two times is judged, if yes, the third effective data is combined with the effective data combined in the previous two times, then whether the combined effective data is the image data of the complete frame image is judged, if yes, the image data is output, and the like is repeated until the effective data of the channel is obtained for multiple times and can be combined to form the image data of the frame image, and then the image data is output.
For example, the target data includes valid data of the a channel and the B channel, and a target frame synchronization signal and a line synchronization signal, when the target frame synchronization signal is detected, the valid data of the a channel and the B channel are obtained through the identification information, respectively, and then it is determined whether the data of the a channel and the B channel are image data of a complete frame image, in this embodiment, the valid data of the a channel is image data of a complete frame image with the a channel as a reference, at this time, the current valid data of the a channel can be directly output, the current valid data of the B channel is data of a half frame image, at this time, it is determined that the current valid data of the B channel is not image data of a complete frame image, then the current valid data is buffered, when the next target data is received, and the frame synchronization signal of the target data is detected, the next valid data of the a channel and the B channel are obtained again, respectively, and then, when judging that the later effective data of the channel A is data of a complete frame image, outputting the data, and when judging that the current effective data of the channel B is in a correlation with the later effective data, indicating that the later effective data of the channel B is also image data of a half frame image, combining the current effective data and the later effective data of the channel B to obtain image data of the complete frame image, and then outputting the image data.
In another embodiment, the target data further includes a C channel, and if the data amount of the effective data of the C channel in each target data is one-third of the image data of the frame image, the above steps are repeated until the effective data of the C channel acquired three times are combined to obtain the image data of a complete frame image, and then the image data is output.
It should be noted that, the data amount of the valid data of each channel is not limited herein, and may be data of a complete frame image, or may also be data of a half frame, a third frame, or a fourth frame, or may be data of a half frame image of the current frame and data of a third frame image of the previous frame, and the above steps are repeated, if the data is an incomplete frame image, the data is buffered, and if the data is a complete frame image, or the data is a complete frame image after being merged, the data is output, that is, all the valid data is finally output in the form of data of a complete frame image.
In another embodiment, if it is determined that the current valid data of the channel has no association with the following valid data, it indicates that there may be a situation of data loss or order confusion in the process of processing data, the current valid data may be cached, and when the valid data having an association with the current valid data is acquired in the following processing process, the current valid data and the following valid data are merged; alternatively, the current valid data is deleted.
In one embodiment, the above target unit 100 includes:
the obtaining flux subunit is used for sequentially obtaining the image data of each channel;
a conversion data subunit, configured to sequentially convert the image data acquired in each channel from an analog signal to a digital signal, where the digital signal includes valid data of an image;
and the acquisition signal subunit is used for acquiring the target frame synchronization signal and packaging the effective data in the digital signals of each channel acquired each time and the target frame synchronization signal to form the target data.
In this embodiment, the target data is obtained from the multiple channels of cameras, first, image data of the multiple channels of cameras are output through the AHD, that is, image data corresponding to each channel can be obtained from the multiple channels through the AHD, then, in the process of converting an analog signal into a digital signal by the conversion IC, the image data is packed to obtain the target data according to a single-channel camera data output mode, that is, effective data in the digital signal of each channel is obtained first, and then, the effective data of each channel obtained each time, the line header and the obtained target frame synchronization signal are packed to form the target data.
In another embodiment, valid data in the digital signal of each channel and a frame synchronization signal of each channel corresponding to the valid data are acquired, at this time, the frame synchronization signal of each channel can be defaulted as extra valid data of the channel, the extra valid data and the extra valid data are processed together, and then the valid data of each channel acquired each time and the frame synchronization signal of each channel corresponding to the channel, the line header and the acquired target frame synchronization signal are packaged to form the target data. For example, as shown in FIG. 2, the packed target data is shown, where LH is the line header of the target data, big-FB is the target frame sync signal, ch0-FB, ch1-FB, ch2-FB, and ch3-FB are the frame sync signals of channel 0, channel 1, channel 2, and channel 3, ch0-cur, ch1-cur, ch2-cur, and ch3-cur are the valid data of the current frame image of channel 0, channel 1, channel 2, and channel 3, respectively, and ch1-pre, ch2-pre, and ch3-pre are the valid data of the previous frame image of channel 1, channel 2, and channel 3, respectively. The specific forming process comprises the following steps: since the data of each channel includes valid data of an image, a frame synchronization signal and a line synchronization signal from the data acquired from the camera head through each channel, in the present embodiment, the valid data of the image of each channel and the frame synchronization signal are acquired together, that is, the current valid data (ch0-cur, ch1-cur and ch1-pre, ch2-cur and ch2-pre, ch3-cur and ch3-pre) and the frame synchronization signal (ch0-FB, ch1-FB, ch2-FB, 3-FB) corresponding to each channel are acquired at first, and then the frame synchronization information of each channel is processed as additional valid data with its corresponding image valid data set, and then packed with a Line Header (LH) and a target frame synchronization signal (big-FB), at this time, since the frame synchronization information of each channel is defaulted to be extra valid data, when the target data is sent to the SOC, the program for acquiring the valid data can be entered only by detecting the target frame synchronization signal without detecting the frame synchronization signal of each channel.
In one embodiment, the above-mentioned acquisition signal subunit includes:
and the generation signal subunit is used for generating the target frame synchronization signal according to the frame synchronization signal of the digital signal of any channel.
In this embodiment, each image data is converted from an analog signal to a digital signal by a conversion IC, where the digital signal includes valid data of an image, a frame synchronization signal, and a line synchronization signal, in this embodiment, the frame synchronization signal of the image data of one channel is used as a target frame synchronization signal of the target data, specifically, the frame synchronization signal of the image data of any channel is obtained, and then the frame synchronization signal is converted to obtain the target frame synchronization signal, for example, 45 lines of the frame synchronization signal of the image data of the a channel, only 1 line of the frame synchronization signal is used to generate the target frame synchronization signal, so that the capacity occupied by the target frame synchronization signal is as small as possible, more spaces are reserved for placing the valid data of each channel, the remaining 44 lines are used as an extra valid data set with the image valid data in the a channel, and then the line synchronization signals of each line are combined to obtain a line header of the target data, and then, the target frame synchronization signal is used as a common frame synchronization signal of the image data of each channel, and the common frame synchronization signal, the line header and the effective data of each image data are packed to obtain target data, wherein the target data at the moment comprises an aggregate data formed by aggregating the effective data of each channel, a common target frame synchronization signal and a line header. It should be noted that, in the process of forming the target data, while the target frame synchronization signal is added, since valid data of a real image transmitted by each channel needs to be received, in order to avoid data loss, the conversion IC needs to buffer the target frame synchronization signal, and in order to save space and avoid wasting resources, the buffer should be as small as possible, in addition, generally, the low-end SOC has certain requirements on the processing capacity due to the limitation of hardware facilities, and needs to recognize the frame synchronization signal within 1 line of time, so the target frame synchronization signal is set to 1 line. In another embodiment, the target frame synchronization signal is used as a common frame synchronization signal of the image data of each channel, and the target data is obtained by performing a packing process on the line header, the valid data of each image data and the frame synchronization signal of the corresponding channel, that is, the target data at this time includes an aggregate data composed of the valid data aggregate of each channel and the frame synchronization signal thereof, a common target frame synchronization signal and a line header.
In another embodiment, the common frame synchronization signal may be preset, the conversion IC converts each image data from an analog signal to a digital signal, and then obtains corresponding valid data from each image data, and the preset target frame synchronization signal is used as the common frame synchronization signal for the image data of each channel, and the target data is obtained by performing line header packing processing with the valid data of each image data. Or, acquiring corresponding effective data and corresponding frame synchronization signals from each image data, using preset target frame synchronization signals as common frame synchronization signals of the image data of each channel, and performing line header packaging processing on the effective data of each image data and the frame synchronization signals of the corresponding channels to obtain the target data.
In one embodiment, the above-mentioned acquisition signal subunit includes:
an obtaining target module, configured to obtain the target frame synchronization signal;
the sequencing data module is used for carrying out parallel or sequential cyclic sequencing on the effective data in each digital signal and the row data in the effective data in each channel;
and the packed data module is used for packing each effective data after circularly sequencing the line data in each channel effective data in parallel or in sequence and the target frame synchronous signal to obtain the target data.
In this embodiment, in the process of obtaining the above target data, the above target data may be obtained by performing parallel or sort processing on each valid data in a horizontal layout manner or a vertical layout manner, and then processing the valid data with the target frame synchronization signal and the line header, as shown in fig. 2, the valid data of multiple paths of camera images are collected in a horizontal layout manner, that is, the valid data are parallel, where LH is the line header of the target data, big-FB is the target frame synchronization signal, ch0-FB, ch1-FB, ch2-FB, ch3-FB are respectively the frame synchronization signals of channel 0, channel 1, channel 2, and channel 3, ch0-cur, ch1-cur, ch2-cur, and ch3-cur are respectively the valid data of the current frame images of channel 0, channel 1, channel 2, and channel 3, ch1-pre, pre, ch2-pre and ch3-pre are respectively valid data of a previous frame image of a channel 1, a channel 2 and a channel 3, where a set of the valid data of a current frame image and the valid data of the previous frame image is current valid data of the channel of the target data, in this embodiment, when the target data is acquired, valid data of the channel 0, the channel 1, the channel 2 and the channel 3 can be acquired respectively according to identification information, then the valid data of the previous frame in each channel is spliced with the cached valid data corresponding to the channel to obtain a complete frame image, and then the complete frame image is output, and the valid data of the current frame in the valid data is cached, for example, for the channel 1, the ch1-pre of the previous frame in the current valid data and the cached valid data of the channel 1 having an association relationship are merged and restored to obtain data of the complete frame image, then output and buffer the ch1-cur of the current frame in the current valid data to wait for the ch1-pre of channel 1 to be obtained from the next received target data.
As shown in fig. 3, in order to assemble the valid data in a vertical layout manner to form the target data, that is, form the target data by circularly sorting the line data of each channel, where chx line nx is the x-th line data of the channel x, for example, ch1 line n1, ch2 line n2, and ch3 line n3 are the first line data of the channel 1, the second line data of the channel 2, and the third line data of the channel 3, respectively, that is, in the process of generating the target data, the line data in the valid data of each channel is circularly sorted and then is assembled with a common frame synchronization signal and line header, in the embodiment, in acquiring the target data, the frame number and the line number of the valid data of each channel are determined according to the line header of the target data, and then the valid data of each line are sequentially spliced to restore the image data of a complete frame image, and outputting, if the image is not a complete frame of image, caching the effective data to wait for obtaining the effective data of each channel from the next received target data, repeating the steps until the data of the complete frame of image is spliced and output.
Referring to fig. 5, the present application also provides a computer-readable storage medium 21, in which a computer program 22 is stored in the storage medium 21, which when run on a computer causes the computer to perform the output method of multi-channel image data described in the above embodiments.
Referring to fig. 6, the present application also provides a computer device 34 containing instructions, the computer device comprising a memory 31 and a processor 33, the memory 31 storing a computer program 22, the processor 33 implementing the output method of multi-channel image data described in the above embodiments when executing the computer program 22.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.