技术领域technical field
本发明涉及智能移动终端领域,尤其涉及一种深度图像数据的处理方法及移动终端。The invention relates to the field of intelligent mobile terminals, in particular to a method for processing depth image data and a mobile terminal.
背景技术Background technique
随着深度相机技术的成熟,特别是TOF(Time of flight,飞行时间测距法)等3D拍摄技术的运用,拍摄结果已经不是简单的二维图形数据,而是具有3D深度数据的三维图形数据。目前的数字变焦技术是通过对拍摄画面数据的放大来实现模拟距离拉近的效果,但通过简单的画面放大来实现模拟距离拉近的效果,并不能真实的体现出实际的透视变化效果,导致数字变焦后的三维图形数据显示效果差的问题。With the maturity of depth camera technology, especially the application of 3D shooting technologies such as TOF (Time of flight, time of flight), the shooting results are no longer simple two-dimensional graphics data, but three-dimensional graphics data with 3D depth data . The current digital zoom technology achieves the effect of analog distance reduction by enlarging the captured image data, but the effect of analog distance reduction by simply enlarging the image cannot truly reflect the actual perspective change effect, resulting in The problem that the display effect of 3D graphics data after digital zooming is poor.
发明内容Contents of the invention
本发明实施例提供了一种深度图像数据的处理方法及移动终端,以解决现有技术中数字变焦后的三维图形数据显示效果差的问题。Embodiments of the present invention provide a method for processing depth image data and a mobile terminal to solve the problem in the prior art that the display effect of three-dimensional graphic data after digital zooming is poor.
第一方面,本发明实施例提供了一种深度图像数据的处理方法,包括:In a first aspect, an embodiment of the present invention provides a method for processing depth image data, including:
获取原始深度图像中目标对象到实际镜头的第一距离;Obtain the first distance from the target object to the actual lens in the original depth image;
在检测到调整移动终端中预览图像大小的数字变焦操作之后,获取目标对象到虚拟镜头的第二距离;其中,虚拟镜头为数字变焦后实际镜头的等效镜头;After detecting the digital zoom operation for adjusting the size of the preview image in the mobile terminal, obtaining the second distance from the target object to the virtual lens; wherein, the virtual lens is an equivalent lens of the actual lens after digital zooming;
根据第二距离和第一距离,对原始深度图像中目标对象的显示比例进行调整;adjusting the display ratio of the target object in the original depth image according to the second distance and the first distance;
根据调整后的深度图像,生成数字变焦后的目标图像。According to the adjusted depth image, a digitally zoomed target image is generated.
第二方面,本发明实施例还提供了一种移动终端,包括:In the second aspect, the embodiment of the present invention also provides a mobile terminal, including:
第一获取模块,用于获取原始深度图像中目标对象到实际镜头的第一距离;The first obtaining module is used to obtain the first distance from the target object in the original depth image to the actual lens;
第二获取模块,用于在检测到调整移动终端中预览图像大小的数字变焦操作之后,获取目标对象到虚拟镜头的第二距离;其中,虚拟镜头为数字变焦后实际镜头的等效镜头;The second obtaining module is used to obtain the second distance from the target object to the virtual lens after detecting the digital zoom operation for adjusting the size of the preview image in the mobile terminal; wherein, the virtual lens is an equivalent lens of the actual lens after digital zooming;
第一调整模块,用于根据第二距离和第一距离,对原始深度图像中目标对象的显示比例进行调整;The first adjustment module is used to adjust the display ratio of the target object in the original depth image according to the second distance and the first distance;
生成模块,用于根据调整后的深度图像,生成数字变焦后的目标图像。The generating module is configured to generate a digitally zoomed target image according to the adjusted depth image.
第三方面,本发明实施例还提供了一种移动终端,移动终端包括处理器,存储器,存储于存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现如上所述的深度图像数据的处理方法的步骤。In the third aspect, the embodiment of the present invention also provides a mobile terminal. The mobile terminal includes a processor, a memory, and a computer program stored in the memory and operable on the processor. When the processor executes the computer program, the above-mentioned Steps in a method for processing depth image data.
第四方面,本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上所述的深度图像数据的处理方法的步骤。In a fourth aspect, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned depth image data processing method are implemented. .
这样,本发明实施例的移动终端,通过利用深度相机拍摄获取到原始深度图像,在进行数字变焦时对不同远近的物体的放大效果进行透视修正,从而到更加接近物理距离靠近而产生的透视变化成像效果。In this way, the mobile terminal in the embodiment of the present invention obtains the original depth image by using the depth camera, and performs perspective correction on the magnification effect of objects at different distances when performing digital zooming, so as to get closer to the perspective change caused by approaching the physical distance. Imaging effect.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments of the present invention. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention , for those skilled in the art, other drawings can also be obtained according to these drawings without paying creative labor.
图1表示本发明实施例的深度图像数据的处理方法的流程图;FIG. 1 shows a flowchart of a method for processing depth image data according to an embodiment of the present invention;
图2表示本发明实施例中数字变焦前的成像示意图;Figure 2 shows a schematic diagram of imaging before digital zooming in an embodiment of the present invention;
图3表示本发明实施例中数字变焦后的成像示意图;FIG. 3 shows a schematic diagram of imaging after digital zooming in an embodiment of the present invention;
图4表示本发明实施例的移动终端的模块示意图;FIG. 4 shows a schematic diagram of modules of a mobile terminal according to an embodiment of the present invention;
图5表示本发明实施例的移动终端框图一;FIG. 5 shows a block diagram 1 of a mobile terminal according to an embodiment of the present invention;
图6表示本发明实施例的移动终端框图二。FIG. 6 shows the second block diagram of the mobile terminal according to the embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本发明的示例性实施例。虽然附图中显示了本发明的示例性实施例,然而应当理解,可以以各种形式实现本发明而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本发明,并且能够将本发明的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the invention may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
如图1所示,本发明的实施例提供了一种深度图像数据的处理方法,该方法具体包括:As shown in FIG. 1, an embodiment of the present invention provides a method for processing depth image data, which specifically includes:
步骤101:获取原始深度图像中目标对象到实际镜头的第一距离。Step 101: Obtain the first distance from the target object to the actual lens in the original depth image.
其中,原始深度图像指的是移动终端的深度相机在对焦后采集到的深度图像,即实际镜头对焦后采集到的深度图像。深度图像又称为距离影像,深度图像中的每一个像素点的深度距离(或称为像素值)表示被拍摄场景中某一对象与移动终端的实际镜头之间的距离。其中,目标对象具有一定的尺寸,因此目标对象到实际镜头的第一距离可以是多个距离;此外,还可以将目标对象等效为一个点,目标对象到实际镜头的第一距离可以是等效点到实际镜头的距离。Wherein, the original depth image refers to the depth image collected by the depth camera of the mobile terminal after focusing, that is, the depth image collected after the actual lens is focused. The depth image is also called a distance image, and the depth distance (or pixel value) of each pixel in the depth image represents the distance between an object in the scene to be photographed and the actual lens of the mobile terminal. Wherein, the target object has a certain size, so the first distance from the target object to the actual lens can be multiple distances; in addition, the target object can also be equivalent to a point, and the first distance from the target object to the actual lens can be equal to The distance from the effective point to the actual lens.
步骤102:在检测到调整移动终端中预览图像大小的数字变焦操作之后,获取目标对象到虚拟镜头的第二距离。Step 102: Acquire a second distance from the target object to the virtual lens after detecting a digital zoom operation for adjusting the size of the preview image in the mobile terminal.
其中,实际应用中在拍摄不同远近的场景时,需要进行变焦操作,但由于移动终端的镜头的光学变焦实现困难,为实现远近场景的变焦操作,可通过数字变焦来实现不同远近场景的对焦效果。在检测到调整移动终端中预览图像大小的数字变焦操作后,进一步获取目标对象到虚拟镜头的第二距离。其中,虚拟镜头为数字变焦后实际镜头的等效镜头。值得指出的是,目标对象具有一定的尺寸,因此目标对象到虚拟镜头的第二距离可以是多个距离;此外,还可以将目标对象等效为一个点,目标对象到虚拟镜头的第二距离可以是等效点到虚拟镜头的距离。Among them, in practical applications, zooming operations are required when shooting scenes of different distances. However, due to the difficulty in realizing optical zooming of the lens of the mobile terminal, in order to realize the zooming operation of far and near scenes, digital zoom can be used to realize the focusing effect of different far and near scenes. . After a digital zoom operation for adjusting the size of the preview image in the mobile terminal is detected, the second distance from the target object to the virtual lens is further acquired. Wherein, the virtual lens is an equivalent lens of the actual lens after digital zooming. It is worth pointing out that the target object has a certain size, so the second distance from the target object to the virtual lens can be multiple distances; in addition, the target object can also be equivalent to a point, and the second distance from the target object to the virtual lens It can be the distance from the equivalent point to the virtual lens.
步骤103:根据第二距离和第一距离,对原始深度图像中目标对象的显示比例进行调整。Step 103: Adjust the display scale of the target object in the original depth image according to the second distance and the first distance.
若第一距离小于第二距离,则将原始深度图像中目标对象的显示比例调大;若第一距离大于第二距离,则将原始深度图像中目标对象的显示比例调小。这样,根据第一距离和第二距离,调整原始深度图像中目标对象的显示比例,以使显示比例接近目标对象的实际视觉中的显示比例,改善显示效果。If the first distance is smaller than the second distance, the display scale of the target object in the original depth image is increased; if the first distance is greater than the second distance, the display scale of the target object in the original depth image is reduced. In this way, according to the first distance and the second distance, the display ratio of the target object in the original depth image is adjusted, so that the display ratio is close to the actual visual display ratio of the target object, and the display effect is improved.
步骤104:根据调整后的深度图像,生成数字变焦后的目标图像。Step 104: Generate a digitally zoomed target image according to the adjusted depth image.
由于调整深度图像是图像进行预览之前的图像处理操作,为得到显示效果接近实际视觉效果的预览图像,还需要根据调整后的深度图像生成数字变焦后的目标图像,这里的目标图像指的是预览图像,亦可理解为最后拍摄到的图像。Since adjusting the depth image is an image processing operation before the image is previewed, in order to obtain a preview image whose display effect is close to the actual visual effect, it is also necessary to generate a digitally zoomed target image based on the adjusted depth image. The target image here refers to the preview An image can also be understood as the last captured image.
其中,为了简化获取目标对象到实际镜头的第一距离的处理复杂度,步骤101具体包括以下步骤:获取原始深度图像中目标对象对应的至少一个像素点的深度距离;根据各个像素点的深度距离,确定对应目标对象到实际镜头的第一距离。由于深度图像中的每一个像素点的深度距离(或称为像素值)表示被拍摄场景中某一对象与移动终端的实际镜头之间的距离,那么获取原始深度图像中目标对象对应的所有像素点的深度距离或从所有像素点抽取出的多个像素点的深度距离,即可获取到这些像素点对应的目标对象到实际镜头之间的第一距离。这样直接根据深度图像中各个像素点的深度距离,即可获取到各个像素点对应的目标对象到实际镜头之间的距离。其中,这里的各个像素点的深度距离可用像素值来表示,另外值得说明的是其他能够表征各个像素点唯一性的值可作为像素值,如各个像素点到实际镜头的距离值。Among them, in order to simplify the processing complexity of obtaining the first distance from the target object to the actual lens, step 101 specifically includes the following steps: obtaining the depth distance of at least one pixel corresponding to the target object in the original depth image; , to determine the first distance from the corresponding target object to the actual lens. Since the depth distance (or pixel value) of each pixel in the depth image represents the distance between an object in the captured scene and the actual lens of the mobile terminal, then obtain all pixels corresponding to the target object in the original depth image The depth distance of the point or the depth distance of multiple pixel points extracted from all the pixel points can obtain the first distance between the target object corresponding to these pixel points and the actual lens. In this way, the distance between the target object corresponding to each pixel and the actual lens can be obtained directly according to the depth distance of each pixel in the depth image. Wherein, the depth distance of each pixel here can be represented by the pixel value, and it is worth noting that other values that can characterize the uniqueness of each pixel can be used as the pixel value, such as the distance value from each pixel to the actual lens.
以上,说明了可根据各个像素点到实际镜头的距离,确定对应目标对象到实际镜头的第一距离。由于一个目标对象对应多个像素点,不同像素点对应的距离不同,因此,如何准确得到目标对象到实际镜头的距离,可分别对所有像素点进行距离的计算和获取。具体地,为降低处理复杂度,可通过以下方式实现:计算各个像素点的深度距离的第一平均距离值;将第一平均距离值对应的距离,确定为目标对象到实际镜头的第一距离。即,将目标对象对应的所有像素点等效为一个像素点,具体可计算各个像素点的深度距离的第一平均距离值,根据第一平均距离值对应的距离,确定为目标对象到实际镜头的第一距离。Above, it has been explained that the first distance from the corresponding target object to the actual lens can be determined according to the distance from each pixel point to the actual lens. Since one target object corresponds to multiple pixels, and different pixel points correspond to different distances, how to accurately obtain the distance from the target object to the actual lens can be calculated and acquired for all pixel points separately. Specifically, in order to reduce the processing complexity, it can be realized in the following ways: calculate the first average distance value of the depth distance of each pixel point; determine the distance corresponding to the first average distance value as the first distance from the target object to the actual lens . That is, all the pixels corresponding to the target object are equivalent to one pixel point. Specifically, the first average distance value of the depth distance of each pixel point can be calculated, and the distance corresponding to the first average distance value can be determined as the distance from the target object to the actual lens. the first distance of .
进一步地,在检测到调整移动终端中预览图像大小的数字变焦操作之后,衍生出变焦后的虚拟镜头,该虚拟镜头为变焦后对应镜头的等效镜头,这时虚拟镜头与实际镜头之间发生一定偏移,产生一偏移距离了。步骤102具体包括:根据数字变焦操作对应的变焦倍数,确定虚拟镜头与实际镜头之间的镜头偏移距离;根据第一距离和镜头偏移距离,确定目标对象到虚拟镜头的第二距离。其中,数字变焦操作对应的变焦倍数不同,虚拟镜头与实际镜头之间的偏移距离不同。Further, after the digital zoom operation for adjusting the size of the preview image in the mobile terminal is detected, a zoomed virtual lens is derived, which is the equivalent lens of the corresponding lens after zooming, and at this time, a gap occurs between the virtual lens and the actual lens. A certain offset produces an offset distance. Step 102 specifically includes: determining the lens offset distance between the virtual lens and the actual lens according to the zoom factor corresponding to the digital zoom operation; determining a second distance from the target object to the virtual lens according to the first distance and the lens offset distance. Wherein, the zoom factor corresponding to the digital zoom operation is different, and the offset distance between the virtual lens and the actual lens is different.
具体地,当数字变焦操作为焦点拉近时,根据第一距离和镜头偏移距离,确定目标对象到虚拟镜头的第二距离的步骤具体为:将第一距离与镜头偏移距离的差值,确定为目标对象到虚拟镜头的第二距离。当数字变焦操作为焦点拉远时,根据第一距离和镜头偏移距离,确定目标对象到虚拟镜头的第二距离的步骤具体为:将第一距离与镜头偏移距离的和值,确定为目标对象到虚拟镜头的第二距离。Specifically, when the digital zoom operation is zooming in on the focus, according to the first distance and the lens offset distance, the step of determining the second distance from the target object to the virtual lens is specifically: calculating the difference between the first distance and the lens offset distance , determined as the second distance from the target object to the virtual lens. When the digital zoom operation is zooming out, according to the first distance and the lens offset distance, the step of determining the second distance from the target object to the virtual lens is specifically: determining the sum of the first distance and the lens offset distance as The second distance from the target object to the virtual camera.
进一步地,步骤103包括:通过第一距离、第二距离和显示比例的计算公式,计算各个目标对象在数字变焦后的成像尺寸;根据成像尺寸,对原始深度图像中目标对象的显示比例进行调整。其中,显示比例的计算公式中包括第一距离和第二距离等距离参数,用于表征数字变焦钱后的成像尺寸关系。Further, step 103 includes: calculating the imaging size of each target object after digital zooming through the calculation formula of the first distance, the second distance and the display scale; adjusting the display scale of the target object in the original depth image according to the imaging size . Wherein, the calculation formula of the display scale includes equidistant parameters of the first distance and the second distance, which are used to characterize the relationship between the imaging dimensions after digital zooming.
其中,通过第一距离、第二距离和显示比例的计算公式,计算各个目标对象在数字变焦后的成像尺寸的步骤包括:Wherein, the step of calculating the imaging size of each target object after digital zooming includes:
通过公式计算各个目标对象在数字变焦后的成像尺寸。by formula Calculate the imaging size of each target object after digital zooming.
其中,H‘1表示目标对象在数字变焦后的成像尺寸,H1表示目标图像在原始深度图像中的成像尺寸,S1表示实际镜头与目标对象之间距离,S2表示目标对象成像距离与S1之间的距离差,S1+S2表示目标对象的成像距离,S’1表示虚拟镜头与目标对象之间距离。Among them, H'1 represents the imaging size of the target object after digital zooming, H1 represents the imaging size of the target image in the original depth image, S1 represents the distance between the actual lens and the target object, S2 represents the distance between the target object imaging distance and The distance difference between S1 , S1 + S2 represents the imaging distance of the target object, and S'1 represents the distance between the virtual lens and the target object.
具体地,以成像高度为例,如图2所示,目标对象在原始深度图像中的高度为G1,实际镜头到目标对象之间的距离为d1,目标对象的成像距离与d1之间的距离差为d2,或者称目标对象到成像背景之间的深度距离为d2。如图3所示,目标对象在数字变焦后的成像高度为G‘1,数字变焦后的虚拟镜头到目标对象之间的距离为d‘1,目标对象的成像距离与d‘1之间的距离差不变,仍为d2,或者说数字变焦前后目标对象到成像背景之间的深度距离不变。依据上述公式,在获取到G1、d1、d2、d‘1后,根据可计算得到G‘1。Specifically, taking the imaging height as an example, as shown in Figure 2, the height of the target object in the original depth image is G1 , the distance between the actual lens and the target object is d1 , and the distance between the imaging distance of the target object and d1 The distance difference between them is d2 , or the depth distance between the target object and the imaging background is d2 . As shown in Figure 3, the imaging height of the target object after digital zooming is G'1 , the distance between the virtual lens and the target object after digital zooming is d'1 , and the distance between the imaging distance of the target object and d'1 The distance difference remains unchanged, which is still d2 , or the depth distance between the target object and the imaging background before and after digital zooming remains unchanged. According to the above formula, after obtaining G1 , d1 , d2 , and d'1 , according to G'1 can be calculated.
从上述公式中可以看出,随着模拟拉近距离d‘1的变小,成像高度G‘1变大。与成像尺寸的高度为例,成像尺寸的宽度或其他方向的尺寸以可采用类似算法计算得到,从而得到较贴近实际视觉效果的缩放尺寸。It can be seen from the above formula that as the simulation distance d'1 becomes smaller, the imaging heightG'1 becomes larger. Taking the height of the imaging size as an example, the width of the imaging size or the dimensions in other directions can be calculated using a similar algorithm, so as to obtain a zoom size that is closer to the actual visual effect.
进一步地,为了进一步优化图像的显示效果,本发明实施例的深度图像数据的处理方法中,在根据调整后的深度图像,生成数字变焦后的目标图像之前,还包括:根据调整后的目标对象,调整原始深度图像中除目标对象之外的其他区域的显示比例。具体可通过以下步骤实现:获取原始深度图像中除目标对象外的其他区域与实际镜头之间的第三距离;检测第三距离与第一距离之间的差值是否低于预设阈值;若低于,则根据对应目标对象的成像尺寸对原始深度图像中的其他区域的显示比例进行调整。Furthermore, in order to further optimize the display effect of the image, in the depth image data processing method of the embodiment of the present invention, before generating the digitally zoomed target image according to the adjusted depth image, it also includes: according to the adjusted target object , to adjust the display scale of other areas in the original depth image except the target object. Specifically, it can be achieved through the following steps: obtaining the third distance between other areas in the original depth image except the target object and the actual lens; detecting whether the difference between the third distance and the first distance is lower than a preset threshold; if If it is lower than that, the display ratio of other regions in the original depth image is adjusted according to the imaging size of the corresponding target object.
也就是说,在确定出取景区域中各个目标对象的缩放比例后,为保证整个图像的显示效果更贴近实际视觉效果,本发明实施例还进一步对目标对象外的背景区域进行显示比例的调整,上述所述的第三距离与第一距离的差值可以是正值亦可以是负值,但其绝对值低于预设阈值时可采用与第一距离对应的目标对象的缩放比例进行显示比例的调整。That is to say, after determining the scaling ratio of each target object in the viewfinder area, in order to ensure that the display effect of the entire image is closer to the actual visual effect, the embodiment of the present invention further adjusts the display ratio of the background area outside the target object, The above-mentioned difference between the third distance and the first distance can be a positive value or a negative value, but when its absolute value is lower than the preset threshold, the scaling ratio of the target object corresponding to the first distance can be used to display the scale adjustment.
本发明实施例的深度图像数据的处理方法中,移动终端通过利用深度相机拍摄获取到原始深度图像,在进行数字变焦时对不同远近的物体的放大效果进行透视修正,从而到更加接近物理距离靠近而产生的透视变化成像效果。In the processing method of depth image data in the embodiment of the present invention, the mobile terminal obtains the original depth image by using the depth camera, and performs perspective correction on the magnification effect of objects at different distances when performing digital zooming, so as to get closer to the physical distance. The resulting perspective change imaging effect.
以上实施例分别详细介绍了不同场景下的深度图像数据的处理方法,下面将结合图4对与其对应的移动终端做进一步介绍。The above embodiments respectively introduce in detail the processing methods of depth image data in different scenarios, and the corresponding mobile terminal will be further introduced below in conjunction with FIG. 4 .
如图4所示,本发明实施例的移动终端400,能实现上述实施例中获取原始深度图像中目标对象到实际镜头的第一距离,在检测到调整移动终端中预览图像大小的数字变焦操作之后,获取目标对象到虚拟镜头的第二距离,根据第二距离和第一距离,对原始深度图像中目标对象的显示比例进行调整,根据调整后的深度图像,生成数字变焦后的目标图像方法的细节,并达到相同的效果,该移动终端400具体包括以下功能模块:As shown in FIG. 4, the mobile terminal 400 of the embodiment of the present invention can realize the first distance from the target object in the original depth image to the actual lens in the above embodiment, and the digital zoom operation of adjusting the size of the preview image in the mobile terminal is detected. Afterwards, obtain the second distance from the target object to the virtual lens, adjust the display ratio of the target object in the original depth image according to the second distance and the first distance, and generate a digitally zoomed target image method according to the adjusted depth image details, and to achieve the same effect, the mobile terminal 400 specifically includes the following functional modules:
第一获取模块410,用于获取原始深度图像中目标对象到实际镜头的第一距离;The first obtaining module 410 is used to obtain the first distance from the target object in the original depth image to the actual lens;
第二获取模块420,用于在检测到调整移动终端中预览图像大小的数字变焦操作之后,获取目标对象到虚拟镜头的第二距离;其中,虚拟镜头为数字变焦后实际镜头的等效镜头;The second obtaining module 420 is used to obtain the second distance from the target object to the virtual lens after detecting the digital zoom operation for adjusting the size of the preview image in the mobile terminal; wherein the virtual lens is an equivalent lens of the actual lens after digital zooming;
第一调整模块430,用于根据第二距离和第一距离,对原始深度图像中目标对象的显示比例进行调整;The first adjustment module 430 is configured to adjust the display ratio of the target object in the original depth image according to the second distance and the first distance;
生成模块440,用于根据调整后的深度图像,生成数字变焦后的目标图像。The generating module 440 is configured to generate a digitally zoomed target image according to the adjusted depth image.
其中,第一获取模块410包括:Wherein, the first acquisition module 410 includes:
第一获取子模块,用于获取原始深度图像中目标对象对应的至少一个像素点的深度距离;The first acquisition sub-module is used to acquire the depth distance of at least one pixel corresponding to the target object in the original depth image;
第一处理子模块,用于根据各个像素点的深度距离,确定对应目标对象到实际镜头的第一距离。The first processing sub-module is configured to determine a first distance from the corresponding target object to the actual lens according to the depth distance of each pixel point.
其中,第一处理子模块包括:Wherein, the first processing submodule includes:
第一计算单元,用于计算各个像素点的深度距离的第一平均距离值;The first calculation unit is used to calculate the first average distance value of the depth distance of each pixel point;
第一处理单元,用于将第一平均距离值对应的距离,确定为目标对象到实际镜头的第一距离。The first processing unit is configured to determine the distance corresponding to the first average distance value as the first distance from the target object to the actual lens.
其中,第二获取模块420包括:Wherein, the second acquisition module 420 includes:
第二获取子模块,用于根据数字变焦操作对应的变焦倍数,确定虚拟镜头与实际镜头之间的镜头偏移距离;The second acquisition sub-module is used to determine the lens offset distance between the virtual lens and the actual lens according to the zoom factor corresponding to the digital zoom operation;
第二处理子模块,用于根据第一距离和镜头偏移距离,确定目标对象到虚拟镜头的第二距离。The second processing sub-module is configured to determine a second distance from the target object to the virtual lens according to the first distance and the lens offset distance.
其中,第二处理子模块包括:Wherein, the second processing submodule includes:
第二处理单元,用于将第一距离与镜头偏移距离的差值,确定为目标对象到虚拟镜头的第二距离。The second processing unit is configured to determine the difference between the first distance and the lens offset distance as a second distance from the target object to the virtual lens.
其中,第一调整模块430包括:Wherein, the first adjustment module 430 includes:
计算子模块,用于通过第一距离、第二距离和显示比例的计算公式,计算各个目标对象在数字变焦后的成像尺寸;The calculation sub-module is used to calculate the imaging size of each target object after digital zooming through the calculation formula of the first distance, the second distance and the display scale;
调整子模块,用于根据成像尺寸,对原始深度图像中目标对象的显示比例进行调整。The adjustment sub-module is used to adjust the display ratio of the target object in the original depth image according to the imaging size.
其中,计算子模块包括:Among them, the calculation sub-module includes:
第二计算单元,用于通过公式计算各个目标对象在数字变焦后的成像尺寸;The second calculation unit, used to pass the formula Calculate the imaging size of each target object after digital zooming;
其中,H‘1表示目标对象在数字变焦后的成像尺寸,H1表示目标图像在原始深度图像中的成像尺寸,S1表示实际镜头与目标对象之间距离,S2表示目标对象成像距离与S1之间的距离差,S1+S2表示目标对象的成像距离,S’1表示虚拟镜头与目标对象之间距离。Among them, H'1 represents the imaging size of the target object after digital zooming, H1 represents the imaging size of the target image in the original depth image, S1 represents the distance between the actual lens and the target object, S2 represents the distance between the target object imaging distance and The distance difference between S1 , S1 + S2 represents the imaging distance of the target object, and S'1 represents the distance between the virtual lens and the target object.
其中,移动终端还包括:Among them, the mobile terminal also includes:
第三获取模块,用于获取原始深度图像中除目标对象外的其他区域与实际镜头之间的第三距离;The third obtaining module is used to obtain the third distance between other areas in the original depth image except the target object and the actual lens;
检测模块,用于检测第三距离与第一距离之间的差值是否低于预设阈值;A detection module, configured to detect whether the difference between the third distance and the first distance is lower than a preset threshold;
第二调整模块,用于当第三距离与第一距离之间的差值低于预设阈值时,根据对应目标对象的成像尺寸对原始深度图像中的其他区域的显示比例进行调整。The second adjustment module is configured to adjust the display ratio of other regions in the original depth image according to the imaging size of the corresponding target object when the difference between the third distance and the first distance is lower than a preset threshold.
值得指出的是,本发明实施例的移动终端是与上述深度图像数据的处理方法对应的移动终端,上述方法的实施方式和实现的技术效果均适用于该移动终端的实施例中。其中,该移动终端通过利用深度相机拍摄获取到原始深度图像,在进行数字变焦时对不同远近的物体的放大效果进行透视修正,从而到更加接近物理距离靠近而产生的透视变化成像效果。It is worth pointing out that the mobile terminal in this embodiment of the present invention is a mobile terminal corresponding to the above method for processing depth image data, and the implementation and technical effects of the above method are applicable to this embodiment of the mobile terminal. Among them, the mobile terminal obtains the original depth image by using the depth camera, and performs perspective correction on the magnification effect of objects at different distances during digital zooming, so as to achieve a perspective change imaging effect closer to the physical distance.
为了更好地实现上述目的,本发明实施例还提供了一种移动终端,包括处理器、存储器以及存储于存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现如上所述的深度图像数据的处理方法中的步骤。本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上所述的深度图像数据的处理方法的步骤。In order to better achieve the above object, an embodiment of the present invention also provides a mobile terminal, including a processor, a memory, and a computer program stored on the memory and operable on the processor. When the processor executes the computer program, the above Steps in the above-mentioned method for processing depth image data. An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned depth image data processing method are realized.
具体地,图5是本发明另一个实施例的移动终端500的框图,如图5所示的移动终端包括:至少一个处理器501、存储器502、网络接口503和用户接口504。移动终端500中的各个组件通过总线系统505耦合在一起。可理解,总线系统505用于实现这些组件之间的连接通信。总线系统505除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图5中将各种总线都标为总线系统505。Specifically, FIG. 5 is a block diagram of a mobile terminal 500 according to another embodiment of the present invention. The mobile terminal shown in FIG. 5 includes: at least one processor 501 , memory 502 , network interface 503 and user interface 504 . Various components in the mobile terminal 500 are coupled together through the bus system 505 . It can be understood that the bus system 505 is used to realize connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for clarity of illustration, the various buses are labeled as bus system 505 in FIG. 5 .
或者,以上各个组件的部分或全部也可以通过现场可编程门阵列(FieldProgrammable Gate Array,简称FPGA)的形式内嵌于该终端的某一个芯片上来实现。且它们可以单独实现,也可以集成在一起。Alternatively, part or all of the above components may also be implemented by being embedded in a certain chip of the terminal in the form of a Field Programmable Gate Array (Field Programmable Gate Array, FPGA for short). And they can be implemented separately or integrated together.
其中,用户接口504分别用于连接外围设备或与外围设备连接的接口电路。可以包括显示器、键盘或者点击设备等设备的接口,例如鼠标,轨迹球(trackball)、触感板或者触摸屏等设备的接口。Wherein, the user interface 504 is respectively used for connecting peripheral devices or an interface circuit connected with peripheral devices. Interfaces of devices such as a display, a keyboard, or a pointing device may be included, for example, interfaces of devices such as a mouse, a trackball (trackball), a touch panel, or a touch screen.
可以理解,处理器501,可以是通用处理器,例如CPU,还可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application SpecificIntegrated Circuit,简称ASIC),或,一个或多个微处理器(digital signal processor,简称DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,简称FPGA)等。存储元件可以是一个存储装置,也可以是多个存储元件的统称。It can be understood that the processor 501 may be a general-purpose processor, such as a CPU, and may also be one or more integrated circuits configured to implement the above method, for example: one or more specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC) , or, one or more microprocessors (digital signal processor, DSP for short), or, one or more field programmable gate arrays (Field Programmable Gate Array, FPGA for short), etc. A storage element may be one storage device, or may be a general term for multiple storage elements.
本发明实施例中的存储器502可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-OnlyMemory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data RateSDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(DirectRambus RAM,DRRAM)。本文描述的系统和方法的存储器502旨在包括但不限于这些和任意其它适合类型的存储器。The memory 502 in the embodiment of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (Read-OnlyMemory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically erasable In addition to programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. The volatile memory can be Random Access Memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data RateSDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synchlink DRAM, SLDRAM) and Direct memory bus random access memory (DirectRambus RAM, DRRAM). Memory 502 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
在一些实施方式中,存储器502存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:操作系统5021和应用程序5022。In some implementations, the memory 502 stores the following elements, executable modules or data structures, or their subsets, or their extended sets: an operating system 5021 and an application program 5022 .
其中,操作系统5021,包含各种系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务。应用程序5022,包含各种应用程序,例如媒体播放器(Media Player)、浏览器(Browser)等,用于实现各种应用业务。实现本发明实施例方法的程序可以包含在应用程序5022中。Among them, the operating system 5021 includes various system programs, such as framework layer, core library layer, driver layer, etc., for realizing various basic services and processing tasks based on hardware. The application program 5022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., and is used to implement various application services. The program for realizing the method of the embodiment of the present invention may be included in the application program 5022 .
在本发明的实施例中,移动终端500还包括:存储在存储器502上并可在处理器501上运行的计算机程序,具体地,可以是应用程序5022中的计算机程序,计算机程序被处理器501执行时实现如下步骤:获取原始深度图像中目标对象到实际镜头的第一距离;在检测到调整移动终端中预览图像大小的数字变焦操作之后,获取目标对象到虚拟镜头的第二距离;其中,虚拟镜头为数字变焦后实际镜头的等效镜头;根据第二距离和第一距离,对原始深度图像中目标对象的显示比例进行调整;根据调整后的深度图像,生成数字变焦后的目标图像。In an embodiment of the present invention, the mobile terminal 500 further includes: a computer program stored in the memory 502 and operable on the processor 501, specifically, it may be a computer program in the application program 5022, and the computer program is executed by the processor 501 The following steps are implemented during execution: obtain the first distance from the target object in the original depth image to the actual lens; after detecting the digital zoom operation for adjusting the size of the preview image in the mobile terminal, obtain the second distance from the target object to the virtual lens; wherein, The virtual lens is equivalent to the actual lens after digital zooming; according to the second distance and the first distance, the display ratio of the target object in the original depth image is adjusted; according to the adjusted depth image, a digital zoomed target image is generated.
上述本发明实施例揭示的方法可以应用于处理器501中,或者由处理器501实现。处理器501可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器501中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器501可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(FieldProgrammable Gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器502,处理器501读取存储器502中的信息,结合其硬件完成上述方法的步骤。The methods disclosed in the foregoing embodiments of the present invention may be applied to the processor 501 or implemented by the processor 501 . The processor 501 may be an integrated circuit chip and has signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 501 or instructions in the form of software. The aforementioned processor 501 may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Program logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps and logic block diagrams disclosed in the embodiments of the present invention may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the methods disclosed in the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502, and completes the steps of the above method in combination with its hardware.
可以理解的是,本文描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(ApplicationSpecific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable LogicDevice,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请功能的其它电子单元或其组合中。It should be understood that the embodiments described herein may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing device (DSP Device, DSPD), programmable logic Equipment (Programmable LogicDevice, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of this application, or in combination.
对于软件实现,可通过执行本文功能的模块(例如过程、函数等)来实现本文的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。For software implementation, the techniques herein can be implemented through modules (eg, procedures, functions, etc.) that perform the functions herein. Software codes can be stored in memory and executed by a processor. Memory can be implemented within the processor or external to the processor.
具体地,计算机程序被处理器501执行时还可实现如下步骤:获取原始深度图像中目标对象对应的至少一个像素点的深度距离;根据各个像素点的深度距离,确定对应目标对象到实际镜头的第一距离。Specifically, when the computer program is executed by the processor 501, the following steps can also be implemented: obtain the depth distance of at least one pixel point corresponding to the target object in the original depth image; determine the distance from the corresponding target object to the actual lens according to the depth distance of each pixel point first distance.
具体地,计算机程序被处理器501执行时还可实现如下步骤:计算各个像素点的深度距离的第一平均距离值;将第一平均距离值对应的距离,确定为目标对象到实际镜头的第一距离。Specifically, when the computer program is executed by the processor 501, the following steps can also be implemented: calculating the first average distance value of the depth distance of each pixel point; determining the distance corresponding to the first average distance value as the first distance from the target object to the actual lens. a distance.
具体地,计算机程序被处理器501执行时还可实现如下步骤:获取根据数字变焦操作对应的变焦倍数,确定虚拟镜头与实际镜头之间的镜头偏移距离;根据第一距离和镜头偏移距离,确定目标对象到虚拟镜头的第二距离。Specifically, when the computer program is executed by the processor 501, the following steps can also be implemented: obtain the zoom factor corresponding to the digital zoom operation, determine the lens offset distance between the virtual lens and the actual lens; , to determine the second distance from the target object to the virtual lens.
进一步地,计算机程序被处理器501执行时还可实现如下步骤:将第一距离与镜头偏移距离的差值,确定为目标对象到虚拟镜头的第二距离。Further, when the computer program is executed by the processor 501, the following steps may be implemented: determining the difference between the first distance and the lens offset distance as the second distance from the target object to the virtual lens.
其中,计算机程序被处理器501执行时还可实现如下步骤:通过第一距离、第二距离和显示比例的计算公式,计算各个目标对象在数字变焦后的成像尺寸;根据成像尺寸,对原始深度图像中目标对象的显示比例进行调整。Wherein, when the computer program is executed by the processor 501, the following steps can also be implemented: calculate the imaging size of each target object after digital zooming through the calculation formula of the first distance, the second distance and the display scale; according to the imaging size, the original depth Adjust the aspect ratio of the target object in the image.
其中,计算机程序被处理器501执行时还可实现如下步骤:通过公式计算各个目标对象在数字变焦后的成像尺寸;Wherein, when the computer program is executed by the processor 501, the following steps can also be realized: through the formula Calculate the imaging size of each target object after digital zooming;
其中,H‘1表示目标对象在数字变焦后的成像尺寸,H1表示目标图像在原始深度图像中的成像尺寸,S1表示实际镜头与目标对象之间距离,S2表示目标对象成像距离与S1之间的距离差,S1+S2表示目标对象的成像距离,S’1表示虚拟镜头与目标对象之间距离。Among them, H'1 represents the imaging size of the target object after digital zooming, H1 represents the imaging size of the target image in the original depth image, S1 represents the distance between the actual lens and the target object, S2 represents the distance between the target object imaging distance and The distance difference between S1 , S1 + S2 represents the imaging distance of the target object, and S'1 represents the distance between the virtual lens and the target object.
其中,计算机程序被处理器501执行时还可实现如下步骤:获取原始深度图像中除目标对象外的其他区域与实际镜头之间的第三距离;检测第三距离与第一距离之间的差值是否低于预设阈值;若低于,则根据对应目标对象的成像尺寸对原始深度图像中的其他区域的显示比例进行调整。Wherein, when the computer program is executed by the processor 501, the following steps can also be implemented: obtaining the third distance between other areas in the original depth image except the target object and the actual lens; detecting the difference between the third distance and the first distance Whether the value is lower than the preset threshold; if lower, adjust the display ratio of other regions in the original depth image according to the imaging size of the corresponding target object.
本发明实施例的移动终端500,通过利用深度相机拍摄获取到原始深度图像,在进行数字变焦时对不同远近的物体的放大效果进行透视修正,从而到更加接近物理距离靠近而产生的透视变化成像效果。The mobile terminal 500 of the embodiment of the present invention obtains the original depth image by using the depth camera, and performs perspective correction on the magnification effect of objects of different distances when performing digital zooming, so as to image perspective changes that are closer to the physical distance. Effect.
图6是本发明另一个实施例的移动终端的结构示意图。具体地,图6中的移动终端600可以是手机、平板电脑、个人数字助理(Personal Digital Assistant,PDA)、或车载电脑等。Fig. 6 is a schematic structural diagram of a mobile terminal according to another embodiment of the present invention. Specifically, the mobile terminal 600 in FIG. 6 may be a mobile phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), or a vehicle-mounted computer.
图6中的移动终端600包括电源610、存储器620、输入单元630、显示单元640、拍照组件650、处理器660、WIFI(Wireless Fidelity)模块670、音频电路680和RF电路690,其中,拍照组件650为深度相机。Mobile terminal 600 in Fig. 6 comprises power supply 610, memory 620, input unit 630, display unit 640, photographing component 650, processor 660, WIFI (Wireless Fidelity) module 670, audio frequency circuit 680 and RF circuit 690, wherein, photographing component 650 is the depth camera.
其中,输入单元630可用于接收用户输入的信息,以及产生与移动终端600的用户设置以及功能控制有关的信号输入。具体地,本发明实施例中,该输入单元630可以包括触控面板631。触控面板631,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板631上的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板631可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给该处理器660,并能接收处理器660发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板631。除了触控面板631,输入单元630还可以包括其他输入设备632,其他输入设备632可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。Wherein, the input unit 630 can be used for receiving information input by a user, and generating signal input related to user setting and function control of the mobile terminal 600 . Specifically, in the embodiment of the present invention, the input unit 630 may include a touch panel 631 . The touch panel 631, also referred to as a touch screen, can collect user's touch operations on or near it (such as the user's operation on the touch panel 631 using any suitable object or accessory such as a finger, a stylus), and The specified program drives the corresponding connected device. Optionally, the touch panel 631 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the to the processor 660, and can receive and execute commands sent by the processor 660. In addition, the touch panel 631 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 631, the input unit 630 may also include other input devices 632, which may include but not limited to physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, etc. one or more of.
其中,显示单元640可用于显示由用户输入的信息或提供给用户的信息以及移动终端的各种菜单界面。显示单元640可包括显示面板641,可选的,可以采用LCD或有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板641。Wherein, the display unit 640 can be used to display information input by the user or information provided to the user and various menu interfaces of the mobile terminal. The display unit 640 may include a display panel 641. Optionally, the display panel 641 may be configured in the form of an LCD or an organic light-emitting diode (Organic Light-Emitting Diode, OLED).
应注意,触控面板631可以覆盖显示面板641,形成触摸显示屏,当该触摸显示屏检测到在其上或附近的触摸操作后,传送给处理器660以确定触摸事件的类型,随后处理器660根据触摸事件的类型在触摸显示屏上提供相应的视觉输出。It should be noted that the touch panel 631 can cover the display panel 641 to form a touch display screen. When the touch display screen detects a touch operation on or near it, it is sent to the processor 660 to determine the type of the touch event, and then the processor 660 provides corresponding visual output on the touch display screen according to the type of the touch event.
触摸显示屏包括应用程序界面显示区及常用控件显示区。该应用程序界面显示区及该常用控件显示区的排列方式并不限定,可以为上下排列、左右排列等可以区分两个显示区的排列方式。该应用程序界面显示区可以用于显示应用程序的界面。每一个界面可以包含至少一个应用程序的图标和/或widget桌面控件等界面元素。该应用程序界面显示区也可以为不包含任何内容的空界面。该常用控件显示区用于显示使用率较高的控件,例如,设置按钮、界面编号、滚动条、电话本图标等应用程序图标等。The touch display screen includes an application program interface display area and a common control display area. The arrangement of the display area of the application program interface and the display area of the commonly used controls is not limited, and may be an arrangement in which the two display areas can be distinguished, such as vertical arrangement, left-right arrangement, and the like. The application program interface display area can be used to display the interface of the application program. Each interface may include at least one interface element such as an icon of an application program and/or a widget desktop control. The application program interface display area can also be an empty interface without any content. The commonly used control display area is used to display controls with a high usage rate, for example, application icons such as setting buttons, interface numbers, scroll bars, and phonebook icons.
其中处理器660是移动终端的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在第一存储器621内的软件程序和/或模块,以及调用存储在第二存储器622内的数据,执行移动终端的各种功能和处理数据,从而对移动终端进行整体监控。可选的,处理器660可包括一个或多个处理单元。Wherein the processor 660 is the control center of the mobile terminal, utilizes various interfaces and lines to connect the various parts of the whole mobile phone, by running or executing the software programs and/or modules stored in the first memory 621, and calling the software programs and/or modules stored in the second memory The data in 622 executes various functions of the mobile terminal and processes data, so as to monitor the mobile terminal as a whole. Optionally, the processor 660 may include one or more processing units.
在本发明实施例中,通过调用存储该第一存储器621内的软件程序和/或模块和/给第二存储器622内的数据,具体用于执行下述步骤:获取原始深度图像中目标对象到实际镜头的第一距离;在检测到调整移动终端中预览图像大小的数字变焦操作之后,获取目标对象到虚拟镜头的第二距离;其中,虚拟镜头为数字变焦后实际镜头的等效镜头;根据第二距离和第一距离,对原始深度图像中目标对象的显示比例进行调整;根据调整后的深度图像,生成数字变焦后的目标图像。In the embodiment of the present invention, by calling the software programs and/or modules stored in the first memory 621 and/or data in the second memory 622, it is specifically used to perform the following steps: acquire the target object in the original depth image to The first distance of the actual lens; after detecting the digital zoom operation to adjust the size of the preview image in the mobile terminal, obtain the second distance from the target object to the virtual lens; wherein, the virtual lens is an equivalent lens of the actual lens after digital zoom; according to The second distance and the first distance are used to adjust the display ratio of the target object in the original depth image; and to generate a digitally zoomed target image according to the adjusted depth image.
具体地,处理器660还用于:获取原始深度图像中目标对象对应的至少一个像素点到实际镜头的距离;根据各个像素点到实际镜头的距离,确定对应目标对象到实际镜头的第一距离。Specifically, the processor 660 is further configured to: obtain the distance from at least one pixel point corresponding to the target object in the original depth image to the actual lens; determine the first distance from the corresponding target object to the actual lens according to the distance from each pixel point to the actual lens .
具体地,处理器660还用于:计算各个像素点到实际镜头的距离的第一平均距离值;将第一平均距离值对应的距离,确定为目标对象到实际镜头的第一距离。Specifically, the processor 660 is further configured to: calculate a first average distance value of the distance from each pixel point to the actual lens; determine the distance corresponding to the first average distance value as the first distance from the target object to the actual lens.
进一步地,处理器660还用于:获取目标对象对应的至少一个像素点到虚拟镜头的距离;根据各个像素点到虚拟镜头的距离,确定对应目标对象到虚拟镜头的第二距离。Further, the processor 660 is further configured to: acquire a distance from at least one pixel point corresponding to the target object to the virtual lens; and determine a second distance from the corresponding target object to the virtual lens according to the distance from each pixel point to the virtual lens.
其中,处理器660还用于:计算各个像素点到虚拟镜头的距离的第二平均距离值;将第二平均距离值对应的距离,确定为目标对象到虚拟镜头的第二距离。Wherein, the processor 660 is further configured to: calculate a second average distance value of the distance from each pixel point to the virtual lens; determine the distance corresponding to the second average distance value as the second distance from the target object to the virtual lens.
其中,处理器660还用于:通过第一距离、第二距离和显示比例的计算公式,计算各个目标对象在数字变焦后的成像尺寸;根据成像尺寸,对原始深度图像中目标对象的显示比例进行调整。Wherein, the processor 660 is also used to: calculate the imaging size of each target object after digital zooming through the calculation formula of the first distance, the second distance and the display ratio; according to the imaging size, the display ratio of the target object in the original depth image Make adjustments.
其中,处理器660还用于:通过公式计算各个目标对象在数字变焦后的成像尺寸;Wherein, the processor 660 is also used to: pass the formula Calculate the imaging size of each target object after digital zooming;
其中,H‘1表示目标对象在数字变焦后的成像尺寸,H1表示目标图像在原始深度图像中的成像尺寸,S1表示实际镜头与目标对象之间距离,S2表示目标对象成像距离与S1之间的距离差,S1+S2表示目标对象的成像距离,S’1表示虚拟镜头与目标对象之间距离。Among them, H'1 represents the imaging size of the target object after digital zooming, H1 represents the imaging size of the target image in the original depth image, S1 represents the distance between the actual lens and the target object, S2 represents the distance between the target object imaging distance and The distance difference between S1 , S1 + S2 represents the imaging distance of the target object, and S'1 represents the distance between the virtual lens and the target object.
其中,处理器660还用于:获取原始深度图像中除目标对象外的其他区域与实际镜头之间的第三距离;检测第三距离与第一距离之间的差值是否低于预设阈值;若低于,则根据对应目标对象的成像尺寸对原始深度图像中的其他区域的显示比例进行调整。Wherein, the processor 660 is also used to: obtain a third distance between other areas in the original depth image except the target object and the actual lens; detect whether the difference between the third distance and the first distance is lower than a preset threshold ; If it is lower than that, adjust the display ratio of other areas in the original depth image according to the imaging size of the corresponding target object.
本发明实施例的移动终端600,通过利用深度相机拍摄获取到原始深度图像,在进行数字变焦时对不同远近的物体的放大效果进行透视修正,从而到更加接近物理距离靠近而产生的透视变化成像效果。The mobile terminal 600 of the embodiment of the present invention obtains the original depth image by using the depth camera, and performs perspective correction on the magnification effect of objects at different distances when performing digital zooming, so as to image perspective changes that are closer to the physical distance. Effect.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk.
以上所述的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明所述的原理前提下还可以作出若干改进和润饰,这些改进和润饰也在本发明的保护范围内。What has been described above is a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, some improvements and modifications can also be made without departing from the principles described in the present invention. within the scope of protection of the invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710617604.4ACN107222737B (en) | 2017-07-26 | 2017-07-26 | A kind of processing method and mobile terminal of depth image data |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710617604.4ACN107222737B (en) | 2017-07-26 | 2017-07-26 | A kind of processing method and mobile terminal of depth image data |
| Publication Number | Publication Date |
|---|---|
| CN107222737Atrue CN107222737A (en) | 2017-09-29 |
| CN107222737B CN107222737B (en) | 2019-05-17 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710617604.4AActiveCN107222737B (en) | 2017-07-26 | 2017-07-26 | A kind of processing method and mobile terminal of depth image data |
| Country | Link |
|---|---|
| CN (1) | CN107222737B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109190469A (en)* | 2018-07-27 | 2019-01-11 | 阿里巴巴集团控股有限公司 | A detection method and device, a computing device and a storage medium |
| CN110827219A (en)* | 2019-10-31 | 2020-02-21 | 北京小米智能科技有限公司 | Training method, device and medium of image processing model |
| CN111739097A (en)* | 2020-06-30 | 2020-10-02 | 上海商汤智能科技有限公司 | Ranging method and device, electronic device and storage medium |
| CN112532839A (en)* | 2020-11-25 | 2021-03-19 | 深圳市锐尔觅移动通信有限公司 | Camera module, imaging method, imaging device and mobile equipment |
| CN114092316A (en)* | 2021-09-29 | 2022-02-25 | 北京旷视科技有限公司 | Image processing method, apparatus and storage medium |
| CN114339018A (en)* | 2020-09-30 | 2022-04-12 | 北京小米移动软件有限公司 | Lens switching method and device and storage medium |
| CN115802150A (en)* | 2022-11-14 | 2023-03-14 | 哲库科技(上海)有限公司 | Image processing method, device, terminal and computer-readable storage medium |
| CN119011796A (en)* | 2024-10-21 | 2024-11-22 | 大连三通科技发展有限公司 | Processing method of environment image data in camera perspective VST, head display device and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102333228A (en)* | 2010-06-14 | 2012-01-25 | Lg电子株式会社 | Electronic device and method of controlling electronic device |
| JP2012160864A (en)* | 2011-01-31 | 2012-08-23 | Sanyo Electric Co Ltd | Imaging apparatus |
| US20130063571A1 (en)* | 2011-09-12 | 2013-03-14 | Canon Kabushiki Kaisha | Image processing apparatus and image processing method |
| CN103824303A (en)* | 2014-03-14 | 2014-05-28 | 格科微电子(上海)有限公司 | Image perspective distortion adjusting method and device based on position and direction of photographed object |
| US20150003819A1 (en)* | 2013-06-28 | 2015-01-01 | Nathan Ackerman | Camera auto-focus based on eye gaze |
| CN105451012A (en)* | 2015-11-18 | 2016-03-30 | 湖南拓视觉信息技术有限公司 | Three-dimensional imaging system and three-dimensional imaging method |
| CN105657237A (en)* | 2014-11-13 | 2016-06-08 | 聚晶半导体股份有限公司 | Image acquisition device and digital zooming method thereof |
| CN105847660A (en)* | 2015-06-01 | 2016-08-10 | 维沃移动通信有限公司 | Dynamic zoom method, device and intelligent device |
| CN205883405U (en)* | 2016-07-29 | 2017-01-11 | 深圳众思科技有限公司 | Automatic chase after burnt device and terminal |
| CN106791375A (en)* | 2016-11-29 | 2017-05-31 | 维沃移动通信有限公司 | One kind shoots focusing method and mobile terminal |
| CN106973222A (en)* | 2017-02-28 | 2017-07-21 | 维沃移动通信有限公司 | The control method and mobile terminal of a kind of Digital Zoom |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102333228A (en)* | 2010-06-14 | 2012-01-25 | Lg电子株式会社 | Electronic device and method of controlling electronic device |
| JP2012160864A (en)* | 2011-01-31 | 2012-08-23 | Sanyo Electric Co Ltd | Imaging apparatus |
| US20130063571A1 (en)* | 2011-09-12 | 2013-03-14 | Canon Kabushiki Kaisha | Image processing apparatus and image processing method |
| US20150003819A1 (en)* | 2013-06-28 | 2015-01-01 | Nathan Ackerman | Camera auto-focus based on eye gaze |
| CN103824303A (en)* | 2014-03-14 | 2014-05-28 | 格科微电子(上海)有限公司 | Image perspective distortion adjusting method and device based on position and direction of photographed object |
| CN105657237A (en)* | 2014-11-13 | 2016-06-08 | 聚晶半导体股份有限公司 | Image acquisition device and digital zooming method thereof |
| CN105847660A (en)* | 2015-06-01 | 2016-08-10 | 维沃移动通信有限公司 | Dynamic zoom method, device and intelligent device |
| CN105451012A (en)* | 2015-11-18 | 2016-03-30 | 湖南拓视觉信息技术有限公司 | Three-dimensional imaging system and three-dimensional imaging method |
| CN205883405U (en)* | 2016-07-29 | 2017-01-11 | 深圳众思科技有限公司 | Automatic chase after burnt device and terminal |
| CN106791375A (en)* | 2016-11-29 | 2017-05-31 | 维沃移动通信有限公司 | One kind shoots focusing method and mobile terminal |
| CN106973222A (en)* | 2017-02-28 | 2017-07-21 | 维沃移动通信有限公司 | The control method and mobile terminal of a kind of Digital Zoom |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109190469A (en)* | 2018-07-27 | 2019-01-11 | 阿里巴巴集团控股有限公司 | A detection method and device, a computing device and a storage medium |
| CN109190469B (en)* | 2018-07-27 | 2020-06-23 | 阿里巴巴集团控股有限公司 | A detection method and device, a computing device and a storage medium |
| CN110827219A (en)* | 2019-10-31 | 2020-02-21 | 北京小米智能科技有限公司 | Training method, device and medium of image processing model |
| CN111739097A (en)* | 2020-06-30 | 2020-10-02 | 上海商汤智能科技有限公司 | Ranging method and device, electronic device and storage medium |
| CN111739097B (en)* | 2020-06-30 | 2024-11-26 | 上海商汤智能科技有限公司 | Distance measurement method and device, electronic device and storage medium |
| CN114339018A (en)* | 2020-09-30 | 2022-04-12 | 北京小米移动软件有限公司 | Lens switching method and device and storage medium |
| CN114339018B (en)* | 2020-09-30 | 2023-08-22 | 北京小米移动软件有限公司 | Method and device for switching lenses and storage medium |
| CN112532839A (en)* | 2020-11-25 | 2021-03-19 | 深圳市锐尔觅移动通信有限公司 | Camera module, imaging method, imaging device and mobile equipment |
| CN114092316A (en)* | 2021-09-29 | 2022-02-25 | 北京旷视科技有限公司 | Image processing method, apparatus and storage medium |
| CN114092316B (en)* | 2021-09-29 | 2025-07-04 | 原力图新(重庆)科技有限公司 | Image processing method, device and storage medium |
| CN115802150A (en)* | 2022-11-14 | 2023-03-14 | 哲库科技(上海)有限公司 | Image processing method, device, terminal and computer-readable storage medium |
| CN115802150B (en)* | 2022-11-14 | 2025-05-30 | 伟光有限公司 | Image processing method, device, terminal and computer readable storage medium |
| CN119011796A (en)* | 2024-10-21 | 2024-11-22 | 大连三通科技发展有限公司 | Processing method of environment image data in camera perspective VST, head display device and storage medium |
| CN119011796B (en)* | 2024-10-21 | 2025-01-17 | 大连三通科技发展有限公司 | Processing method of environmental image data in camera perspective VST, head display device and storage medium |
| Publication number | Publication date |
|---|---|
| CN107222737B (en) | 2019-05-17 |
| Publication | Publication Date | Title |
|---|---|---|
| CN107222737A (en) | The processing method and mobile terminal of a kind of depth image data | |
| CN107395976B (en) | A shooting parameter setting method and mobile terminal | |
| CN107172346B (en) | Virtualization method and mobile terminal | |
| CN107155064B (en) | A kind of image pickup method and mobile terminal | |
| CN105959564B (en) | A kind of photographic method and mobile terminal | |
| CN107395997A (en) | A kind of image pickup method and mobile terminal | |
| CN107181913A (en) | A kind of photographic method and mobile terminal | |
| CN105847674A (en) | Preview image processing method based on mobile terminal, and mobile terminal therein | |
| CN107147837A (en) | A shooting parameter setting method and mobile terminal | |
| CN106648035A (en) | Image resolution adjusting method and mobile terminal | |
| CN106331484B (en) | Focusing method and mobile terminal | |
| CN107172347B (en) | A kind of photographing method and terminal | |
| CN106231178A (en) | A kind of self-timer method and mobile terminal | |
| CN106126108A (en) | A kind of breviary map generalization method and mobile terminal | |
| CN107302655B (en) | It is a kind of to shoot the adjusting method and mobile terminal found a view | |
| CN106101545A (en) | A kind of image processing method and mobile terminal | |
| CN106791375B (en) | A shooting focusing method and mobile terminal | |
| CN106713747A (en) | Focusing method and mobile terminal | |
| CN107509030A (en) | A focusing method and mobile terminal | |
| CN106454086A (en) | Image processing method and mobile terminal | |
| CN106210512A (en) | A kind of photographic head changing method and mobile terminal | |
| CN106888354A (en) | A kind of singlehanded photographic method and mobile terminal | |
| CN107222681B (en) | A kind of processing method and mobile terminal of image data | |
| CN107483821A (en) | Image processing method and mobile terminal | |
| CN107592454A (en) | A kind of image processing method and mobile terminal |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |