Summary of the invention
The invention provides method, encoder and the main control module of enlarged image regional area,, improve the resolution of the regional area after amplifying with when the enlarged image regional area.
Technical scheme of the present invention is achieved in that
A kind of method of enlarged image regional area preestablishes local magnification region, comprising:
Encoder is according to local magnification region's positional information of the appointment that receives, cutting out from the image of camera collection with the local magnification region is the coding region that center, resolution equal default code distinguishability, sends to decoder after this coding region is encoded.
Described default code distinguishability is less than the resolution of camera, more than or equal to the resolution of coding output image.
Described camera is the high definition camera,
It is that center, resolution equal further to comprise before the coding region of default code distinguishability that described encoder cuts out from the image of camera collection with the local magnification region: encoder is from the image of camera collection, and cutting out with the local magnification region is the D1 image-region that center, resolution equal the resolution of D1 image;
And it is that the coding region that center, resolution equal default code distinguishability is that described encoder cuts out from the image of camera collection with the local magnification region: cutting out with the local magnification region from described D1 image-region is the coding region that center, resolution equal default code distinguishability.
A kind of encoder of enlarged image regional area, this encoder comprises:
Local magnification region's positional information that main control module, Rcv decoder are sent determines that with this local magnification region be the dsp code zone that center, resolution equal default code distinguishability, and the dsp code zone position information is sent to DSP;
FPGA, the image of reception camera collection outputs to DSP with this image;
DSP, the dsp code zone position information according to main control module is sent cuts out the dsp code zone, to sending to decoder by driver module after this dsp code regional code from the image of FPGA input.
Described main control module comprises:
Local magnification region's positional information that local magnification region's positional information receiver module, Rcv decoder are sent sends to D1 image-region determination module and dsp code zone determination module with local magnification region's positional information;
D1 image-region determination module according to the local magnification region's positional information that receives, determines with this local magnification region to be the D1 image-region that center, resolution equal the resolution of D1 image, and D1 image-region positional information is sent to FPGA;
Dsp code zone determination module, according to the local magnification region's positional information that receives, determine with this local magnification region to be the dsp code zone of the resolution of center, the resolution coded image that equals DSP output, the dsp code zone position information is sent to DSP;
And described FPGA comprises:
The image receiver module, the image of reception camera collection outputs to the cutting module with image;
The cutting module, the D1 image-region positional information according to main control module is sent cuts out the D1 image-region from the image of image receiver module input, this D1 image-region is outputed to DSP.
A kind of main control module, this main control module comprises:
Local magnification region's positional information that local magnification region's positional information receiver module, Rcv decoder are sent sends to dsp code zone determination module with local magnification region's positional information;
Dsp code zone determination module, according to the local magnification region's positional information that receives, determine with this local magnification region to be the dsp code zone of the resolution of center, the resolution coded image that equals DSP output, the dsp code zone position information is sent to DSP.
This main control module further comprises:
D1 image-region determination module, local magnification region's positional information of sending according to local magnification region's positional information receiver module, determine with this local magnification region to be the D1 image-region that center, resolution equal the resolution of D1 image, D1 image-region positional information is sent to FPGA.
Compared with prior art, cutting out with the local magnification region from the image of camera collection among the present invention is the coding region that center, resolution equal default code distinguishability, and this coding region is encoded.The present invention adopts the not camera of band cloud platform, only to being to encode in the subregion at center with the local magnification region, thereby has improved the resolution of the regional area after amplifying in the enlarged image regional area.
In addition, in the embodiment of the invention, set default code distinguishability equal the to encode resolution of output image, avoided in cataloged procedure, sacrificing resolution like this.
In addition, when camera is the high definition camera, in the embodiment of the invention, at first from the image of camera collection, cutting out with the local magnification region is the D1 image-region that center, resolution equal the resolution of D1 image, and then to cut out from the D1 image-region with the local magnification region be the coding region that center, resolution equal default code distinguishability, thereby avoided sacrificing resolution in the process of image being carried out the D1 format conversion.
Embodiment
Core concept of the present invention is: decoder is with local magnification region's location information notification encoder, encoder is only to being that the default coding region at center is encoded with the local magnification region, thereby need not to have improved the resolution of local magnification region under the prerequisite that camera has The Cloud Terrace.Wherein, the resolution of default coding region is less than the resolution of camera, more than or equal to the resolution of coding output image.
The present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
The image to camera collection that Fig. 2 provides for the embodiment of the invention one carries out the flow chart that regional area amplifies, and as shown in Figure 2, its concrete steps are as follows:
Step 201: the user determines the ZoomRect of local magnification region, and with ZoomRect regional location parameter input decoder, decoder is carried at ZoomRect regional location parameter in the control signaling and sends to encoder.
The ZoomRect zone can be passed through this regional upper left corner coordinate, these two regional location parameters of lower right corner coordinate and determine uniquely.For example: the upper left corner coordinate in ZoomRect zone is that (a, b+h), lower right corner coordinate is that (a+w, b), promptly the resolution in ZoomRect zone is: w * h.
The control signaling can be used conversation initialized protocol (SIP, the Session InitiationProtocol) signaling or the self-defining proprietary protocol signaling of expansion.
Step 202: the communication module of encoder receives the control signaling, takes out ZoomRect regional location parameter from the control signaling, ZoomRect regional location parameter is sent to the main control module of encoder.
Step 203: main control module receives ZoomRect regional location parameter, resolution according to the coded image of the DSP of encoder output, determine with the ZoomRect zone to be the dsp code zone ZoomRectCode at center, ZoomRectCode regional location parameter is sent to the DSP of encoder.
ZoomRectCode regional location parameter can be passed through this regional upper left corner coordinate, these two parameters of lower right corner coordinate and determine uniquely.
The schematic diagram in the ZoomRectCode zone that Fig. 3 provides for the embodiment of the invention, as shown in Figure 3, if the resolution in ZoomRectCode zone is H1 * W1, if the upper left corner coordinate in ZoomRect zone is (a, b+h), lower right corner coordinate be (a+w, b), the resolution that is the ZoomRect zone is: w * h is that the upper left corner coordinate in the ZoomRectCode zone at center is with the ZoomRect zone then
Lower right corner coordinate is
Step 204: the FPGA of encoder receives the image of camera input, this image is transferred to the DSP of encoder with the D1 form.
For common camera, because the picture format of its collection is the D1 form, therefore, the image that FPGA directly imports camera is transferred to DSP and gets final product; For the high definition camera, because the picture format of its collection is not the D1 form, therefore, the image transitions that FPGA needs earlier camera to be imported is that the D1 form is transferred to DSP again.
Step 205: the DSP of encoder receives the D1 image of FPGA input, the ZoomRectCode regional location parameter of sending according to main control module, from this image, cut out the ZoomRectCode zone, output to driver module after being encoded in this ZoomRectCode zone.
The D1 image is the image of D1 form.
Step 206: the code stream encapsulation parameter that driver module issues according to main control module, the audio-video code stream that the package images of DSP input is become appointment as: clean culture live stream, multicast live stream or storage flow etc. send to decoder by network interface.
For embodiment illustrated in fig. 2, if camera is common camera, because it is the D1 form that common camera is input to the picture format of FPGA, so FPGA need not image is handled, therefore can not cause the sacrifice of resolution at the FPGA place, simultaneously, at the DSP place, image before the coding be directly from the original D1 image cutting be the ZoomRectCode zone at center with the ZoomRect zone, and when the resolution in ZoomRectCode zone equals the resolution of coded image of DSP output, the resolution of image does not change before and after the coding, like this, do not cause the sacrifice of resolution at the DSP place yet, thereby as can be known: for common camera, the amplification that not only realizes the ZoomRect zone embodiment illustrated in fig. 2, and do not sacrifice resolution.
For embodiment illustrated in fig. 2, if camera is the high definition camera, be not the D1 form because the high definition camera is input to the picture format of FPGA,, therefore can cause the sacrifice of ZoomRect regional resolution at the FPGA place so FPGA is transferred to DSP behind the D1 form; At the DSP place, image before the coding be from the D1 image of FPGA input cutting be the ZoomRectCode zone at center with the ZoomRect zone, and when the resolution in ZoomRectCode zone equals the resolution of coded image of DSP output, the resolution of image does not change before and after the coding, therefore, do not cause the sacrifice of resolution at the DSP place.Thereby as can be known: for the high definition camera, the amplification that also realizes the ZoomRect zone embodiment illustrated in fig. 2, but, only reduced the sacrifice of resolution, but do not reduced the sacrifice of resolution at the FPGA place at the DSP place.
For the high definition camera, for when amplifying the ZoomRect of local magnification region, avoid sacrifice in the resolution at FPGA place, the present invention has provided technical scheme as shown in Figure 4.
The image to the high definition camera collection that Fig. 4 provides for the embodiment of the invention two carries out the flow chart that local magnification region amplifies, and as shown in Figure 4, its concrete steps are as follows:
Step 401: the user determines the ZoomRect of local magnification region, and with ZoomRect regional location parameter input decoder, decoder is carried at ZoomRect regional location parameter in the control signaling and sends to encoder.
Step 402: the communication module of encoder receives the control signaling, takes out ZoomRect regional location parameter from the control signaling, ZoomRect regional location parameter is sent to the main control module of encoder.
Step 401~402 are identical with step 201~202.
Step 403: main control module receives ZoomRect regional location parameter, according to the resolution of D1 image, determines with the ZoomRect zone to be the D1 image-region ZoomRectDl at center, ZoomRectD1 regional location parameter is sent to the FPGA of encoder.
The resolution in ZoomRectD1 zone equals the resolution of D1 image.
The ZoomRectDl zone can the zone upper left corner coordinate, these two regional location parameters of lower right corner coordinate determine uniquely.
If the resolution of D1 image is H2 * W2, the upper left corner coordinate of establishing the ZoomRect zone is for (a, b+h), lower right corner coordinate is that (a+w, b), promptly the resolution in ZoomRect zone is: w * h, then the upper left corner coordinate in ZoomRectDl zone is
Lower right corner coordinate is
Step 404: main control module is according to the resolution of the coded image of the DSP output of encoder, determine with the ZoomRect zone to be the dsp code zone ZoomRectCode at center, the resolution in ZoomRectCode zone equals the resolution of the coded image of DSP output, ZoomRectCode regional location parameter is sent to the DSP of encoder.
Step 404 is identical with step 203.
Step 405:FPGA receives the image of high definition camera input, and the ZoomRectDl regional location parameter according to main control module is sent cuts out the ZoomRectDl zone from this image, the ZoomRectDl zone is transferred to DSP with the D1 form.
Step 406:DSP receives the D1 image of FPGA input, and the ZoomRectCode regional location parameter according to main control module is sent cuts out the ZoomRectCode zone from this image, output to driver module after being encoded in this ZoomRectCode zone.
Step 407: the code stream encapsulation parameter that driver module issues according to main control module, the audio-video code stream that the package images of DsP input is become appointment as: clean culture live stream, multicast live stream or storage flow etc. send to decoder by network interface.
Step 406~407 are identical with step 205~206.
From as can be seen embodiment illustrated in fig. 4, after FPGA receives the image of high definition camera input, cutting out with the ZoomRect of local magnification region from this image is the ZoomRectD1 zone that center, resolution equal the D1 image resolution ratio, this ZoomRectD1 zone is transferred to DSP, as seen, do not cause the resolution sacrifice of local magnification region at the FPGA place, thereby, the amplification that has not only realized the local magnification region of high definition camera collection embodiment illustrated in fig. 4, and do not sacrifice resolution.
Below providing an instantiation compares prior art and method provided by the invention:
Picture format commonly used after the DSP compression has: QCIF (176*144), CIF (352*288), 2CIF (704*288), 4CIF (704*576), D1 (720*576), wherein, in the control point of configuration low side, the image of CIF form is the most common.The resolution of the image of fixing camera collection generally is higher than the resolution behind dsp code far away, and for example: the resolution of the fixing camera of least significant end can reach more than the 752*582.If with the fixing camera of least significant end, the resolution of the original image of its collection is 752*582, the resolution of portion's magnification region of setting a trap is 1/4 of original image resolution, and establishing the dsp code output image is CIF image (352 * 288), then, if adopt existing method, DSP encodes to whole original image, original image resolution behind the coding is 352 * 288, and then the resolution of coding back local magnification region is 176*144; And if adopt method provided by the invention, DSP is only in the original image being to encode in the ZoomRectCode zone at center with the local magnification region, and the resolution of image all is 352*288 before and after the coding, as seen, method provided by the invention is compared with existing method, not only amplify local magnification region, and do not sacrificed resolution.
The composition diagram of the encoder that Fig. 5 provides for the embodiment of the invention, as shown in Figure 5, it mainly comprises: communication module 51, main control module 52, FPGA53, DSP54 and driver module 55, wherein:
Communication module 51: the control signaling that Rcv decoder is sent, from signaling, take out local magnification region's location parameter and send to main control module 52.
Main control module 52: local magnification region's location parameter that received communication module 51 is sent, determine that according to this parameter with the ZoomRect of local magnification region be the dsp code zone ZoomRectCode that center, resolution equal default code distinguishability, ZoomRectCode regional location parameter is sent to DSP54.
Default code distinguishability preferably equals the resolution of the coded image of DSP output less than the resolution of camera, more than or equal to the resolution of the coded image of DSP output.
FPGA53: receive the images acquired of camera input, this image is outputed to DSP54 with the D1 form.
DSP54: receive the ZoomRectCode regional location parameter that main control module 52 is sent, from the D1 image of FPGA53 input, cut out the ZoomRectCode zone, to sending to driver module 55 after this ZoomRectCode regional code.
Driver module 55: the code stream encapsulation parameter that issues according to main control module 52, the audio-video code stream that the coded image of DSP54 input is packaged into appointment as: clean culture live stream, multicast live stream or storage flow etc. send to decoder by network interface.
In actual applications, main control module 52 can comprise: local magnification region's positional information receiver module 521, D1 image-region determination module 522 and dsp code zone determination module 523, wherein:
Local magnification region's positional information receiver module 521: local magnification region's location parameter that received communication module 51 is sent sends to D1 image-region determination module 522 and dsp code zone determination module 523 with local magnification region's location parameter.
D1 image-region determination module 522: local magnification region's location parameter of sending according to local magnification region's positional information receiver module 521, determine with the local magnification region to be the D1 image-region ZoomRectD1 of center, the resolution resolution that equals the D1 image, ZoomRectD1 regional location parameter is sent to FPGA53.
Dsp code zone determination module 523: local magnification region's location parameter of sending according to local magnification region's positional information receiver module 521, determine with the local magnification region to be the dsp code zone of resolution of center, the resolution coded image that equals DSP output, dsp code regional location parameter is sent to DSP54.
And FPGA53 comprises: image receiver module 531 and cutting module 532, wherein:
Image receiver module 531: receive the images acquired of camera input, image is outputed to cutting module 532.
Cutting module 532: the ZoomRectD1 regional location parameter according to main control module 52 is sent, from the image of image receiver module 531 inputs, cut out the ZoomRectD1 zone, this ZoomRectD1 zone is outputed to DSP54.
The above only is process of the present invention and method embodiment, in order to restriction the present invention, all any modifications of being made within the spirit and principles in the present invention, is not equal to replacement, improvement etc., all should be included within protection scope of the present invention.