CN103050110B - Method, device and system for image adjustment - Google Patents
Method, device and system for image adjustment Download PDFInfo
- Publication number
- CN103050110B CN103050110B CN201210592503.3A CN201210592503A CN103050110B CN 103050110 B CN103050110 B CN 103050110B CN 201210592503 A CN201210592503 A CN 201210592503A CN 103050110 B CN103050110 B CN 103050110B
- Authority
- CN
- China
- Prior art keywords
- image
- displayed
- obtains
- target
- map
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Image Processing (AREA)
Abstract
本发明实施例提供了一种图像调整的方法、装置及系统,涉及多媒体技术领域,扩大了对多媒体资源的缩放范围,能够避免当缩放范围较大时而产生多媒体资源失真或扭曲的问题。本发明的实施例包括:获取待显示图像的目标调整值,通过seam carving算法获取待显示图像的冗余信息以及中间图像等,在通过shift map算法对待显示图像进行缩小处理;在图像放大过程中,获取中间图像之后,需先对中间图像进行放大,再使用shift map算法实现对放大后的图像进行缩小处理。本发明主要应用于多媒体资源缩放流程中。
Embodiments of the present invention provide an image adjustment method, device, and system, which relate to the field of multimedia technology, expand the zoom range of multimedia resources, and avoid distortion or distortion of multimedia resources when the zoom range is large. Embodiments of the present invention include: obtaining the target adjustment value of the image to be displayed, obtaining redundant information and intermediate images of the image to be displayed through the seam carving algorithm, and performing shrinkage processing on the image to be displayed through the shift map algorithm; during the process of image enlargement , after obtaining the intermediate image, it is necessary to enlarge the intermediate image first, and then use the shift map algorithm to reduce the enlarged image. The present invention is mainly applied in the multimedia resource scaling process.
Description
技术领域technical field
本发明涉及多媒体技术领域,尤其涉及一种图像调整的方法、装置及系统。The present invention relates to the field of multimedia technology, in particular to an image adjustment method, device and system.
背景技术Background technique
目前,人们使用的多媒体播放设备日益多样化,这就对多媒体播放设备上要显示和播放多媒体资源提出了更高的要求。通常情况下,人们都希望多媒体播放设备能够播放适合其显示部件分辨率的多媒体资源。现有技术中提供了一种通过基于内容感知的适配技术,这项技术可以根据多媒体资源的结构和语义信息对当前显示的多媒体资源的进行缩放,从而实现了对当前显示的多媒体资源的尺寸约束,并能较好地保持了多媒体的视觉效果显著性和内容完整性。At present, the multimedia playing devices used by people are increasingly diversified, which puts forward higher requirements for displaying and playing multimedia resources on the multimedia playing devices. Usually, people hope that a multimedia playback device can play multimedia resources suitable for the resolution of its display component. The existing technology provides a content-aware-based adaptation technology, which can scale the currently displayed multimedia resource according to the structure and semantic information of the multimedia resource, thereby realizing the size adjustment of the currently displayed multimedia resource. Constraints, and can better maintain the visual effect of the multimedia and the integrity of the content.
在实现上述现有技术的过程中,发明人发现现有技术中存在如下问题:现有技术在缩放范围较大时当前显示的多媒体资源会出现显著失真或扭曲。In the process of realizing the above-mentioned prior art, the inventors found the following problems in the prior art: the currently displayed multimedia resource will be significantly distorted or distorted when the zoom range is large in the prior art.
发明内容Contents of the invention
本发明的实施例提供了一种图像调整的方法、装置及系统,扩大了对多媒体资源的缩放范围,能够避免当缩放范围较大时而产生多媒体资源失真或扭曲的问题。Embodiments of the present invention provide a method, device and system for image adjustment, which expand the zoom range of multimedia resources and can avoid distortion or distortion of multimedia resources when the zoom range is large.
为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:
一方面,提供了一种图像调整的方法,包括:In one aspect, a method for image adjustment is provided, including:
获取待显示图像的目标调整值及冗余信息;Obtain the target adjustment value and redundant information of the image to be displayed;
根据所述冗余信息,确定所述待显示图像的第一缝隙;determining a first gap of the image to be displayed according to the redundant information;
将确定的第一缝隙的数量与所述待显示图像的目标调整值进行比较;comparing the determined quantity of the first gap with the target adjustment value of the image to be displayed;
当确定所述第一缝隙的数量小于所述目标调整值时,从待显示图像中删除第一缝隙,得到中间图像;When it is determined that the number of the first gaps is smaller than the target adjustment value, deleting the first gaps from the image to be displayed to obtain an intermediate image;
对所述中间图像进行缩小处理,得到与所述待显示图像对应的目标图像。Perform shrinkage processing on the intermediate image to obtain a target image corresponding to the image to be displayed.
在第一方面的第一种可能实现方式中,所述获取待处理图像的冗余信息包括:In a first possible implementation manner of the first aspect, the acquiring redundant information of the image to be processed includes:
根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图;performing calculations according to the image information of the image to be displayed to obtain a gradient map of the image to be displayed;
根据计算得到的所述梯度图,获取待显示图像的冗余信息。Obtain redundant information of the image to be displayed according to the calculated gradient map.
结合第一方面的第一种可能实现方式,在第一方面的第二种可能实现方式中,所述从待显示图像中删除第一缝隙,得到中间图像包括:With reference to the first possible implementation of the first aspect, in the second possible implementation of the first aspect, the deleting the first gap from the image to be displayed to obtain the intermediate image includes:
获取所述待显示图像的前向能量标准;Acquiring the forward energy standard of the image to be displayed;
根据所述前向能量标准和所述梯度图进行计算,得到所述待显示图像对应的缝隙图;performing calculations according to the forward energy standard and the gradient map to obtain a gap map corresponding to the image to be displayed;
从缝隙图中删除所述第一缝隙。The first seam is deleted from the seam map.
在第一方面的第三种可能的实现方式中,所述对所述中间图像进行缩小处理,得到与所述待显示图像对应的目标图像包括:In a third possible implementation manner of the first aspect, the stepping down the intermediate image to obtain the target image corresponding to the image to be displayed includes:
根据所述中间图像进行计算,得到与所述中间图像对应的显著图;performing calculations based on the intermediate image to obtain a saliency map corresponding to the intermediate image;
对所述显著图进行滤波,得到与所述显著图对应的重要图;filtering the saliency map to obtain an important map corresponding to the saliency map;
根据所述重要图进行计算,得到与所述重要图对应的像素位移梯度图;performing calculations according to the importance map to obtain a pixel displacement gradient map corresponding to the importance map;
根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。Perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
结合第一方面的第三种可能实现方式,在地衣方面的第四种可能实现方式中,在得到与所述显著图对应的重要图之后,包括:In combination with the third possible implementation of the first aspect, in the fourth possible implementation of the lichen aspect, after obtaining the significance map corresponding to the saliency map, it includes:
对所述重要图进行滤波,得到滤波图。The important map is filtered to obtain a filtered map.
结合第一方面、第一方面的第一种可能实现方式、第一方面的第二种可能实现方式、第一方面的第三种可能实现方式、第一方面的第四种可能实现方式,在第一方面的第五种可能实现方式中,在获取待显示图像的目标调整值及冗余信息之前,还包括:In combination with the first aspect, the first possible implementation of the first aspect, the second possible implementation of the first aspect, the third possible implementation of the first aspect, and the fourth possible implementation of the first aspect, in In the fifth possible implementation manner of the first aspect, before acquiring the target adjustment value and redundant information of the image to be displayed, it further includes:
当对待显示视频进行图像调整时,将所述待显示视频按帧转化为若干个待显示图像;When image adjustment is performed on the video to be displayed, the video to be displayed is converted into several images to be displayed by frame;
则获取待显示图像的目标调整值及冗余信息包括:Obtaining the target adjustment value and redundant information of the image to be displayed includes:
获取所述若干个待显示图像各自对应的目标调整值及冗余信息。The target adjustment values and redundant information corresponding to each of the plurality of images to be displayed are acquired.
结合第一方面的第五种可能实现方式,在第一方面的第六种可能实现方式中,在对所述中间图像进行缩小处理,得到与所述待显示图像对应的目标图像之后,还包括:With reference to the fifth possible implementation of the first aspect, in the sixth possible implementation of the first aspect, after shrinking the intermediate image to obtain a target image corresponding to the image to be displayed, further include :
对所述若干个待显示图像各自对应的目标图像进行合并处理,得到与所述待显示视频对应的目标视频。Combining target images corresponding to each of the plurality of images to be displayed to obtain a target video corresponding to the video to be displayed.
第二方面,提供了一种图像调整的方法,包括:In the second aspect, a method for image adjustment is provided, including:
获取待显示图像的目标调整值及冗余信息;Obtain the target adjustment value and redundant information of the image to be displayed;
根据所述冗余信息,确定所述待显示图像的第一缝隙;determining a first gap of the image to be displayed according to the redundant information;
从待显示图像中删除第一缝隙,得到第一处理图像;Deleting the first gap from the image to be displayed to obtain a first processed image;
根据所述目标调整值,对所述第一处理图像进行放大,得到第二处理图像;Enlarging the first processed image according to the target adjustment value to obtain a second processed image;
对所述第二处理图像进行缩小处理,获得目标图像。performing shrinking processing on the second processed image to obtain a target image.
在第二方面的第一种可能实现方式中,所述获取待处理图像的冗余信息包括:In a first possible implementation manner of the second aspect, the acquiring redundant information of the image to be processed includes:
根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图;performing calculations according to the image information of the image to be displayed to obtain a gradient map of the image to be displayed;
根据计算得到的所述梯度图,获取待处理图像的冗余信息。Obtain redundant information of the image to be processed according to the calculated gradient map.
结合第二方面的第一种可能实现方式,在第二方面的第二种可能实现方式中,所述从待显示图像中删除第一缝隙,得到第一处理图像包括:With reference to the first possible implementation of the second aspect, in the second possible implementation of the second aspect, the deleting the first gap from the image to be displayed to obtain the first processed image includes:
获取所述待显示图像的前向能量标准;Acquiring the forward energy standard of the image to be displayed;
根据所述前向能量标准和所述梯度图进行计算,得到所述待显示图像对应的缝隙图;performing calculations according to the forward energy standard and the gradient map to obtain a gap map corresponding to the image to be displayed;
从所述缝隙图中删除所述最优缝隙。The optimal seam is deleted from the seam map.
在第二方面的第三种可能实现方式中,所述对所述第二处理图像进行缩小处理,获得目标图像包括:In a third possible implementation manner of the second aspect, performing shrinking processing on the second processed image to obtain a target image includes:
根据所述第二处理图像进行计算,得到与所述第二处理图像对应的显著图;performing calculations based on the second processed image to obtain a saliency map corresponding to the second processed image;
对所述显著图进行滤波,得到与所述显著图对应的重要图;filtering the saliency map to obtain an important map corresponding to the saliency map;
根据所述重要图进行计算,得到像素位移梯度图;performing calculations according to the importance map to obtain a pixel displacement gradient map;
根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。Perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
结合第二方面的第三种可能实现方式,在第二方面的第四种可能实现方式中,在得到与所述显著图对应的重要图之后,包括:In combination with the third possible implementation of the second aspect, in the fourth possible implementation of the second aspect, after obtaining the significance map corresponding to the saliency map, the method includes:
对所述重要图进行滤波,得到滤波图。The important map is filtered to obtain a filtered map.
结合第二方面、第二方面的第一种可能实现方式、第二方面的第二种可能实现方式、第二方面的第三种可能实现方式、第二方面的第四种可能实现方式,在第二方面的第五种可能实现方式中,在获取待显示图像的目标调整值及冗余信息之前,还包括:In combination with the second aspect, the first possible implementation of the second aspect, the second possible implementation of the second aspect, the third possible implementation of the second aspect, and the fourth possible implementation of the second aspect, in In the fifth possible implementation manner of the second aspect, before acquiring the target adjustment value and redundant information of the image to be displayed, it further includes:
当对待显示视频进行调整时,将所述待显示视频按帧转化为若干个待显示图像;When adjusting the video to be displayed, converting the video to be displayed into several images to be displayed frame by frame;
则获取待显示图像的目标调整值及冗余信息包括:Obtaining the target adjustment value and redundant information of the image to be displayed includes:
获取所述若干个待显示图像各自对应的目标调整值及冗余信息。The target adjustment values and redundant information corresponding to each of the plurality of images to be displayed are acquired.
结合第二方面的第五种可能实现方式,在第二方面的第六种可能实现方式中,在对所述第二处理图像进行缩小处理,获得目标图像之后,还包括:With reference to the fifth possible implementation of the second aspect, in the sixth possible implementation of the second aspect, after shrinking the second processed image to obtain the target image, further include:
对所述若干个待显示图像各自对应的目标图像进行合并处理,得到与所述待显示视频对应的目标视频。Combining target images corresponding to each of the plurality of images to be displayed to obtain a target video corresponding to the video to be displayed.
第三方面,提供了一种图像调整的装置,包括:In a third aspect, an image adjustment device is provided, including:
获取单元,用于获取待显示图像的目标调整值及冗余信息;an acquisition unit, configured to acquire a target adjustment value and redundant information of the image to be displayed;
确定单元,用于根据所述获取单元获取的所述冗余信息,确定所述待显示图像的第一缝隙;a determining unit, configured to determine the first gap of the image to be displayed according to the redundant information acquired by the acquiring unit;
比较单元,用于将所述确定单元确定的第一缝隙的数量与所述待显示图像的目标调整值进行比较;a comparing unit, configured to compare the quantity of the first gap determined by the determining unit with the target adjustment value of the image to be displayed;
删除单元,用于根据所述比较单元的比较结果,确定当所述第一缝隙的数量小于所述目标调整值时,从待显示图像中删除第一缝隙,得到中间图像;A deleting unit, configured to, according to the comparison result of the comparing unit, determine that when the number of the first gaps is less than the target adjustment value, delete the first gaps from the image to be displayed to obtain an intermediate image;
处理单元,用于对所述删除单元得到的所述中间图像进行缩小处理,得到与所述待显示图像对应的目标图像。A processing unit, configured to perform reduction processing on the intermediate image obtained by the deleting unit to obtain a target image corresponding to the image to be displayed.
在第三方面的第一种可能实现方式中,所述获取单元包括:In a first possible implementation manner of the third aspect, the obtaining unit includes:
第一计算模块,用于根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图;The first calculation module is used to perform calculation according to the image information of the image to be displayed to obtain the gradient map of the image to be displayed;
第一获取模块,用于根据所述第一计算模块得到的所述梯度图,获取待显示图像的冗余信息。The first obtaining module is configured to obtain redundant information of the image to be displayed according to the gradient map obtained by the first calculating module.
结合第三方面的第一种可能实现方式,在第三方面的第二种可能实现方式中,所述删除单元包括:With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the deleting unit includes:
第二获取模块,用于获取所述待显示图像的前向能量标准;A second acquisition module, configured to acquire the forward energy standard of the image to be displayed;
第二计算模块,用于根据所述第二获取模块获取到的所述前向能量标准和所述第一计算模块得到的所述梯度图进行计算,得到所述待显示图像对应的缝隙图;A second calculation module, configured to perform calculations according to the forward energy standard acquired by the second acquisition module and the gradient map obtained by the first calculation module, to obtain a gap map corresponding to the image to be displayed;
删除模块,用于从所述第二计算模块得到的所述缝隙图中删除第一缝隙。A deletion module, configured to delete the first gap from the gap map obtained by the second calculation module.
在第三方面的第三种可能实现方式中,所述处理单元包括:In a third possible implementation manner of the third aspect, the processing unit includes:
第三计算模块,用于根据所述中间图像进行计算,得到与所述中间图像对应的显著图;A third calculation module, configured to perform calculations based on the intermediate image to obtain a saliency map corresponding to the intermediate image;
滤波模块,用于对所述第三计算模块得到的所述显著图进行滤波,得到与所述显著图对应的重要图;a filtering module, configured to filter the saliency map obtained by the third calculation module, to obtain an important map corresponding to the saliency map;
第四计算模块,用于根据所述滤波模块得到的所述重要图进行计算,得到与所述重要图对应的像素位移梯度图;A fourth calculation module, configured to perform calculations according to the importance map obtained by the filtering module, to obtain a pixel displacement gradient map corresponding to the importance map;
第五计算模块,用于根据所述第四计算模块得到的所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。A fifth calculation module, configured to perform calculation according to the pixel displacement gradient map obtained by the fourth calculation module, to obtain a target image corresponding to the image to be displayed.
结合第三方面的第三种可能实现方式,在第三方面的第四种可能实现方式中,所述滤波模块还用于对所述重要图进行滤波,得到滤波图。With reference to the third possible implementation manner of the third aspect, in a fourth possible implementation manner of the third aspect, the filtering module is further configured to filter the importance map to obtain a filtered map.
结合第三方面、第三方面的第一种可能实现方式、第三方面的第二种可能实现方式、第三方面的第三种可能实现方式、第三方面的第四种可能实现方式,在第三方面的第五种可能实现方式中,还包括:In combination with the third aspect, the first possible realization of the third aspect, the second possible realization of the third aspect, the third possible realization of the third aspect, and the fourth possible realization of the third aspect, in In the fifth possible implementation manner of the third aspect, it also includes:
转化单元,用于当对待显示视频进行图像调整时,将所述待显示视频按帧转化为若干个待显示图像;A conversion unit, configured to convert the video to be displayed into several images to be displayed frame by frame when performing image adjustment on the video to be displayed;
所述获取单元,还用于获取所述转化单元得到的所述若干个待显示图像各自对应的目标调整值及冗余信息。The acquiring unit is further configured to acquire target adjustment values and redundant information corresponding to each of the plurality of images to be displayed obtained by the converting unit.
结合第三方面的第五种可能实现方式,在第三方面的第六种可能实现方式中,还包括:In combination with the fifth possible implementation of the third aspect, the sixth possible implementation of the third aspect also includes:
合并单元,用于对所述若干个待显示图像各自对应的目标图像进行合并处理,得到与所述待显示视频对应的目标视频。The merging unit is configured to merge the target images corresponding to the plurality of images to be displayed to obtain the target video corresponding to the video to be displayed.
第四方面,提供了一种图像调整的装置,包括:In a fourth aspect, an image adjustment device is provided, including:
获取单元,用于获取待显示图像的目标调整值及冗余信息;an acquisition unit, configured to acquire a target adjustment value and redundant information of the image to be displayed;
确定单元,用于根据所述获取单元获取到的冗余信息,确定所述待显示图像的第一缝隙;a determining unit, configured to determine the first gap of the image to be displayed according to the redundant information acquired by the acquiring unit;
删除单元,用于从待显示图像中删除所述跌确定单元确定的第一缝隙,得到第一处理图像;A deleting unit, configured to delete the first gap determined by the slit determining unit from the image to be displayed, to obtain a first processed image;
第一处理单元,用于根据所述目标调整值,对所述第一处理图像进行放大,得到第二处理图像;a first processing unit, configured to amplify the first processed image according to the target adjustment value to obtain a second processed image;
第二处理单元,用于对所述第一处理单元得到的第二处理图像进行缩小处理,获得目标图像。The second processing unit is configured to perform reduction processing on the second processed image obtained by the first processing unit to obtain a target image.
在第四方面的第一种可能实现方式中,所述获取单元包括:In a first possible implementation manner of the fourth aspect, the obtaining unit includes:
第一计算模块,用于根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图;The first calculation module is used to perform calculation according to the image information of the image to be displayed to obtain the gradient map of the image to be displayed;
第一获取模块,用于根据所述第一计算模块计算得到的所述梯度图,获取待处理图像的冗余信息。The first acquiring module is configured to acquire redundant information of the image to be processed according to the gradient map calculated by the first calculating module.
结合第四方面的第一种可能实现方式,在第四方面的第二种可能实现方式中,所述删除单元包括:With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the deleting unit includes:
第二获取模块,用于获取所述待显示图像的前向能量标准;A second acquisition module, configured to acquire the forward energy standard of the image to be displayed;
第二计算模块,用于根据所述第二获取模块获取的所述前向能量标准和所述第一计算模块得到的所述梯度图进行计算,得到所述待显示图像对应的缝隙图;A second calculation module, configured to perform calculations according to the forward energy standard acquired by the second acquisition module and the gradient map obtained by the first calculation module, to obtain a gap map corresponding to the image to be displayed;
删除模块,用于从所述第二计算模块得到的缝隙图中删除所述最优缝隙。A deletion module, configured to delete the optimal gap from the gap map obtained by the second calculation module.
在第四方面的第三种可能实现方式中,所述第二处理单元包括:In a third possible implementation manner of the fourth aspect, the second processing unit includes:
第三计算模块,用于根据所述第一处理单元得到的所述第二处理图像进行计算,得到与所述第二处理图像对应的显著图;A third calculation module, configured to perform calculations based on the second processed image obtained by the first processing unit, to obtain a saliency map corresponding to the second processed image;
滤波模块,用于对所述第三计算模块得到的所述显著图进行滤波,得到与所述显著图对应的重要图;a filtering module, configured to filter the saliency map obtained by the third calculation module, to obtain an important map corresponding to the saliency map;
第四计算模块,用于根据所述重要图进行计算,得到像素位移梯度图;A fourth calculation module, configured to perform calculations according to the importance map to obtain a pixel displacement gradient map;
第五计算模块,用于根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。The fifth calculation module is configured to perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
结合第四方面的第四种可能实现方式中,所述滤波模块还用于对所述重要图进行滤波,得到滤波图。In a fourth possible implementation manner with reference to the fourth aspect, the filtering module is further configured to filter the importance map to obtain a filtered map.
结合第四方面、第四方面的第一种可能实现方式、第四方面的第二种可能实现方式、第四方面的第三种可能实现方式、第四方面的第四种可能实现方式,在第四方面的第五种可能实现方式中,还包括:In combination with the fourth aspect, the first possible realization of the fourth aspect, the second possible realization of the fourth aspect, the third possible realization of the fourth aspect, and the fourth possible realization of the fourth aspect, in In the fifth possible implementation manner of the fourth aspect, it also includes:
转化单元,用于当对待显示视频进行图像调整时,将所述待显示视频按帧转化为若干个待显示图像;A conversion unit, configured to convert the video to be displayed into several images to be displayed frame by frame when performing image adjustment on the video to be displayed;
所述获取单元,还用于获取所述转化单元得到的所述若干个待显示图像各自对应的目标调整值及冗余信息。The acquiring unit is further configured to acquire target adjustment values and redundant information corresponding to each of the plurality of images to be displayed obtained by the conversion unit.
结合第四方面的第五中可能实现方式,在第五方面的第六种可能实现方式中,还包括:In combination with the fifth possible implementation of the fourth aspect, the sixth possible implementation of the fifth aspect also includes:
合并单元,用于对所述若干个待显示图像各自对应的目标图像进行合并处理,得到与所述待显示视频对应的目标视频。The merging unit is configured to merge the target images corresponding to the plurality of images to be displayed to obtain the target video corresponding to the video to be displayed.
第五方面,提供了一种图像调整的系统,包括上述第三方面提供的图像调整的装置以及上述第四方面提供的图像调整的装置。A fifth aspect provides an image adjustment system, including the image adjustment device provided in the third aspect and the image adjustment device provided in the fourth aspect.
本发明实施例提供的图像调整的方法、装置及系统,实现了对待显示图像的缩放,获取待显示图像的目标调整值,通过seam carving算法获取待显示图像的冗余信息以及中间图像等,在通过shift map算法对待显示图像进行缩小处理;在图像放大过程中,获取中间图像之后,需先对中间图像进行放大,再使用shift map算法实现对放大后的图像进行缩小处理。现有技术使用单一的算法实现图像调整,当调整范围较大时,会出现图像的失真或扭曲。而本发明是实施例的技术方案,扩大了对多媒体资源的调整范围,能够避免当缩放范围较大时而产生多媒体资源失真或扭曲的问题。The image adjustment method, device, and system provided by the embodiments of the present invention realize the zooming of the image to be displayed, obtain the target adjustment value of the image to be displayed, and obtain redundant information and intermediate images of the image to be displayed through the seam carving algorithm. The image to be displayed is reduced through the shift map algorithm; in the image enlargement process, after the intermediate image is obtained, the intermediate image needs to be enlarged first, and then the enlarged image is reduced using the shift map algorithm. The existing technology uses a single algorithm to realize image adjustment, and when the adjustment range is large, image distortion or distortion may occur. However, the present invention is a technical solution of an embodiment, which expands the adjustment range of multimedia resources and can avoid distortion or distortion of multimedia resources when the zoom range is large.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例1中的一种图像调整方法的流程图;FIG. 1 is a flowchart of an image adjustment method in Embodiment 1 of the present invention;
图2为本发明实施例1中的另一种图像调整方法的流程图;FIG. 2 is a flowchart of another image adjustment method in Embodiment 1 of the present invention;
图3为本发明实施例2中的一种图像调整方法的流程图;FIG. 3 is a flow chart of an image adjustment method in Embodiment 2 of the present invention;
图4为本发明实施例2中的另一种图像调整方法的流程图;FIG. 4 is a flow chart of another image adjustment method in Embodiment 2 of the present invention;
图5为本发明实施例2中的另一种图像调整方法的流程图;FIG. 5 is a flow chart of another image adjustment method in Embodiment 2 of the present invention;
图6为本发明实施例3中的一种图像调整方法的流程图;FIG. 6 is a flow chart of an image adjustment method in Embodiment 3 of the present invention;
图7为本发明实施例4中的一种图像调整装置的组成框图;FIG. 7 is a block diagram of an image adjustment device in Embodiment 4 of the present invention;
图8为本发明实施例4中的另一种图像调整装置的组成框图;FIG. 8 is a block diagram of another image adjustment device in Embodiment 4 of the present invention;
图9为本发明实施例4中的另一种图像调整装置的组成框图;FIG. 9 is a block diagram of another image adjustment device in Embodiment 4 of the present invention;
图10为本发明实施例4中的另一种图像调整装置的组成框图;FIG. 10 is a block diagram of another image adjustment device in Embodiment 4 of the present invention;
图11为本发明实施例4中的一种图像调整系统的组成框图;FIG. 11 is a block diagram of an image adjustment system in Embodiment 4 of the present invention;
图12为本发明实施例5中的一种图像调整装置的组成框图;FIG. 12 is a block diagram of an image adjustment device in Embodiment 5 of the present invention;
图13为本发明实施例5中的另一种图像调整装置的组成框图。Fig. 13 is a block diagram of another image adjustment device in Embodiment 5 of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
实施例1Example 1
本发明实施例提供了一种图像调整的方法,该方法可用于图像的缩小,如图1所示,该图像缩小的方法包括:An embodiment of the present invention provides a method for image adjustment, which can be used for image reduction. As shown in FIG. 1, the image reduction method includes:
101、获取图像的目标调整值及冗余信息。101. Acquire a target adjustment value and redundant information of an image.
其中,目标调整值指待显示图像的目标缩小值。Wherein, the target adjustment value refers to a target reduction value of the image to be displayed.
其中,该步骤中的冗余信息指图像的黑边或白边以及其它不重要的信息等。所述不重要的信息是指对图像的显示不起显著作用,并且被去除后不会造成图像失真或扭曲的信息。这些不重要的信息可以通过像素点、像素条或者像素块等形式体现。Wherein, the redundant information in this step refers to the black border or white border of the image and other unimportant information. The unimportant information refers to information that has no significant effect on image display and will not cause image distortion or distortion after being removed. These unimportant information may be embodied in the form of pixels, pixel strips, or pixel blocks.
102、根据所述冗余信息,确定所述待显示图像的第一缝隙。102. Determine a first gap of the image to be displayed according to the redundant information.
其中,第一缝隙为待显示图像的非显著信息,是需要通过seam carving算法进行删除的缝隙集合。Among them, the first gap is the non-salient information of the image to be displayed, which is a set of gaps that need to be deleted by the seam carving algorithm.
值得说明的是,seam carving是本实施例中一种优选的基于内容感知的适配技术,该算法的核心是要找到需要移除或者插入的seam(缝隙),即为从左到右或从上到下的一条连通的具有最低累计能量的像素。It is worth noting that seam carving is a preferred content-aware adaptation technology in this embodiment. The core of the algorithm is to find the seam (gap) that needs to be removed or inserted, that is, from left to right or from left to right A connected top-to-bottom pixel with the lowest cumulative energy.
可选的是,seam carving算法通过相应的公式计算原始图像梯度图,进而通过梯度图来判断图像的冗余信息,从而获取通过进行删除的缝隙的数量。比如,通过seam carving算法分析梯度图,得到具有最低累计能量的若干个像素,从而获得进行删除的缝隙的数量。Optionally, the seam carving algorithm calculates the gradient map of the original image through a corresponding formula, and then judges the redundant information of the image through the gradient map, so as to obtain the number of seams to be deleted. For example, the gradient map is analyzed by the seam carving algorithm to obtain several pixels with the lowest cumulative energy, so as to obtain the number of seams to be deleted.
103、将确定的第一缝隙的数量与所述待显示图像的目标调整值进行比较。103. Compare the determined quantity of the first gap with the target adjustment value of the image to be displayed.
值得说明的是,该步骤中提到的比较是缝隙数量与目标调整值之间的数值大小的比较。It should be noted that the comparison mentioned in this step is a numerical comparison between the number of gaps and the target adjustment value.
104、当确定所述第一缝隙的数量小于所述目标调整值时,从待显示图像中删除第一缝隙,得到中间图像。104. When it is determined that the number of the first gaps is smaller than the target adjustment value, delete the first gaps from the image to be displayed to obtain an intermediate image.
在本实施例中,中间图像是可以由待显示图像通过seam carving算法中提供的方法删除所述第一缝隙。In this embodiment, the intermediate image can delete the first gap from the image to be displayed through the method provided in the seam carving algorithm.
进一步地,即当第一缝隙的数量小于目标调整值时,采用动态规划的方法,选取最优缝隙,并从待显示图像中依次删除这些第一缝隙,从而得到中间图像,值得说明的是,该方法是通过seam carving实现的。Furthermore, when the number of the first gaps is less than the target adjustment value, the dynamic programming method is used to select the optimal gaps, and delete these first gaps from the image to be displayed in order to obtain the intermediate image. It is worth noting that, This method is realized by seam carving.
105、对所述中间图像进行缩小处理,得到与所述待显示图像对应的目标图像。105. Perform shrinkage processing on the intermediate image to obtain a target image corresponding to the image to be displayed.
值得说明的是,在本实施例中,该步骤可以通过执行shift map算法实现对中间图像的缩小处理。其中,shift map算法是本实施例中的一种优选的基于内容感知的适配技术,该算法的核心是要找到需要移除或者插入的seam。It is worth noting that, in this embodiment, this step can realize the reduction processing of the intermediate image by executing the shift map algorithm. Among them, the shift map algorithm is a preferred adaptation technology based on content awareness in this embodiment, and the core of the algorithm is to find the seam that needs to be removed or inserted.
本发明实施例提供的图像调整的方法,还可以用于图像的放大,如图2所示,该图像放大的方法包括:The image adjustment method provided by the embodiment of the present invention can also be used for image enlargement, as shown in Figure 2, the image enlargement method includes:
1、获取待显示图像的目标调整值及冗余信息。1. Obtain the target adjustment value and redundant information of the image to be displayed.
其中,目标调整值是指待显示图像的目标放大值。Wherein, the target adjustment value refers to a target magnification value of the image to be displayed.
值得说明的是,冗余信息的描述与步骤102中的相关描述相同,在此不再详细说明。It is worth noting that the description of the redundant information is the same as that in step 102, and will not be described in detail here.
2、根据所述冗余信息,确定所述待显示图像的第一缝隙。2. Determine the first gap of the image to be displayed according to the redundant information.
值得说明的是,该步骤与上述步骤102对应,相关描述相同,在此不再详细说明。It should be noted that this step corresponds to the above-mentioned step 102, and the related description is the same, and will not be described in detail here.
3、从待显示图像中删除第一缝隙,得到第一处理图像。3. Deleting the first gap from the image to be displayed to obtain a first processed image.
其中,第一图像即步骤104中描述的中间图像,即第一处理图像是可以由待显示图像通过seam carving算法中提供的方法删除所述第一缝隙。Wherein, the first image is the intermediate image described in step 104, that is, the first processed image can delete the first gap from the image to be displayed through the method provided in the seam carving algorithm.
进一步地,采用动态规划的方法,选取最优缝隙,并从待显示图像中依次删除这些第一缝隙,从而得到第一处理图像,值得说明的是,该方法是通过seamcarving实现的。Furthermore, the dynamic programming method is used to select the optimal seam, and delete these first seams in sequence from the image to be displayed, so as to obtain the first processed image. It is worth noting that this method is realized through seamcarving.
4、根据所述目标调整值,对所述第一处理图像进行放大,得到第二处理图像。4. Enlarge the first processed image according to the target adjustment value to obtain a second processed image.
优选的是,通过使用最近邻域方法对第一处理图像放大1.1倍,从而得到一个像素为(w+cw)*1.1的第二处理图像。其中,w值为待显示图像的像素,cw指待显示图像的目标放大值。Preferably, the first processed image is enlarged by 1.1 times by using the nearest neighbor method, so as to obtain a second processed image with a pixel size of (w+cw)*1.1. Wherein, w is the pixel of the image to be displayed, and cw refers to the target magnification value of the image to be displayed.
值得说明的是,最近邻域方法是将第一处理图像的某个坐标通过计算得到一个浮点坐标,对其进行简单的取整处理就得到一个对应原第一处理图像的整数坐标了,即得到第二处理图像坐标的像素值。对其余坐标的操作流程类似。本实施例以取浮点坐标最邻近的左上角对应的像素值为例,上述只是最近邻域的一种实现方法,本发明实施例对此不进行限制。It is worth noting that the nearest neighbor method calculates a certain coordinate of the first processed image to obtain a floating-point coordinate, and performs a simple rounding process on it to obtain an integer coordinate corresponding to the original first processed image, namely Get the pixel value of the second processed image coordinate. The operation process for other coordinates is similar. In this embodiment, taking the pixel value corresponding to the upper left corner closest to the floating point coordinates as an example, the above is only an implementation method of the nearest neighbor, which is not limited in the embodiment of the present invention.
此外,选择放大1.1倍可以降低运算的复杂度,同时又不会影响待显示图像的完整性。In addition, choosing to enlarge by 1.1 times can reduce the complexity of the calculation without affecting the integrity of the image to be displayed.
5、对所述第二处理图像进行缩小处理,获得目标图像。5. Perform reduction processing on the second processed image to obtain a target image.
其中,对第二处理图像进行缩小处理,其缩小倍数与步骤4中的图像放大的倍数是相关的。例如,对于步骤4中,对第一处理图像放大1.1倍,对应的此时应该将第一处理图像缩小(w+cw)*0.1,该缩小方法由shift map算法实现。对于shift map算法的相关描述与上述步骤105中的描述相同,在此不再详细说明。Wherein, the reduction processing is performed on the second processed image, and the reduction factor is related to the image enlargement factor in step 4. For example, in step 4, the first processed image is magnified by 1.1 times, correspondingly the first processed image should be reduced by (w+cw)*0.1 at this time, and the reduction method is realized by the shift map algorithm. The relevant description of the shift map algorithm is the same as the description in the above step 105, and will not be described in detail here.
本发明实施例提供的图像调整的方法,实现了对待显示图像的缩放,获取待显示图像的目标调整值,通过seam carving算法获取待显示图像的冗余信息以及中间图像等,在通过shift map算法对待显示图像进行缩小处理;在图像放大过程中,获取中间图像之后,需先对中间图像进行放大,使用shift map算法。现有技术使用单一的算法实现图像调整,当调整范围较大时,会出现图像的失真或扭曲。而本发明是实施例的技术方案,扩大了对多媒体资源的调整范围,能够避免当缩放范围较大时而产生多媒体资源失真或扭曲的问题。The image adjustment method provided by the embodiment of the present invention realizes the scaling of the image to be displayed, obtains the target adjustment value of the image to be displayed, obtains redundant information and intermediate images of the image to be displayed through the seam carving algorithm, and then uses the shift map algorithm The image to be displayed is reduced; in the process of image enlargement, after the intermediate image is obtained, the intermediate image needs to be enlarged first, using the shift map algorithm. The existing technology uses a single algorithm to realize image adjustment, and when the adjustment range is large, image distortion or distortion may occur. However, the present invention is a technical solution of an embodiment, which expands the adjustment range of multimedia resources and can avoid distortion or distortion of multimedia resources when the zoom range is large.
实施例2Example 2
本发明提供了一种图像调整的方法,本实施例为缩小图片的方法,如图3所示,该方法包括:The present invention provides a method for image adjustment. This embodiment is a method for shrinking a picture. As shown in FIG. 3 , the method includes:
201、获取待显示图像的目标调整值,所述目标调整值为待显示图像的目标缩小值。201. Acquire a target adjustment value of an image to be displayed, where the target adjustment value is a target reduction value of the image to be displayed.
其中,目标调整值指的是待显示图片的目标缩小值,即待显示图像针对当前的多媒体播放设备,在原有尺寸的基础上,需要进行缩小的值。该目标调整值可以是根据当前多媒体播放设备对待显示图像的尺寸约束,待显示图像需要满足该多媒体播放设备的调整值;还可以是用户为待显示图像自定义的调整值。Wherein, the target adjustment value refers to a target reduction value of the image to be displayed, that is, a value that needs to be reduced on the basis of the original size of the image to be displayed for the current multimedia playback device. The target adjustment value may be an adjustment value that the image to be displayed needs to satisfy the size constraint of the image to be displayed on the current multimedia playback device; it may also be an adjustment value customized by the user for the image to be displayed.
202、根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图。其中,对于梯度图的计算可以使用公式:例如对于图像I,其梯度图的计算方法、为该计算式中,I表示图像,表示垂直方向梯度,表示水平方向梯度。202. Perform calculation according to the image information of the image to be displayed to obtain a gradient map of the image to be displayed. Wherein, formula can be used for the calculation of gradient map: for example, for image I, the calculation method of its gradient map, is In this calculation formula, I represents an image, Indicates the vertical gradient, Indicates the gradient in the horizontal direction.
203、根据计算得到的所述梯度图,获取待显示图像的冗余信息。203. Acquire redundant information of an image to be displayed according to the calculated gradient map.
其中,冗余信息的相关描述与实施例1步骤101中的描述相同,在此不再重复说明。Wherein, the relevant description of the redundant information is the same as the description in step 101 of Embodiment 1, and will not be repeated here.
进一步地,获取冗余信息,包括判断图像是否存在黑边或白边以及获取其余非显著信息。Further, obtaining redundant information includes judging whether the image has black borders or white borders and obtaining other non-salient information.
204、根据所述冗余信息,确定所述待显示图像的第一缝隙。204. Determine a first gap of the image to be displayed according to the redundant information.
205、将确定的第一缝隙的数量与所述待显示图像的目标调整值进行比较。205. Compare the determined quantity of the first gap with the target adjustment value of the image to be displayed.
206、当确定所述第一缝隙的数量小于所述目标调整值时,获取所述待显示图像的前向能量标准。206. Acquire a forward energy standard of the image to be displayed when it is determined that the number of the first gaps is smaller than the target adjustment value.
其中,前向能量标准即为seam carving算法中决定哪条缝隙会被移除的标准。当缝隙被移除后原来不相连的像素可能就会变成邻居,形成新的边缘,这时便会产生嵌入式的能量。假设一图像通过移除k条缝隙(t=1,...,k)来调整原图的尺寸。为了衡量每次移除一条缝隙后图像能量的真实变化,通过测量移除缝隙后图像的能量与先前图像中没有被移除的部分的能量(即图像能量减去缝隙能量)之间的差异。差异小代表移除该缝隙后对图像造成的影响小。Among them, the forward energy standard is the standard for determining which seam will be removed in the seam carving algorithm. Embedded energy is generated when previously disconnected pixels may become neighbors after the gaps are removed, forming new edges. Suppose an image is resized by removing k gaps (t=1, . . . , k). To measure the true change in image energy each time a seam is removed, we measure the difference between the energy of the image after seam removal and the energy of the part of the previous image that was not removed (i.e., image energy minus seam energy). A small difference means that removing the gap will have little effect on the image.
值得说明的是,当所述第一缝隙数量大于所述目标调整值时,即目标调整值seam carving算法的可直接处理,属于较小调整范围,在此不再详细说明。It is worth noting that when the first seam number is greater than the target adjustment value, that is, the target adjustment value can be directly processed by the seam carving algorithm, which belongs to a small adjustment range, and will not be described in detail here.
207、根据所述前向能量标准和所述梯度图进行计算,得到所述待显示图像对应的缝隙图。207. Perform calculation according to the forward energy standard and the gradient map to obtain a gap map corresponding to the image to be displayed.
值得说明的是,缝隙图的计算可以通过下述公式来实现:It is worth noting that the calculation of the gap map can be realized by the following formula:
M(i,j)=e(i,j)+min(M(i-1,j-1),M(i-1,j),M(i-1,j+1)),其中,M表示缝隙图,e(i,j)表示每个像素位置的梯度值。M表示对每个入口(i,j)所有可能连通的seam最小累计能量。M(i, j)=e(i, j)+min(M(i-1, j-1), M(i-1, j), M(i-1, j+1)), where, M represents the gap map, and e(i, j) represents the gradient value of each pixel position. M represents the minimum cumulative energy of seam for all possible connections of each entry (i, j).
208、从缝隙图中删除所述第一缝隙,得到中间图像。208. Delete the first seam from the seam map to obtain an intermediate image.
其中,该步骤的相关描述与上述步骤104中的描述相同,在此不再重复说明。Wherein, the relevant description of this step is the same as the description in the above-mentioned step 104, and will not be repeated here.
209、对所述中间图像进行缩小处理,得到与所述待显示图像对应的目标图像。209. Perform shrinkage processing on the intermediate image to obtain a target image corresponding to the image to be displayed.
值得说明的是,该步骤与实施例1中步骤105的描述相同,在此不再重复说明。It is worth noting that this step is the same as the description of step 105 in Embodiment 1, and will not be repeated here.
其中,对中间图像进行缩小处理的实现方法,如图4所示,该实现方法包括:Wherein, the implementation method of reducing the intermediate image, as shown in Figure 4, the implementation method includes:
2091、根据所述中间图像进行计算,得到与所述中间图像对应的显著图。2091. Perform calculation according to the intermediate image to obtain a saliency map corresponding to the intermediate image.
2092、对所述显著图进行滤波,得到与所述显著图对应的重要图。2092. Filter the saliency map to obtain an importance map corresponding to the saliency map.
值得说明的是,该步骤2092的具体实现方法包括以中间图像作为指导guidance,以显著图为输入图像,采用引导过滤guided filter对显著图进行滤波得到重要图。It is worth noting that the specific implementation method of step 2092 includes using the intermediate image as the guidance, taking the saliency map as the input image, and using the guided filter to filter the saliency map to obtain the important map.
2093、根据所述重要图进行计算,得到与所述重要图对应的像素位移梯度图。2093. Perform calculation according to the significance map to obtain a pixel displacement gradient map corresponding to the significance map.
其中,根据重要图进行计算即根据重要图构造映射函数,在重要图的基础上计算像素位移的梯度图。Among them, calculating according to the importance map means constructing a mapping function according to the importance map, and calculating the gradient map of the pixel displacement on the basis of the importance map.
此外,值得说明的是,映射函数是用于估计当前重要图变化为像素位移梯度图时,各个像素的位移情况。In addition, it is worth noting that the mapping function is used to estimate the displacement of each pixel when the current important map is changed to a pixel displacement gradient map.
2094、根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。2094. Perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
其中,根据所述像素位移梯度图进行计算,即在整个图像上对位移梯度图求积分,并结合importance-weighted filtering,构建一个平滑的位移图shiftmap,从而得到目标图像。shift map里存放着中间图像中每个像素对应的位移量,图中各像素的位置加上或减去其对应的位移量,可以得到该像素在目标图中的位置。Wherein, the calculation is performed according to the pixel displacement gradient map, that is, the displacement gradient map is integrated on the entire image, and a smooth displacement map shiftmap is constructed in combination with importance-weighted filtering, so as to obtain the target image. The shift map stores the displacement corresponding to each pixel in the intermediate image. The position of each pixel in the image can be obtained by adding or subtracting the corresponding displacement to the position of the pixel in the target image.
进一步地,值得说明的是,上述步骤202-208可结合seam carving算法提供的处理方法实现,步骤209(包括:2091-2094)可结合shift map算法提供的处理方法实现的。Further, it is worth noting that the above steps 202-208 can be implemented in combination with the processing method provided by the seam carving algorithm, and step 209 (including: 2091-2094) can be implemented in combination with the processing method provided by the shift map algorithm.
此外,值得说明的是,对待显示视频进行缩小时,具体实现方法包括:In addition, it is worth noting that when shrinking the video to be displayed, the specific implementation methods include:
将所述待显示视频按帧转化为若干个待显示图像;Converting the video to be displayed frame by frame into several images to be displayed;
值得说明的是,视频可以看作是若干个图像构成的,对待显示视频处理,是按照一帧一帧的顺序处理,一帧即为一幅图像。则对视频的缩小可以看作是对该视频转化的若干图像的缩小处理。It is worth noting that a video can be regarded as composed of several images, and the video processing for display is processed in a frame-by-frame order, and a frame is an image. Then the shrinking of the video can be regarded as the shrinking processing of several images converted from the video.
获取所述若干个待显示图像各自对应的目标调整值。Target adjustment values corresponding to each of the plurality of images to be displayed are acquired.
其中,目标调整值指,待显示图像的目标缩小值。Wherein, the target adjustment value refers to a target reduction value of the image to be displayed.
进一步地,获取到若干待显示图像各自对应的目标调整值之后,就转化为对这些若干个待显示图像依次进行图像缩小的流程,即执行本实施例中的步骤202-209。Further, after acquiring the corresponding target adjustment values of the several images to be displayed, it is transformed into a process of sequentially reducing the images of the several images to be displayed, that is, executing steps 202-209 in this embodiment.
值得说明的是,原步骤2091-2094,在进行视频缩小时,如图5所示,具体执行方法如下:It is worth noting that, the original steps 2091-2094, when performing video reduction, as shown in Figure 5, the specific execution method is as follows:
209a、根据所述中间图像进行计算,得到与所述中间图像对应的显著图。209a. Perform calculation according to the intermediate image to obtain a saliency map corresponding to the intermediate image.
209b、对所述显著图进行滤波,得到与所述显著图对应的重要图。209b. Filter the saliency map to obtain an importance map corresponding to the saliency map.
209c、对得到的重要图在此进行滤波,得到滤波图。209c. Filter the obtained important map to obtain a filtered map.
209d、根据所述滤波图进行计算,得到与所述重要图对应的像素位移梯度图。209d. Perform calculation according to the filter map to obtain a pixel displacement gradient map corresponding to the importance map.
209e、根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。209e. Perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
即相对于原步骤2091-2094,添加了新的步骤209c,对于步骤209c,对重要图进行滤波,得到滤波图的过程中,以上一幅图像的重要图作为指导,以当前图像的重要图作为输入,从而得到当前图像的滤波图。该步骤的执行能够更好的保证视频的质量,即在转化为待显示图像的视频在重新由图像整合为视频时,能够防止是视频抖动。That is, compared to the original steps 2091-2094, a new step 209c is added. For step 209c, the important map is filtered, and in the process of obtaining the filtered map, the important map of the previous image is used as a guide, and the important map of the current image is used as a guide. Input to get the filter map of the current image. The execution of this step can better ensure the quality of the video, that is, when the video converted into the image to be displayed is reintegrated from the image into the video, it can prevent the video from shaking.
执行完步骤209,即完成了对这些由待显示视频转化来的待显示图像的缩小处理,继而将这些处理好的待显示图像作合并处理,重新组成视频。After step 209 is executed, the reduction processing of the images to be displayed converted from the video to be displayed is completed, and then the processed images to be displayed are merged to recompose the video.
本发明实施例提供的图像调整的方法,实现了图片的缩小,通过seamcarving算法得到了待显示图像的梯度图、缝隙图等,通过比较第一缝隙与待显示图像的目标调整值,删除第一缝隙得到了冗余信息相对较少的中间图像,再通过shift map算法对中间图像进行缩小处理,从而得到待显示图像的目标图像。现有技术方案,使用单一的算法实现图像的缩小,当缩小范围较大时,会出现图像的失真或扭曲。而本发明是实施例的技术方案,扩大了对多媒体资源的缩小范围,能够避免当缩放范围较大时而产生多媒体资源失真或扭曲的问题。The image adjustment method provided by the embodiment of the present invention realizes the reduction of the image, obtains the gradient map and the seam map of the image to be displayed through the seamcarving algorithm, and deletes the first seam by comparing the first seam with the target adjustment value of the image to be displayed. The gap obtains the intermediate image with relatively less redundant information, and then reduces the intermediate image through the shift map algorithm to obtain the target image of the image to be displayed. In the prior art solution, a single algorithm is used to realize image reduction, and when the reduction range is large, image distortion or distortion may occur. However, the present invention is a technical solution of an embodiment, which expands the narrowing range of multimedia resources and can avoid distortion or distortion of multimedia resources when the zooming range is large.
实施例3Example 3
本发明提供了一种图像调整的方法,本实施例为图片放大的方法,如图6所示,该方法包括:The present invention provides a method for image adjustment. This embodiment is a method for image enlargement. As shown in FIG. 6, the method includes:
301、获取待显示图像的目标调整值,所述目标调整值为待显示图像的目标放大值。301. Acquire a target adjustment value of an image to be displayed, where the target adjustment value is a target magnification value of the image to be displayed.
其中,目标调整值指的是待显示图片的目标放大值,即待显示图像针对当前的多媒体播放设备,在原有尺寸的基础上,需要进行放大的值。该目标调整值可以是根据当前多媒体播放设备对待显示图像的尺寸约束,待显示图像需要满足该多媒体播放设备的调整值;还可以是用户为待显示图像自定义的调整值。Wherein, the target adjustment value refers to a target magnification value of the picture to be displayed, that is, a value that needs to be magnified on the basis of the original size of the picture to be displayed for the current multimedia playback device. The target adjustment value may be an adjustment value that the image to be displayed needs to satisfy the size constraint of the image to be displayed on the current multimedia playback device; it may also be an adjustment value customized by the user for the image to be displayed.
302、根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图。302. Perform calculation according to the image information of the image to be displayed to obtain a gradient map of the image to be displayed.
其中,梯度图的计算流程公式步骤202的相关描述相同,在此不再详细说明。Wherein, the relevant description of step 202 of the calculation flow formula of the gradient map is the same, and will not be described in detail here.
303、根据计算得到的所述梯度图,获取待显示图像的冗余信息。303. Acquire redundant information of an image to be displayed according to the calculated gradient map.
其中,冗余信息的解释与实施例1中步骤101的相关描述相同,而获取冗余信息的相关描述与实施例2中步骤203的相关描述相同,在此不再详细说明。Wherein, the explanation of the redundant information is the same as the related description of step 101 in the first embodiment, and the related description of obtaining the redundant information is the same as the related description of the step 203 in the second embodiment, and will not be described in detail here.
304、根据所述冗余信息,确定所述待显示图像的第一缝隙。304. Determine a first gap of the image to be displayed according to the redundant information.
305、获取所述待显示图像的前向能量标准。305. Acquire a forward energy standard of the image to be displayed.
其中,前向能量的相关内容与实施例2中步骤206的相关描述相同,在此不再重复说明。Wherein, the relevant content of the forward energy is the same as the relevant description of step 206 in Embodiment 2, and will not be repeated here.
306、根据所述前向能量标准和所述梯度图进行计算,得到所述待显示图像对应的缝隙图。306. Perform calculation according to the forward energy standard and the gradient map to obtain a gap map corresponding to the image to be displayed.
其中,缝隙图的计算方法(公式)与实施例2中步骤207的相关描述相同,在此不再重复说明。Wherein, the calculation method (formula) of the gap map is the same as the relevant description of step 207 in Embodiment 2, and will not be repeated here.
307、从待显示图像中删除第一缝隙,得到第一处理图像。307. Delete the first gap from the image to be displayed to obtain a first processed image.
值得说明的是,该步骤与实施例1中步骤3相对,相关描述相同,在此不再详细说明。It is worth noting that this step is opposite to step 3 in Embodiment 1, and the relevant description is the same, and will not be described in detail here.
308、根据所述目标调整值,对所述第一处理图像进行放大,得到第二处理图像。308. Enlarge the first processed image according to the target adjustment value to obtain a second processed image.
其中,对第一处理图像的放大的是实现方法与实施例1中步骤4的相关描述相同,在此不再重复说明。进一步地,对图像进行放大的举例也可参照实施例1中步骤4的举例。Wherein, the implementation method of enlarging the first processed image is the same as the relevant description of step 4 in Embodiment 1, and will not be repeated here. Further, for an example of zooming in on an image, reference may also be made to the example of Step 4 in Embodiment 1.
309、对所述第二处理图像进行缩小处理,获得目标图像。309. Perform reduction processing on the second processed image to obtain a target image.
其中,对第二处理图像进行缩小处理,其缩小倍数与步骤4中的图像放大的倍数是对应的。Wherein, the reduction processing is performed on the second processed image, and the reduction factor corresponds to the image enlargement factor in step 4.
进一步地,如同步骤308参照实施例1中步骤4的举例,该步骤309也可参照实施例1中步骤105举例,进行说明,在此不再重复。Further, as step 308 refers to the example of step 4 in embodiment 1, this step 309 can also refer to the example of step 105 in embodiment 1 for illustration, and will not be repeated here.
3091、根据所述中间图像进行计算,得到与所述中间图像对应的显著图。3091. Perform calculation according to the intermediate image to obtain a saliency map corresponding to the intermediate image.
3092、对所述显著图进行滤波,得到与所述显著图对应的重要图。3092. Filter the saliency map to obtain an importance map corresponding to the saliency map.
3093、根据所述重要图进行计算,得到与所述重要图对应的像素位移梯度图。3093. Perform calculation according to the significance map to obtain a pixel displacement gradient map corresponding to the significance map.
3094、根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。3094. Perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
值得说明的是,上述步骤3091-3094与实施例2中步骤2091-2094相对应,相关内容描述相同,方法流程图对应参见图4,在此不再重复说明。It is worth noting that the above-mentioned steps 3091-3094 correspond to steps 2091-2094 in Embodiment 2, and the relevant descriptions are the same. Refer to FIG. 4 for the corresponding method flow chart, and the description will not be repeated here.
进一步地,值得说明的是,上述步骤302-307可结合seam carving算法中的相应方法实现的,步骤308可结合最近邻域的方法实现,步骤309(包括:3091-3094)是结合shift map算法中的相应方法实现的。Further, it is worth noting that the above steps 302-307 can be realized in combination with the corresponding method in the seam carving algorithm, step 308 can be realized in combination with the method of the nearest neighbor, and step 309 (including: 3091-3094) is realized in combination with the shift map algorithm implemented in the corresponding method.
此外,值得说明的是,对待显示视频进行放大时,具体实现方法包括:In addition, it is worth noting that when the video to be displayed is enlarged, the specific implementation methods include:
将所述待显示视频按帧转化为若干个待显示图像;Converting the video to be displayed frame by frame into several images to be displayed;
值得说明的是,视频可以看作是若干个图像构成的,对待显示视频处理,是按照一帧一帧的顺序处理,一帧即为一幅图像。则对视频的放大可以看作是对该视频转化的若干图像的放大处理。It is worth noting that a video can be regarded as composed of several images, and the video processing for display is processed in a frame-by-frame order, and a frame is an image. The enlargement of the video can be regarded as the enlargement processing of several images converted from the video.
获取所述若干个待显示图像各自对应的目标调整值。Target adjustment values corresponding to each of the plurality of images to be displayed are acquired.
其中,目标调整值指,待显示图像的目标放大值。Wherein, the target adjustment value refers to a target magnification value of the image to be displayed.
进一步地,获取到若干待显示图像各自对应的目标调整值之后,就转化为对这些若干个待显示图像依次进行图像放大的流程,即执行本实施例中的步骤302-309。Further, after the target adjustment values corresponding to the several images to be displayed are obtained, it is transformed into a process of sequentially zooming in on the several images to be displayed, that is, steps 302-309 in this embodiment are executed.
值得说明的是,原步骤3091-3094,在进行视频放大时,具体执行方法如下,其方法流程图对应参见图5:It is worth noting that, the original steps 3091-3094, when zooming in on the video, the specific execution method is as follows, and the corresponding flow chart of the method is shown in Figure 5:
309a、根据所述中间图像进行计算,得到与所述中间图像对应的显著图。309a. Perform calculation according to the intermediate image to obtain a saliency map corresponding to the intermediate image.
309b、对所述显著图进行滤波,得到与所述显著图对应的重要图。309b. Filter the saliency map to obtain an importance map corresponding to the saliency map.
309c、对得到的重要图在此进行滤波,得到滤波图。309c. Filter the obtained important map to obtain a filtered map.
309d、根据所述滤波图进行计算,得到与所述重要图对应的像素位移梯度图。309d. Perform calculation according to the filter map to obtain a pixel displacement gradient map corresponding to the importance map.
309e、根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。309e. Perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
即相对于原步骤3091-3094,添加了新的步骤309c,对于步骤309c,对重要图进行滤波,得到滤波图的过程中,以上一幅图像的重要图作为指导,以当前图像的重要图作为输入,从而得到当前图像的滤波图。该步骤的执行能够更好的保证视频的质量,即在转化为待显示图像的视频在重新由图像整合为视频时,能够防止是视频抖动。That is, compared to the original steps 3091-3094, a new step 309c is added. For step 309c, the important map is filtered, and in the process of obtaining the filtered map, the important map of the previous image is used as a guide, and the important map of the current image is used as a guide. Input to get the filter map of the current image. The execution of this step can better ensure the quality of the video, that is, when the video converted into the image to be displayed is reintegrated from the image into the video, it can prevent the video from shaking.
执行完步骤309,即完成了对这些由待显示视频转化来的待显示图像的放大处理,继而将这些处理好的待显示图像作合并处理,重新组成视频。After step 309 is executed, the zoom-in processing of the images to be displayed converted from the video to be displayed is completed, and then the processed images to be displayed are merged to recompose the video.
本发明实施例提供的图像调整的方法,实现了图片的放大,通过seamcarving算法得到了待显示图像的梯度图、第一处理图像等,并得到第一缝隙,删除第一缝隙得到了冗余信息相对较少的中间图像;进而通过最近邻域的方法将中间图像进行放大处理,得到第二处理图像;再通过shift map算法对第二处理图像进行缩小处理,从而得到待显示图像的目标图像。现有技术方案,使用单一的算法实现图像的放大,当放大范围较大时,会出现图像的失真或扭曲。而本发明是实施例的技术方案,扩大了对多媒体资源的放大范围,能够避免当放大范围较大时而产生多媒体资源失真或扭曲的问题。The image adjustment method provided by the embodiment of the present invention realizes the enlargement of the picture, obtains the gradient map of the image to be displayed, the first processed image, etc. through the seamcarving algorithm, and obtains the first seam, and deletes the first seam to obtain redundant information There are relatively few intermediate images; and then the intermediate image is enlarged by the nearest neighbor method to obtain the second processed image; and then the second processed image is reduced by the shift map algorithm to obtain the target image of the image to be displayed. In the prior art solution, a single algorithm is used to enlarge the image, and when the enlargement range is large, distortion or distortion of the image may occur. However, the present invention is a technical solution of an embodiment, which expands the zoom range of multimedia resources and can avoid distortion or distortion of multimedia resources when the zoom range is large.
实施例4Example 4
本发明实施例提供了一种图像调整的装置4,如图7所示,该装置4包括:获取单元41、确定单元42、比较单元43、删除单元44、处理单元45。An embodiment of the present invention provides an image adjustment device 4, as shown in FIG.
获取单元41,用于获取待显示图像的目标调整值及冗余信息。The acquiring unit 41 is configured to acquire the target adjustment value and redundant information of the image to be displayed.
确定单元42,用于根据所述获取单元41获取的所述冗余信息,确定所述待显示图像的第一缝隙。The determining unit 42 is configured to determine the first gap of the image to be displayed according to the redundant information acquired by the acquiring unit 41 .
比较单元43,用于将所述确定单元42确定的第一缝隙的数量与所述待显示图像的目标调整值进行比较。A comparing unit 43, configured to compare the number of first gaps determined by the determining unit 42 with the target adjustment value of the image to be displayed.
删除单元44,用于根据所述比较单元43的比较结果,确定当所述第一缝隙的数量小于所述目标调整值时,从待显示图像中删除第一缝隙,得到中间图像。The deleting unit 44 is configured to delete the first gap from the image to be displayed to obtain an intermediate image when it is determined according to the comparison result of the comparing unit 43 that the number of the first gap is smaller than the target adjustment value.
处理单元45,用于对所述删除单元44得到的所述中间图像进行缩小处理,得到与所述待显示图像对应的目标图像。The processing unit 45 is configured to perform reduction processing on the intermediate image obtained by the deleting unit 44 to obtain a target image corresponding to the image to be displayed.
可选的是,如图8所示,所述获取单元41包括:第一计算模块411、第一获取模块412;所述删除单元44包括:第二获取模块441、第二计算模块442、删除模块443;处理单元45包括:第三计算模块451、滤波模块452、第四计算模块453、第五计算模块454。Optionally, as shown in FIG. 8, the acquisition unit 41 includes: a first calculation module 411, a first acquisition module 412; the deletion unit 44 includes: a second acquisition module 441, a second calculation module 442, a deletion Module 443 ; the processing unit 45 includes: a third calculation module 451 , a filter module 452 , a fourth calculation module 453 , and a fifth calculation module 454 .
第一计算模块411,用于根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图。The first calculation module 411 is configured to perform calculation according to the image information of the image to be displayed to obtain a gradient map of the image to be displayed.
第一获取模块412,用于根据所述第一计算模块411得到的所述梯度图,获取待显示图像的冗余信息。The first obtaining module 412 is configured to obtain redundant information of the image to be displayed according to the gradient map obtained by the first calculating module 411 .
第二获取模块441,用于获取所述待显示图像的前向能量标准。The second acquiring module 441 is configured to acquire the forward energy standard of the image to be displayed.
第二计算模块442,用于根据所述第二获取模块441获取到的所述前向能量标准和所述第一计算模块412得到的所述梯度图进行计算,得到所述待显示图像对应的缝隙图。The second calculation module 442 is configured to perform calculations according to the forward energy standard acquired by the second acquisition module 441 and the gradient map obtained by the first calculation module 412, to obtain the corresponding to the image to be displayed Gap map.
删除模块443,用于从所述第二计算模块442得到的所述缝隙图中删除第一缝隙。The deletion module 443 is configured to delete the first gap from the gap map obtained by the second calculation module 442 .
第三计算模块451,用于根据所述中间图像进行计算,得到与所述中间图像对应的显著图;The third calculation module 451 is configured to perform calculation according to the intermediate image to obtain a saliency map corresponding to the intermediate image;
滤波模块452,用于对所述第三计算模块451得到的所述显著图进行滤波,得到与所述显著图对应的重要图;A filtering module 452, configured to filter the saliency map obtained by the third calculation module 451, to obtain an important map corresponding to the saliency map;
第四计算模块453,用于根据所述滤波模块452得到的所述重要图进行计算,得到与所述重要图对应的像素位移梯度图;A fourth calculation module 453, configured to perform calculations according to the importance map obtained by the filtering module 452, to obtain a pixel displacement gradient map corresponding to the importance map;
第五计算模块454,用于根据所述第四计算模块453得到的所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。The fifth calculation module 454 is configured to perform calculation according to the pixel displacement gradient map obtained by the fourth calculation module 453 to obtain a target image corresponding to the image to be displayed.
可选的是,该装置还包括:转化单元46、合并单元47,当需要显示视频时应用所述单元46、单元47,将其划属到图8中,结合图8,形成完整装置。Optionally, the device also includes: a converting unit 46 and a merging unit 47, which are applied when video needs to be displayed, which are assigned to FIG. 8 and combined with FIG. 8 to form a complete device.
转化单元46,用于当对待显示视频进行图像调整时,将所述待显示视频按帧转化为若干个待显示图像。The conversion unit 46 is configured to convert the video to be displayed into several images to be displayed frame by frame when performing image adjustment on the video to be displayed.
所述获取单元41,还用于获取所述转化单元46得到的所述若干个待显示图像各自对应的目标调整值及冗余信息。The acquiring unit 41 is further configured to acquire target adjustment values and redundant information corresponding to each of the plurality of images to be displayed obtained by the conversion unit 46 .
合并单元47,用于对所述若干个待显示图像各自对应的目标图像进行合并处理,得到与所述待显示视频对应的目标视频。The merging unit 47 is configured to merge the target images corresponding to the plurality of images to be displayed to obtain the target video corresponding to the video to be displayed.
本发明实施例还提供了一种图像调整的装置5,如图9所示,该装置5包括:获取单元51、确定单元52、删除单元53、第一处理单元54、第二处理单元55The embodiment of the present invention also provides an image adjustment device 5, as shown in FIG.
获取单元51,用于获取待显示图像的目标调整值及冗余信息。The acquisition unit 51 is configured to acquire the target adjustment value and redundant information of the image to be displayed.
确定单元52,用于根据所述获取单元51获取到的冗余信息,确定所述待显示图像的第一缝隙。The determining unit 52 is configured to determine the first gap of the image to be displayed according to the redundant information acquired by the acquiring unit 51 .
删除单元53,用于从待显示图像中删除所述跌确定单元52确定的第一缝隙,得到第一处理图像。The deleting unit 53 is configured to delete the first gap determined by the gap determining unit 52 from the image to be displayed to obtain a first processed image.
第一处理单元54,用于根据所述目标调整值,对所述第一处理图像进行放大,得到第二处理图像。The first processing unit 54 is configured to amplify the first processed image according to the target adjustment value to obtain a second processed image.
第二处理单元55,用于对所述第一处理单元54得到的第二处理图像进行缩小处理,获得目标图像。The second processing unit 55 is configured to perform reduction processing on the second processed image obtained by the first processing unit 54 to obtain a target image.
可选的是,如图10所示,所述获取单元51包括:第一计算模块511、第一获取模块512;所述删除单元53包括:第二获取模块531、第二计算模块532、删除模块533;所述第二处理单元55包括:第三计算模块551、滤波模块552、第四计算模块553、第五计算模块554。Optionally, as shown in FIG. 10, the acquisition unit 51 includes: a first calculation module 511, a first acquisition module 512; the deletion unit 53 includes: a second acquisition module 531, a second calculation module 532, a deletion module 533 ; the second processing unit 55 includes: a third computing module 551 , a filtering module 552 , a fourth computing module 553 , and a fifth computing module 554 .
第一计算模块511,用于根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图。The first calculation module 511 is configured to perform calculation according to the image information of the image to be displayed to obtain a gradient map of the image to be displayed.
第一获取模块512,用于根据所述第一计算模块511计算得到的所述梯度图,获取待处理图像的冗余信息。The first acquiring module 512 is configured to acquire redundant information of the image to be processed according to the gradient map calculated by the first calculating module 511 .
第二获取模块531,用于获取所述待显示图像的前向能量标准。The second acquiring module 531 is configured to acquire the forward energy standard of the image to be displayed.
第二计算模块532,用于根据所述第二获取模块531获取的所述前向能量标准和所述第一计算模块511得到的所述梯度图进行计算,得到所述待显示图像对应的缝隙图。The second calculation module 532 is configured to perform calculation according to the forward energy standard acquired by the second acquisition module 531 and the gradient map obtained by the first calculation module 511, to obtain the gap corresponding to the image to be displayed picture.
删除模块533,用于从所述第二计算模块532得到的缝隙图中删除所述最优缝隙。The deletion module 533 is configured to delete the optimal gap from the gap map obtained by the second calculation module 532 .
第三计算模块551,用于根据所述第一处理单元得到的所述第二处理图像进行计算,得到与所述第二处理图像对应的显著图。The third calculation module 551 is configured to perform calculation according to the second processed image obtained by the first processing unit, to obtain a saliency map corresponding to the second processed image.
滤波模块552,用于对所述第三计算模块551得到的所述显著图进行滤波,得到与所述显著图对应的重要图。The filtering module 552 is configured to filter the saliency map obtained by the third calculation module 551 to obtain an important map corresponding to the saliency map.
第四计算模块553,用于根据所述重要图进行计算,得到像素位移梯度图。The fourth calculation module 553 is configured to perform calculation according to the importance map to obtain a pixel displacement gradient map.
第五计算模块554,用于根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。The fifth calculation module 554 is configured to perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
可选的是,该装置5还包括:转化单元56、合并单元57。Optionally, the device 5 further includes: a converting unit 56 and a combining unit 57 .
转化单元56,用于当对待显示视频进行图像调整时,将所述待显示视频按帧转化为若干个待显示图像;A conversion unit 56, configured to convert the video to be displayed into several images to be displayed frame by frame when performing image adjustment on the video to be displayed;
所述获取单元51,还用于获取所述转化单元56得到的所述若干个待显示图像各自对应的目标调整值及冗余信息。The acquiring unit 51 is further configured to acquire target adjustment values and redundant information corresponding to each of the plurality of images to be displayed obtained by the conversion unit 56 .
合并单元57,用于对所述若干个待显示图像各自对应的目标图像进行合并处理,得到与所述待显示视频对应的目标视频。The merging unit 57 is configured to merge target images corresponding to the plurality of images to be displayed to obtain a target video corresponding to the video to be displayed.
本发明实施例还提供了一种图像调整的系统,如图11所示,该系统包括:图像调整装置4和图像调整装置5。其中,图像调整装置4包括上述单元41-47,图像调整装置5包括上述单元51-57。The embodiment of the present invention also provides an image adjustment system, as shown in FIG. 11 , the system includes: an image adjustment device 4 and an image adjustment device 5 . Wherein, the image adjustment device 4 includes the above-mentioned units 41-47, and the image adjustment device 5 includes the above-mentioned units 51-57.
本发明实施例提供的图像调整的装置及系统,实现了对待显示图像的缩放,获取待显示图像的目标调整值,通过seam carving算法获取待显示图像的冗余信息以及中间图像等,在通过shift map算法对待显示图像进行缩小处理;在图像放大过程中,获取中间图像之后,需先对中间图像进行放大,使用shift map算法。现有技术使用单一的算法实现图像调整,当调整范围较大时,会出现图像的失真或扭曲。而本发明是实施例的技术方案,扩大了对多媒体资源的调整范围,能够避免当缩放范围较大时而产生多媒体资源失真或扭曲的问题。The image adjustment device and system provided by the embodiments of the present invention realize the scaling of the image to be displayed, obtain the target adjustment value of the image to be displayed, obtain the redundant information and the intermediate image of the image to be displayed through the seam carving algorithm, and then pass the shift The map algorithm shrinks the image to be displayed; in the process of image enlargement, after obtaining the intermediate image, the intermediate image needs to be enlarged first, using the shift map algorithm. The existing technology uses a single algorithm to realize image adjustment, and when the adjustment range is large, image distortion or distortion may occur. However, the present invention is a technical solution of an embodiment, which expands the adjustment range of multimedia resources and can avoid distortion or distortion of multimedia resources when the zoom range is large.
实施例5Example 5
本发明实施例提供了一种图像调整的装置,如图12所示,该装置包括:处理器01、存储器02。An embodiment of the present invention provides an image adjustment device. As shown in FIG. 12 , the device includes: a processor 01 and a memory 02 .
处理器01,用于获取待显示图像的目标调整值。Processor 01, configured to acquire a target adjustment value of an image to be displayed.
存储器02,用于存储所述待显示图像的目标调整值。The memory 02 is configured to store the target adjustment value of the image to be displayed.
处理器01,根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图。The processor 01 performs calculation according to the image information of the image to be displayed to obtain a gradient map of the image to be displayed.
存储器02,用于存储所述待显示图像的图像信息。The memory 02 is configured to store image information of the image to be displayed.
处理器01,根据计算得到的所述梯度图,获取待显示图像的冗余信息。The processor 01 acquires redundant information of the image to be displayed according to the calculated gradient map.
存储器02,用于存储所述冗余信息。The memory 02 is configured to store the redundant information.
处理器01,根据所述冗余信息,确定所述待显示图像的第一缝隙。The processor 01 determines a first gap of the image to be displayed according to the redundant information.
存储器02,用于存储所述第一缝隙。The memory 02 is configured to store the first gap.
处理器01,将确定的第一缝隙的数量与所述待显示图像的目标调整值进行比较。The processor 01 compares the determined quantity of the first gap with the target adjustment value of the image to be displayed.
存储器02,用于存储比较结果。The memory 02 is used to store the comparison result.
处理器01,用于当确定所述第一缝隙的数量小于所述目标调整值时,获取所述待显示图像的前向能量标准。Processor 01, configured to acquire a forward energy standard of the image to be displayed when it is determined that the number of the first gaps is smaller than the target adjustment value.
存储器02,用于存储所述前向能量标准。The memory 02 is configured to store the forward energy standard.
处理器01,用于根据所述前向能量标准和所述梯度图进行计算,得到所述待显示图像对应的缝隙图。The processor 01 is configured to perform calculations according to the forward energy standard and the gradient map to obtain a gap map corresponding to the image to be displayed.
存储器02,用于存储所述缝隙图。The memory 02 is configured to store the slit map.
处理器01,用于从缝隙图中删除所述第一缝隙,得到中间图像。Processor 01, configured to delete the first seam from the seam map to obtain an intermediate image.
存储器02,用于存储所述中间图像。The memory 02 is used to store the intermediate image.
处理器01,用于对所述中间图像进行缩小处理,得到与所述待显示图像对应的目标图像。The processor 01 is configured to shrink the intermediate image to obtain a target image corresponding to the image to be displayed.
存储器02,用于存储所述目标图像。The memory 02 is used to store the target image.
处理器01,还用于根据所述中间图像进行计算,得到与所述中间图像对应的显著图。The processor 01 is further configured to perform calculations based on the intermediate image to obtain a saliency map corresponding to the intermediate image.
存储器02,用于存储所述显著图。The memory 02 is configured to store the saliency map.
处理器01,用于对所述显著图进行滤波,得到与所述显著图对应的重要图。The processor 01 is configured to filter the saliency map to obtain an importance map corresponding to the saliency map.
存储器02,用于存储所述重要图。The memory 02 is configured to store the importance map.
处理器01,还用于根据所述重要图进行计算,得到与所述重要图对应的像素位移梯度图。The processor 01 is further configured to perform calculations according to the significance map to obtain a pixel displacement gradient map corresponding to the significance map.
存储器02,还用于存储所述像素位移梯度图。The memory 02 is also used to store the pixel displacement gradient map.
处理器01,用于根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。The processor 01 is configured to perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
存储器02,用于存储所述目标图像。The memory 02 is used to store the target image.
处理器01,还用于将待显示视频按帧转化为若干个待显示图像。The processor 01 is also used to convert the video to be displayed into several images to be displayed frame by frame.
存储器02,用于存储所述若干个待显示图像。The memory 02 is used for storing the several images to be displayed.
处理器01,用与将这些处理好的待显示图像作合并处理,重新组成视频。Processor 01 is used to combine the processed images to be displayed to reconstruct the video.
存储器02,用于存储所述重新组成的视频。The memory 02 is used for storing the recomposed video.
本发明实施例还提供了一种图像调整的装置,如图13所示,该装置包括:处理器03,存储器04。The embodiment of the present invention also provides an image adjustment device, as shown in FIG. 13 , the device includes: a processor 03 and a memory 04 .
处理器03,用于获取待显示图像的目标调整值。A processor 03, configured to acquire a target adjustment value of the image to be displayed.
存储器04,用于存储所述待显示图像的目标调整值。The memory 04 is configured to store the target adjustment value of the image to be displayed.
处理器03,用于根据待显示图像的图像信息进行计算,得到所述待显示图像的梯度图。The processor 03 is configured to perform calculation according to the image information of the image to be displayed to obtain a gradient map of the image to be displayed.
存储器04,用于存储所述梯度图。The memory 04 is used to store the gradient map.
处理器03,用于根据计算得到的所述梯度图,获取待显示图像的冗余信息。The processor 03 is configured to acquire redundant information of the image to be displayed according to the calculated gradient map.
存储器04,用于存储所述冗余信息。The memory 04 is configured to store the redundant information.
处理器03,用于根据所述冗余信息,确定所述待显示图像的第一缝隙。The processor 03 is configured to determine the first gap of the image to be displayed according to the redundant information.
存储器04,还用于存储所述第一缝隙。The memory 04 is also used to store the first slit.
处理器03,用于获取所述待显示图像的前向能量标准。。A processor 03, configured to acquire the forward energy standard of the image to be displayed. .
存储器04,用于存储所述前向能量标准。The memory 04 is configured to store the forward energy standard.
处理器03,用于根据所述前向能量标准和所述梯度图进行计算,得到所述待显示图像对应的缝隙图。The processor 03 is configured to perform calculations according to the forward energy standard and the gradient map to obtain a gap map corresponding to the image to be displayed.
存储器04,用于存储所述缝隙图。The memory 04 is configured to store the slit map.
处理器03,用于从待显示图像中删除第一缝隙,得到第一处理图像。The processor 03 is configured to delete the first gap from the image to be displayed to obtain a first processed image.
存储器04,用于存储所述第一处理图像。The memory 04 is configured to store the first processed image.
处理器03,用于根据所述目标调整值,对所述第一处理图像进行放大,得到第二处理图像。The processor 03 is configured to amplify the first processed image according to the target adjustment value to obtain a second processed image.
存储器04,用于存储所述第二处理图像。The memory 04 is configured to store the second processed image.
处理器03,用于对所述第二处理图像进行缩小处理,获得目标图像。The processor 03 is configured to perform reduction processing on the second processed image to obtain a target image.
存储器04,用于存储所述目标图像。The memory 04 is used to store the target image.
处理器03,还用于根据所述中间图像进行计算,得到与所述中间图像对应的显著图。The processor 03 is further configured to perform calculations based on the intermediate image to obtain a saliency map corresponding to the intermediate image.
存储器04,还用于存储所述显著图。The memory 04 is also used to store the saliency map.
处理器03,还用于对所述显著图进行滤波,得到与所述显著图对应的重要图。The processor 03 is further configured to filter the saliency map to obtain an importance map corresponding to the saliency map.
存储器04,还用于存储所述重要图。The memory 04 is also used to store the importance map.
处理器03,还用于根据所述重要图进行计算,得到与所述重要图对应的像素位移梯度图。The processor 03 is further configured to perform calculations according to the significance map to obtain a pixel displacement gradient map corresponding to the significance map.
存储器04,还用于存储所述像素位移梯度图。The memory 04 is also used to store the pixel displacement gradient map.
处理器03,还用于根据所述像素位移梯度图进行计算,得到与所述待显示图像对应的目标图像。The processor 03 is further configured to perform calculation according to the pixel displacement gradient map to obtain a target image corresponding to the image to be displayed.
存储器04,用于存储所述目标图像。The memory 04 is used to store the target image.
可选的是,处理器03,还用于将待显示视频按帧转化为若干个待显示图像。Optionally, the processor 03 is also configured to convert the video to be displayed into several images to be displayed frame by frame.
处理器03,还用于将这些处理好的待显示图像作合并处理,重新组成视频。The processor 03 is also configured to combine the processed images to be displayed to recompose the video.
存储器04,还用于存储所述重新组成的视频。The memory 04 is also used for storing the recomposed video.
本发明实施例提供的图像调整的装置,实现了对待显示图像的缩放,获取待显示图像的目标调整值,通过seam carving算法获取待显示图像的冗余信息以及中间图像等,在通过shift map算法对待显示图像进行缩小处理;在图像放大过程中,获取中间图像之后,需先对中间图像进行放大,使用shift map算法。现有技术使用单一的算法实现图像调整,当调整范围较大时,会出现图像的失真或扭曲。而本发明是实施例的技术方案,扩大了对多媒体资源的调整范围,能够避免当缩放范围较大时而产生多媒体资源失真或扭曲的问题。The image adjustment device provided by the embodiment of the present invention realizes the scaling of the image to be displayed, obtains the target adjustment value of the image to be displayed, obtains redundant information and intermediate images of the image to be displayed through the seam carving algorithm, and then uses the shift map algorithm The image to be displayed is reduced; in the process of image enlargement, after the intermediate image is obtained, the intermediate image needs to be enlarged first, using the shift map algorithm. The existing technology uses a single algorithm to realize image adjustment, and when the adjustment range is large, image distortion or distortion may occur. However, the present invention is a technical solution of an embodiment, which expands the adjustment range of multimedia resources and can avoid distortion or distortion of multimedia resources when the zoom range is large.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘,硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be realized by means of software plus necessary general-purpose hardware, and of course also by hardware, but in many cases the former is a better embodiment . Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a floppy disk of a computer , a hard disk or an optical disk, etc., including several instructions for enabling a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (25)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210592503.3A CN103050110B (en) | 2012-12-31 | 2012-12-31 | Method, device and system for image adjustment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210592503.3A CN103050110B (en) | 2012-12-31 | 2012-12-31 | Method, device and system for image adjustment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103050110A CN103050110A (en) | 2013-04-17 |
CN103050110B true CN103050110B (en) | 2015-06-17 |
Family
ID=48062726
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210592503.3A Active CN103050110B (en) | 2012-12-31 | 2012-12-31 | Method, device and system for image adjustment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103050110B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104318514B (en) * | 2014-10-17 | 2017-05-17 | 合肥工业大学 | Three-dimensional significance based image warping method |
CN107145887B (en) * | 2017-03-31 | 2019-10-01 | 天津工业大学 | A kind of seam cutting framing evidence collecting method deleted for object |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7747107B2 (en) * | 2007-03-06 | 2010-06-29 | Mitsubishi Electric Research Laboratories, Inc. | Method for retargeting images |
CN100583145C (en) * | 2008-08-04 | 2010-01-20 | 清华大学 | Method for evaluating adjustable dimension fidelity based on content relevant image |
CN101420508B (en) * | 2008-12-02 | 2011-06-01 | 西安交通大学 | A Content-Dependent Image Scaling Method |
JP2012521708A (en) * | 2009-03-26 | 2012-09-13 | コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ | Method and apparatus for correcting an image using a saliency map based on color frequency |
CN101609547B (en) * | 2009-07-16 | 2011-12-07 | 复旦大学 | Seamless image splicing processing method based on accumulated energy |
-
2012
- 2012-12-31 CN CN201210592503.3A patent/CN103050110B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN103050110A (en) | 2013-04-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4157568B2 (en) | Method and apparatus for increasing image resolution | |
CN111402139B (en) | Image processing method, apparatus, electronic device, and computer-readable storage medium | |
CN112367459B (en) | Image processing method, electronic device, and non-volatile computer-readable storage medium | |
RU2368006C1 (en) | Method and system for adaptive reformatting of digital images | |
US9076234B2 (en) | Super-resolution method and apparatus for video image | |
WO2022089657A1 (en) | Method and apparatus for eliminating color difference of stitched image, and device and readable storage medium | |
US8107750B2 (en) | Method of generating motion vectors of images of a video sequence | |
TWI387935B (en) | Image generation method, program therefor, and storage medium for storing the program | |
WO2019052534A1 (en) | Image stitching method and device, and storage medium | |
WO2014197154A1 (en) | Methods of image fusion for image stabilizaton | |
EP2555156A1 (en) | Image mosaicing | |
CN113538269B (en) | Image processing method and device, computer readable storage medium and electronic device | |
US12388952B2 (en) | Video frame insertion method and apparatus, and electronic device | |
CN111402111A (en) | Image blurring method, device, terminal and computer readable storage medium | |
CN102568443B (en) | A Digital Image Scaling Method | |
CN103050110B (en) | Method, device and system for image adjustment | |
JP2011039801A (en) | Apparatus and method for processing image | |
CN109600667A (en) | A method of the video based on grid and frame grouping redirects | |
JP2015015699A (en) | Image processing apparatus, information processing method, and program | |
CN114359005B (en) | A sliding zoom method, device and storage medium based on depth camera | |
JP2010193154A (en) | Image processor and method | |
JP5713256B2 (en) | Image processing apparatus, imaging apparatus, and image processing program | |
CN103327261A (en) | Method for simply and fast redirecting video | |
CN119648887B (en) | Image rendering method, display device, apparatus, storage medium, and program product | |
CN112083864B (en) | Method, device and equipment for processing object to be deleted |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |