[go: up one dir, main page]

CN105931182B - Image zooming method and system - Google Patents

Image zooming method and system Download PDF

Info

Publication number
CN105931182B
CN105931182B CN201610233577.6A CN201610233577A CN105931182B CN 105931182 B CN105931182 B CN 105931182B CN 201610233577 A CN201610233577 A CN 201610233577A CN 105931182 B CN105931182 B CN 105931182B
Authority
CN
China
Prior art keywords
image
mobile terminal
acceleration
preset threshold
absolute value
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.)
Expired - Fee Related
Application number
CN201610233577.6A
Other languages
Chinese (zh)
Other versions
CN105931182A (en
Inventor
俞斌
杨维琴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Jibei Electric Power Co Ltd
Original Assignee
Huizhou TCL Mobile Communication Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN201610233577.6A priority Critical patent/CN105931182B/en
Publication of CN105931182A publication Critical patent/CN105931182A/en
Application granted granted Critical
Publication of CN105931182B publication Critical patent/CN105931182B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4084Scaling of whole images or parts thereof, e.g. expanding or contracting in the transform domain, e.g. fast Fourier transform [FFT] domain scaling

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a method and a system for zooming an image, wherein when the image is displayed on a mobile terminal, the acceleration a of an object in front of the mobile terminal relative to the motion of the mobile terminal is obtained; comparing the absolute value of the acceleration a with a preset threshold, and zooming the image when the absolute value of the acceleration a is greater than the preset threshold, so that a user can zoom in or zoom out the currently displayed image without contacting a mobile terminal, and the problem that partial images are blocked by fingers and the visual effect of the images is influenced because the fingers must touch a touch screen when the images are zoomed in or zoomed out in the prior art is effectively solved; and meanwhile, the touch screen is prevented from being polluted when fingers are dirty.

Description

一种图像的缩放方法及系统Image scaling method and system

技术领域technical field

本发明涉及移动终端技术领域,尤其涉及一种图像的缩放方法及系统。The present invention relates to the technical field of mobile terminals, in particular to an image scaling method and system.

背景技术Background technique

在现有技术中,对于图像的放大缩小的操作均是通过触摸屏来实现的,常见的通过触摸屏操作来放大缩小图像的方法有两种:In the prior art, the operation of zooming in and out of the image is realized through the touch screen, and there are two common methods for zooming in and out of the image through the operation of the touch screen:

一种:在触摸屏上设置一条可左右移动的滑动条,譬如向左滑动则放大图像,向右滑动则缩小图像;另一种:触摸图像上任意两个点,通过滑动这两点,使两点间的距离发生改变,当两点间距离变小时缩小图像,当两点间距离变大时放大图像。One: set a sliding bar on the touch screen that can move left and right, for example, slide to the left to enlarge the image, and slide to the right to zoom out; the other: touch any two points on the image, and slide the two points to make the two The distance between the points changes, shrinking the image when the distance between the two points becomes smaller, and zooming in when the distance between the two points becomes larger.

上述两种方法均是通过触摸屏来进行对图像放大或缩小的操作,其存在以下缺陷:1.由于放大或缩小图像时,手指必须触摸触摸屏,因此有部分图像必然会被手指遮挡住,影响图像的视觉效果;2.当手指较脏但需要放大或缩小图像时,将会污染触摸屏。Both of the above two methods use the touch screen to enlarge or reduce the image, which has the following defects: 1. Since the finger must touch the touch screen when the image is enlarged or reduced, part of the image will inevitably be blocked by the finger, affecting the image quality. 2. When the finger is dirty but the image needs to be enlarged or reduced, it will pollute the touch screen.

因此,现有技术还有待于改进和发展。Therefore, the prior art still needs to be improved and developed.

发明内容Contents of the invention

本发明要解决的技术问题在于,针对现有技术的上述缺陷,提供一种图像的缩放方法及系统,手指与移动终端的触摸屏无需接触也可实现对图像的缩放处理,以解决现有技术中必须通过手指接触触摸屏来缩放图像而导致的手指遮挡影响图像的视觉效果、污染触摸屏的技术问题。The technical problem to be solved by the present invention is to provide an image zooming method and system for the above-mentioned defects of the prior art. The zooming process of the image can be realized without contact between the finger and the touch screen of the mobile terminal, so as to solve the problems in the prior art. It is necessary to touch the touch screen with the finger to zoom the image, and the finger occlusion affects the visual effect of the image and pollutes the technical problem of the touch screen.

本发明解决技术问题所采用的技术方案如下:The technical solution adopted by the present invention to solve technical problems is as follows:

一种图像的缩放方法,其应用于具有接近传感器的移动终端,其中,包括步骤:A method for zooming an image, which is applied to a mobile terminal with a proximity sensor, comprising the steps of:

A、当移动终端显示图像时,获取移动终端前方的物体相对于移动终端运动的加速度a;A. When the mobile terminal displays an image, acquire the acceleration a of the object in front of the mobile terminal relative to the movement of the mobile terminal;

B、将加速度a的绝对值与预设阈值进行比较,当所述加速度a的绝对值大于预设阈值时,对图像进行缩放处理。B. Comparing the absolute value of the acceleration a with a preset threshold, and performing scaling processing on the image when the absolute value of the acceleration a is greater than the preset threshold.

所述的图像的缩放方法,其中,所述步骤A具体包括:The zooming method of the image, wherein, the step A specifically includes:

A1、当移动终端显示图像时,依次获取物体与移动终端之间的距离L1,L2和L3,以及所述距离L1,L2和L3对应的时间T1,T2和T3;A1. When the mobile terminal displays an image, sequentially acquire the distances L1, L2 and L3 between the object and the mobile terminal, and the times T1, T2 and T3 corresponding to the distances L1, L2 and L3;

A2、根据所述距离L1,L2,L3和时间T1,T2,T3,计算加速度a。A2. Calculate the acceleration a according to the distances L1, L2, L3 and times T1, T2, T3.

所述的图像的缩放方法,其中,所述加速度a的计算公式为:The zooming method of the image, wherein, the calculation formula of the acceleration a is:

a=a= .

所述的图像的缩放方法,其中,所述步骤A还包括:The zooming method of the image, wherein, the step A also includes:

获取所述物体相对于移动终端的运动方向,其中,物体接近移动终端的运动方向为正方向,物体远离移动终端的运动方向为负方向。The moving direction of the object relative to the mobile terminal is acquired, wherein the moving direction of the object approaching the mobile terminal is a positive direction, and the moving direction of the object moving away from the mobile terminal is a negative direction.

所述的图像的缩放方法,其中,所述步骤B具体为:The zooming method of the image, wherein, the step B is specifically:

当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行缩小处理;When the absolute value of the acceleration a is greater than a preset threshold, and the moving direction of the object is a positive direction, the image is reduced;

当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行放大处理。When the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is negative, the image is enlarged.

所述图像的缩放方法,其中,所述步骤B具体为:The zooming method of the image, wherein, the step B is specifically:

当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行缩小处理;When the absolute value of the acceleration a is greater than a preset threshold, and the moving direction of the object is in a negative direction, the image is reduced;

当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行放大处理。When the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is positive, the image is enlarged.

所述的图像的缩放方法,其中,所述步骤B中对所述图像进行缩放处理具体为:The zooming method of the image, wherein, performing zooming processing on the image in the step B is specifically:

对所述图像进行|a-ath|/ath倍的缩放处理,其中ath为所述预设阈值。Perform scaling processing on the image by a factor of |a-ath|/ath, where ath is the preset threshold.

一种图像的缩放系统,其中,包括:An image scaling system, including:

加速度获取模块,用于当移动终端显示图像时,获取移动终端前方的物体相对于移动终端运动的加速度a;The acceleration acquisition module is used to acquire the acceleration a of the object in front of the mobile terminal relative to the motion of the mobile terminal when the mobile terminal displays an image;

运动方向获取模块,用于获取所述物体相对于移动终端的运动方向,其中,物体接近移动终端的运动方向为正方向,物体远离移动终端的运动方向为负方向;A movement direction acquiring module, configured to acquire the movement direction of the object relative to the mobile terminal, wherein the movement direction of the object approaching the mobile terminal is a positive direction, and the movement direction of the object away from the mobile terminal is a negative direction;

处理模块,用于将加速度a的绝对值与预设阈值进行比较,当所述加速度a的绝对值大于预设阈值时,对图像进行缩放处理。A processing module, configured to compare the absolute value of the acceleration a with a preset threshold, and when the absolute value of the acceleration a is greater than the preset threshold, zoom the image.

所述的图像的缩放系统,其中,处理模块具体包括:The zooming system of the image, wherein, the processing module specifically includes:

图像缩小处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行缩小处理;An image reduction processing unit, configured to perform reduction processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is a positive direction;

图像放大处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行放大处理。The image magnification processing unit is configured to perform magnification processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is negative.

所述的图像的缩放系统,其中,处理模块具体包括:The zooming system of the image, wherein, the processing module specifically includes:

图像缩小处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行缩小处理;An image reduction processing unit, configured to perform reduction processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is a negative direction;

图像放大处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行放大处理。An image magnification processing unit, configured to perform magnification processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is a positive direction.

有益效果:与现有技术相比,本发明通过当移动终端显示图像时,获取移动终端前方的物体相对于移动终端运动的加速度a;将加速度a的绝对值与预设阈值进行比较,当所述加速度a的绝对值大于预设阈值时,对图像进行缩放处理,使用户无需接触移动终端就可以对当前显示图像进行放大或缩小,有效的避免了现有技术中由于放大或缩小图像时,手指必须触摸触摸屏,导致部分图像会被手指遮挡住,影响图像的视觉效果的问题;同时也避免在手指较脏时污染触摸屏。Beneficial effects: Compared with the prior art, the present invention obtains the acceleration a of the object in front of the mobile terminal relative to the movement of the mobile terminal when the mobile terminal displays an image; compares the absolute value of the acceleration a with a preset threshold, and when the When the absolute value of the acceleration a is greater than the preset threshold, the image is zoomed, so that the user can zoom in or zoom out the currently displayed image without touching the mobile terminal, effectively avoiding the problem of zooming in or zooming out the image in the prior art. Fingers must touch the touch screen, causing part of the image to be blocked by the finger, which affects the visual effect of the image; meanwhile, it also avoids polluting the touch screen when the finger is dirty.

附图说明Description of drawings

图1是本发明所述图像的缩放方法的第一较佳实施例的流程图;Fig. 1 is the flow chart of the first preferred embodiment of the scaling method of image described in the present invention;

图2是本发明所述图像的缩放方法的第二较佳实施例的流程图;Fig. 2 is the flow chart of the second preferred embodiment of the scaling method of the image described in the present invention;

图3是本发明所述图像的缩放系统的较佳实施例的功能原理框图。Fig. 3 is a functional principle block diagram of a preferred embodiment of the image scaling system of the present invention.

具体实施方式Detailed ways

本发明提供的一种图像的缩放方法及系统,为使本发明的目的、技术方案及优点更加清楚、明确,以下参照附图并举实施例对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。The present invention provides an image scaling method and system. In order to make the purpose, technical solution and advantages of the present invention clearer and clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

下面结合附图,通过对实施例的描述,对发明内容作进一步说明。The content of the invention will be further described below by describing the embodiments in conjunction with the accompanying drawings.

请参见图1,图1是本发明所述图像的缩放方法的较佳实施例的流程图。所述图像的缩放方法包括:Please refer to FIG. 1 . FIG. 1 is a flow chart of a preferred embodiment of the image scaling method of the present invention. The scaling method of the image includes:

步骤S100、当移动终端显示图像时,获取移动终端前方的物体相对于移动终端运动的加速度a。Step S100, when the mobile terminal displays an image, acquire the acceleration a of the object in front of the mobile terminal relative to the movement of the mobile terminal.

所述移动终端为iPad、掌上电脑、手机等智能移动终端设备。本发明实施例中,预先在所述移动终端上设置一接近传感器,用于实时检测物体的移动信息,且用户在所述移动终端上输入打开图像的图像触发指令,所述移动终端接收图像触发指令后,对图像进行显示,然后用户就可以根据本发明提供的图像的缩放方法来实现移动终端所显示的图像的缩放。The mobile terminal is an intelligent mobile terminal device such as an iPad, a handheld computer, or a mobile phone. In the embodiment of the present invention, a proximity sensor is pre-set on the mobile terminal to detect the movement information of the object in real time, and the user inputs an image trigger instruction to open an image on the mobile terminal, and the mobile terminal receives the image trigger After the instruction, the image is displayed, and then the user can realize the zooming of the image displayed on the mobile terminal according to the image zooming method provided by the present invention.

如图2所示,步骤S100中具体包括:As shown in Figure 2, step S100 specifically includes:

步骤S101、当移动终端显示图像时,依次获取物体与移动终端之间的距离L1,L2和L3,以及所述距离L1,L2和L3对应的时间T1,T2和T3;Step S101, when the mobile terminal displays an image, sequentially acquire the distances L1, L2 and L3 between the object and the mobile terminal, and the times T1, T2 and T3 corresponding to the distances L1, L2 and L3;

步骤S102、根据所述距离L1,L2,L3和时间T1,T2,T3,计算加速度a。Step S102 , calculating acceleration a according to the distances L1 , L2 , L3 and times T1 , T2 , T3 .

当所述移动终端接收用户输入的图像触发指令对图像进行显示后,移动终端即可以根据移动终端前方的物体相对于移动终端的运动情况对图像进行相应的缩放处理。由于移动终端上设置的接近传感器可以实时检测移动终端前方物体的运动情况,本发明中移动终端对接近传感器实时检测到的物体与移动终端之间的距离及距离对应的时间进行记录,并依次间隔选取三个时刻,及在三个时刻分别对应的物体与移动终端之间的距离。较佳的实施例,本发明中在依次获取的物体与移动终端之间的距离中,间隔选取T1,T2和T3三个时刻,以及在T1,T2和T3时刻分别对应的物体与移动终端之间的距离L1,L2和L3,其中,T1时刻早于T2时刻,T2时刻早于T3时刻,然后,根据所述距离L1,L2,L3和时间T1,T2,T3,计算加速度a(L1,L2,L3均在接近传感器可以检测到的范围之内)。After the mobile terminal receives an image trigger instruction input by the user to display the image, the mobile terminal can perform corresponding scaling processing on the image according to the movement of the object in front of the mobile terminal relative to the mobile terminal. Since the proximity sensor provided on the mobile terminal can detect the movement of the object in front of the mobile terminal in real time, the mobile terminal in the present invention records the distance between the object detected by the proximity sensor in real time and the mobile terminal and the time corresponding to the distance, and selects at intervals successively. Three moments, and the distances between the objects and the mobile terminal respectively corresponding to the three moments. In a preferred embodiment, in the present invention, among the distances between the objects and the mobile terminal that are sequentially obtained, three moments T1, T2 and T3 are selected at intervals, and the distances between the objects corresponding to the moments T1, T2 and T3 and the mobile terminal are respectively The distances L1, L2 and L3 between, wherein, the T1 moment is earlier than the T2 moment, and the T2 moment is earlier than the T3 moment, and then, according to the distance L1, L2, L3 and the time T1, T2, T3, calculate the acceleration a (L1, Both L2 and L3 are within the detection range of the proximity sensor).

所述加速度a的计算公式为:The formula for calculating the acceleration a is:

a= a=

其中,(L2-L1)/(T2-T1)为:在T1时刻至T2时刻之间的时间段内,物体相对于移动终端的位移(L2-L1)与所用时间的比值,即在T1时刻至T2时刻之间,物体相对于移动终端运动的平均速度;Among them, (L2-L1)/(T2-T1) is: the ratio of the displacement (L2-L1) of the object relative to the mobile terminal to the elapsed time during the time period between T1 and T2, that is, at T1 Between the time T2 and the average speed of the object moving relative to the mobile terminal;

(L3-L2)/(T3-T2)为:在T2时刻至T3时刻之间的时间段内,物体相对于移动终端的位移(L3-L2)与所用时间的比值,即在T2时刻至T3时刻之间,物体相对于移动终端运动的平均速度;(L3-L2)/(T3-T2) is: the ratio of the displacement (L3-L2) of the object relative to the mobile terminal to the elapsed time during the period from T2 to T3, that is, from T2 to T3 Between moments, the average speed of the object moving relative to the mobile terminal;

(T2-T1)/2为:T1时刻至T2时刻之间的中间时刻;(T2-T1)/2 is: the intermediate time between T1 time and T2 time;

(T3-T2)/2为:T3时刻至T2时刻之间的中间时刻。(T3-T2)/2 is: the intermediate time between the time T3 and the time T2.

因此,本发明中为实现图像的缩放所需要获取的加速度a为:移动终端通过接近传感器依次获取的时间T1,T2和T3中,(T2-T1)/2与(T3-T2)/2之间的单位之间内,物体相对于移动终端运动的速度的改变量。Therefore, in the present invention, the acceleration a that needs to be obtained to realize image zooming is: the time T1, T2 and T3 that the mobile terminal obtains sequentially through the proximity sensor, between (T2-T1)/2 and (T3-T2)/2 The amount of change in the speed of the object moving relative to the mobile terminal within the unit of time.

步骤S200、将加速度a的绝对值与预设阈值进行比较,当所述加速度a的绝对值大于预设阈值时,对图像进行缩放处理。Step S200 , comparing the absolute value of the acceleration a with a preset threshold, and when the absolute value of the acceleration a is greater than the preset threshold, perform scaling processing on the image.

预先设置一用于判断是否对移动终端中当前显示的图像进行缩放处理的预设阈值ath,并将获取的加速度a与所述预设阈值ath进行比较,当所述加速度a的绝对值大于预设阈值ath时,对图像进行缩放处理。加速度用于表示一个物体相对于另一个物体在单位时间内运动的速度改变程度,因此,物体相对于移动终端的运动既包括加速运动又包括减速运动,而本发明中,无论物体相对于移动终端是进行加速运动还是减速运动,只要(T2-T1)/2时刻与(T3-T2)/2时刻之间的单位之间内,物体相对于移动终端运动的速度的改变量的绝对值大于所述预设阈值ath,即加速度的绝对值|a|大于所化预设阈值ath,移动终端就对当前显示图像进行缩放处理。通过接近传感器对移动终端前方物体运动情况的检测,获取加速度从而决定对图像的缩放处理,只需设置接近传感器,而无需对移动终端进行过多的设备改进,步骤简单,用户可以使用手指或者手握物体在移动终端的前方进行运动即可,操作和计算方便,有效的避免了使用手指接触屏幕来调整图像的大小而导致的手指遮挡影响图像的视觉效果、污染触摸屏的问题。Presetting a preset threshold value ath for judging whether to perform scaling processing on the image currently displayed in the mobile terminal, and comparing the acquired acceleration a with the preset threshold value ath, when the absolute value of the acceleration a is greater than the preset threshold When the threshold ath is set, the image is scaled. Acceleration is used to indicate the degree of change in the speed of one object relative to another object in unit time. Therefore, the motion of an object relative to the mobile terminal includes both acceleration and deceleration. In the present invention, no matter whether the object is relative to the mobile terminal Whether to perform acceleration movement or deceleration movement, as long as the absolute value of the change in the speed of the object relative to the movement of the mobile terminal is greater than The preset threshold ath, that is, the absolute value |a| of the acceleration is greater than the preset threshold ath, and the mobile terminal performs scaling processing on the currently displayed image. The proximity sensor detects the motion of the object in front of the mobile terminal, and obtains the acceleration to determine the zoom processing of the image. It only needs to set the proximity sensor without making too many equipment improvements to the mobile terminal. The steps are simple, and the user can use fingers or hands It is only necessary to hold the object in front of the mobile terminal to move, which is convenient for operation and calculation, and effectively avoids the problem of finger occlusion affecting the visual effect of the image and polluting the touch screen caused by using the finger to touch the screen to adjust the size of the image.

进一步的,移动终端前方的物体相对于移动终端的运动包括两个方向的运动:一种是物体由远及近的向靠近移动终端的方向运动;另一种是物体由近及远的向远离移动终端的方向运动。本发明中当所述加速度a的绝对值大于预设阈值时,移动终端根据其前方的物体相对于其的运动方向来判定对当前显示图像进行何种处理。由于接近传感器可以实时获取移动终端前方物体在相对于移动终端运动的过程中,物体与移动终端时间的距离,因此当接近传感器获取到的物体与移动终端之间的距离依次增大时,即可判定物体由近及远的向远离移动终端的方向运动;当接近传感器获取到的物体与移动终端之间的距离依次减小时,即可判定物体由远及近的向靠近移动终端的方向运动。较佳的,预先设定物体接近移动终端的运动方向为正方向,物体远离移动终端的运动方向为负方向。移动终端只需根据物体相对于移动终端的运动方向即可判定对当前显示图像进行何种处理,反应灵敏,计算简单,当用户是老人或小孩时也可快速掌握操作方法,从而为用户提供了方便。Further, the movement of the object in front of the mobile terminal relative to the mobile terminal includes two directions of movement: one is that the object moves from far to near to the mobile terminal; the other is that the object moves from near to far to far away Orientation movement of the mobile terminal. In the present invention, when the absolute value of the acceleration a is greater than the preset threshold, the mobile terminal determines what kind of processing is to be performed on the currently displayed image according to the moving direction of the object in front of it relative to it. Since the proximity sensor can obtain the time distance between the object and the mobile terminal in real time during the movement of the object in front of the mobile terminal relative to the mobile terminal, when the distance between the object and the mobile terminal acquired by the proximity sensor increases sequentially, the It is determined that the object moves from near to far away from the mobile terminal; when the distance between the object and the mobile terminal acquired by the proximity sensor decreases in turn, it can be determined that the object moves from far to near to the mobile terminal. Preferably, the moving direction of the object approaching the mobile terminal is preset as a positive direction, and the moving direction of the object moving away from the mobile terminal is set as a negative direction. The mobile terminal only needs to judge the processing of the currently displayed image according to the moving direction of the object relative to the mobile terminal. The response is sensitive and the calculation is simple. When the user is an old man or a child, he can quickly grasp the operation method, thus providing the user with convenient.

较佳的实施例一,当所述加速度a的绝对值大于预设阈值,并且移动终端获取到的其前方物体相对于其的运动方向为正方向时,移动终端对图像进行缩小处理;当所述加速度a的绝对值大于预设阈值,并且移动终端获取到的其前方物体相对于其的运动方向为负方向时,对图像进行放大处理。In a preferred embodiment 1, when the absolute value of the acceleration a is greater than a preset threshold, and the mobile terminal acquires that the moving direction of the object in front of it relative to it is a positive direction, the mobile terminal shrinks the image; when the When the absolute value of the acceleration a is greater than the preset threshold, and the mobile terminal acquires that the moving direction of the object in front of it relative to it is a negative direction, the image is enlarged.

较佳的实施例二,当所述加速度a的绝对值大于预设阈值,并且移动终端获取到的其前方物体相对于其的运动方向为负方向时,对图像进行缩小处理;当所述加速度a的绝对值大于预设阈值,并且移动终端获取到的其前方物体相对于其的运动方向为正方向时,移动终端对图像进行放大处理。In the second preferred embodiment, when the absolute value of the acceleration a is greater than a preset threshold, and the mobile terminal acquires that the moving direction of the object in front of it is in a negative direction, the image is reduced; when the acceleration When the absolute value of a is greater than the preset threshold, and the moving direction of the object in front of the mobile terminal relative to it acquired by the mobile terminal is a positive direction, the mobile terminal zooms in on the image.

当所述加速度a的绝对值不大于预设阈值时,移动终端对当前显示图像不进行任何处理。When the absolute value of the acceleration a is not greater than the preset threshold, the mobile terminal does not perform any processing on the currently displayed image.

进一步的,对所述图像进行放大和缩小的倍数为|a-ath|/ath倍,即当移动终端对图像进行放大处理时,将当前图像放大为当前显示大小的|a-ath|/ath倍;当移动终端对图像进行缩小处理时,将当前图像缩小为当前显示大小的|a-ath|/ath倍。本发明中移动终端对当前显示图像进行|a-ath|/ath倍的调整,在不影响图片质量的前提下,使得用户可以适度放大和缩小图像,满足用户放大查看图像细节和查看图像原图尺寸的需求。Further, the multiple of zooming in and out of the image is |a-ath|/ath times, that is, when the mobile terminal zooms in on the image, the current image is zoomed in to |a-ath|/ath of the current display size times; when the mobile terminal shrinks the image, the current image will be reduced to |a-ath|/ath times of the current display size. In the present invention, the mobile terminal adjusts the currently displayed image by |a-ath|/ath times, so that the user can moderately zoom in and zoom out the image without affecting the quality of the picture, so that the user can zoom in to view the details of the image and the size of the original image demand.

较佳的实施例,本发明中还可以在所述移动终端上设置一用于控制所述接近传感器开启和关闭的传感器开关,使得用户可以在想对图像进行缩放时再开启所述接近传感器,从而避免出现在接近传感器一直处于开启状态,用户并未想对图像进行缩放时,有物体在移动终端前方运动并满足图像缩放条件而导致移动终端对图像进行的缩放处理,同时可以减少由于接近传感器一直开启所产生的能耗。In a preferred embodiment, in the present invention, a sensor switch for controlling the opening and closing of the proximity sensor can also be set on the mobile terminal, so that the user can turn on the proximity sensor when he wants to zoom the image, In this way, when the proximity sensor is always on and the user does not want to zoom the image, there is an object moving in front of the mobile terminal and meeting the image zoom conditions, which will cause the mobile terminal to zoom the image. The energy consumption generated by always on.

基于上述方法实施例,本发明还提供了一种图像的缩放系统,如图3所示,所述系统包括:Based on the above method embodiment, the present invention also provides an image scaling system, as shown in FIG. 3, the system includes:

加速度获取模块10,用于当移动终端显示图像时,获取移动终端前方的物体相对于移动终端运动的加速度a;具体如上所述。The acceleration acquisition module 10 is configured to acquire the acceleration a of the object in front of the mobile terminal relative to the movement of the mobile terminal when the mobile terminal displays an image; the details are as described above.

运动方向获取模块20,用于获取所述物体相对于移动终端的运动方向,其中,物体接近移动终端的运动方向为正方向,物体远离移动终端的运动方向为负方向;具体如上所述。The moving direction acquisition module 20 is configured to acquire the moving direction of the object relative to the mobile terminal, wherein the moving direction of the object approaching the mobile terminal is a positive direction, and the moving direction of the object moving away from the mobile terminal is a negative direction; specifically as described above.

处理模块30,用于将加速度a的绝对值与预设阈值进行比较,当所述加速度a的绝对值大于预设阈值时,对图像进行缩放处理;具体如上所述。The processing module 30 is configured to compare the absolute value of the acceleration a with a preset threshold, and when the absolute value of the acceleration a is greater than the preset threshold, zoom the image; specifically as described above.

进一步的,所述处理模块具体包括:Further, the processing module specifically includes:

图像缩小处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行缩小处理;具体如上所述。An image reduction processing unit, configured to perform reduction processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is a positive direction; specifically as described above.

图像放大处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行放大处理;具体如上所述。An image magnification processing unit, configured to perform magnification processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is in a negative direction; specifically as described above.

进一步的,所述处理模块具体包括:Further, the processing module specifically includes:

图像缩小处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行缩小处理;具体如上所述。An image reduction processing unit, configured to perform reduction processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is in a negative direction; specifically as described above.

图像放大处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行放大处理;具体如上所述。An image magnification processing unit, configured to perform magnification processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is a positive direction; specifically as described above.

综上所述,本发明所提供了一种图像的缩放方法及系统,当移动终端显示图像时,获取移动终端前方的物体相对于移动终端运动的加速度a;将加速度a的绝对值与预设阈值进行比较,当所述加速度a的绝对值大于预设阈值时,对图像进行缩放处理,使用户无需接触移动终端就可以对当前显示图像进行放大或缩小,有效的避免了现有技术中由于放大或缩小图像时,手指必须触摸触摸屏,导致部分图像会被手指遮挡住,影响图像的视觉效果的问题;同时也避免在手指较脏时污染触摸屏。To sum up, the present invention provides an image scaling method and system. When the mobile terminal displays an image, the acceleration a of the object in front of the mobile terminal relative to the movement of the mobile terminal is acquired; the absolute value of the acceleration a is compared with the preset Threshold, when the absolute value of the acceleration a is greater than the preset threshold, the image will be scaled, so that the user can zoom in or out the currently displayed image without touching the mobile terminal, effectively avoiding the When zooming in or zooming out the image, the finger must touch the touch screen, causing part of the image to be blocked by the finger, which affects the visual effect of the image; meanwhile, it also avoids polluting the touch screen when the finger is dirty.

应当理解的是,本发明的应用不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本发明所附权利要求的保护范围。It should be understood that the application of the present invention is not limited to the above examples, and those skilled in the art can make improvements or transformations according to the above descriptions, and all these improvements and transformations should belong to the protection scope of the appended claims of the present invention.

Claims (10)

1.一种图像的缩放方法,其应用于具有接近传感器的移动终端,其特征在于,包括步骤:1. A zooming method of an image, which is applied to a mobile terminal with a proximity sensor, is characterized in that, comprising steps: A、当移动终端显示图像时,获取移动终端前方的物体相对于移动终端运动的加速度a;A. When the mobile terminal displays an image, acquire the acceleration a of the object in front of the mobile terminal relative to the movement of the mobile terminal; B、将加速度a的绝对值与预设阈值进行比较,当所述加速度a的绝对值大于预设阈值时,对图像进行缩放处理;B. Comparing the absolute value of the acceleration a with a preset threshold, and performing scaling processing on the image when the absolute value of the acceleration a is greater than the preset threshold; 移动终端上设置有用于控制所述接近传感器开启和关闭的传感器开关;The mobile terminal is provided with a sensor switch for controlling the opening and closing of the proximity sensor; 当所述加速度a的绝对值不大于预设阈值时,对图像不进行处理。When the absolute value of the acceleration a is not greater than the preset threshold, the image is not processed. 2.根据权利要求1所述的图像的缩放方法,其特征在于,所述步骤A具体包括:2. The image scaling method according to claim 1, wherein the step A specifically comprises: A1、当移动终端显示图像时,依次获取物体与移动终端之间的距离L1,L2和L3,以及所述距离L1,L2和L3对应的时间T1,T2和T3;A1. When the mobile terminal displays an image, sequentially acquire the distances L1, L2 and L3 between the object and the mobile terminal, and the times T1, T2 and T3 corresponding to the distances L1, L2 and L3; A2、根据所述距离L1,L2,L3和时间T1,T2,T3,计算加速度a。A2. Calculate the acceleration a according to the distances L1, L2, L3 and times T1, T2, T3. 3.根据权利要求2所述的图像的缩放方法,其特征在于,所述加速度a的计算公式为:3. the scaling method of image according to claim 2, is characterized in that, the computing formula of described acceleration a is: a=a= . 4.根据权利要求1所述的图像的缩放方法,其特征在于,所述步骤A还包括:4. The zooming method of an image according to claim 1, wherein said step A further comprises: 获取所述物体相对于移动终端的运动方向,其中,物体接近移动终端的运动方向为正方向,物体远离移动终端的运动方向为负方向。The moving direction of the object relative to the mobile terminal is acquired, wherein the moving direction of the object approaching the mobile terminal is a positive direction, and the moving direction of the object moving away from the mobile terminal is a negative direction. 5.根据权利要求4所述的图像的缩放方法,其特征在于,所述步骤B具体为:5. The zooming method of an image according to claim 4, wherein the step B is specifically: 当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行缩小处理;When the absolute value of the acceleration a is greater than a preset threshold, and the moving direction of the object is a positive direction, the image is reduced; 当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行放大处理。When the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is negative, the image is enlarged. 6.根据权利要求4所述的图像的缩放方法,其特征在于,所述步骤B具体为:6. The zooming method of an image according to claim 4, wherein the step B is specifically: 当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行缩小处理;When the absolute value of the acceleration a is greater than a preset threshold, and the moving direction of the object is in a negative direction, the image is reduced; 当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行放大处理。When the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is positive, the image is enlarged. 7.根据权利要求1所述的图像的缩放方法,其特征在于,所述步骤B中对所述图像进行缩放处理具体为:7. The image scaling method according to claim 1, characterized in that, performing scaling processing on the image in the step B is specifically: 对所述图像进行|a-ath|/ath倍的缩放处理,其中ath为所述预设阈值。Perform scaling processing on the image by a factor of |a-ath|/ath, where ath is the preset threshold. 8.一种图像的缩放系统,其特征在于,包括:8. An image scaling system, comprising: 加速度获取模块,用于当移动终端显示图像时,获取移动终端前方的物体相对于移动终端运动的加速度a;The acceleration acquisition module is used to acquire the acceleration a of the object in front of the mobile terminal relative to the motion of the mobile terminal when the mobile terminal displays an image; 运动方向获取模块,用于获取所述物体相对于移动终端的运动方向,其中,物体接近移动终端的运动方向为正方向,物体远离移动终端的运动方向为负方向;A movement direction acquiring module, configured to acquire the movement direction of the object relative to the mobile terminal, wherein the movement direction of the object approaching the mobile terminal is a positive direction, and the movement direction of the object away from the mobile terminal is a negative direction; 处理模块,用于将加速度a的绝对值与预设阈值进行比较,当所述加速度a的绝对值大于预设阈值时,对图像进行缩放处理;A processing module, configured to compare the absolute value of the acceleration a with a preset threshold, and when the absolute value of the acceleration a is greater than the preset threshold, zoom the image; 移动终端具有接近传感器,以及用于控制所述接近传感器开启和关闭的传感器开关;The mobile terminal has a proximity sensor, and a sensor switch for controlling the proximity sensor to be turned on and off; 当所述加速度a的绝对值不大于预设阈值时,对图像不进行处理。When the absolute value of the acceleration a is not greater than the preset threshold, the image is not processed. 9.根据权利要求8所述的图像的缩放系统,其特征在于,处理模块具体包括:9. The scaling system of an image according to claim 8, wherein the processing module specifically comprises: 图像缩小处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行缩小处理;An image reduction processing unit, configured to perform reduction processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is a positive direction; 图像放大处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行放大处理。The image magnification processing unit is configured to perform magnification processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is negative. 10.根据权利要求8所述的图像的缩放系统,其特征在于,处理模块具体包括:10. The image scaling system according to claim 8, wherein the processing module specifically comprises: 图像缩小处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为负方向时,对图像进行缩小处理;An image reduction processing unit, configured to perform reduction processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is a negative direction; 图像放大处理单元,用于当所述加速度a的绝对值大于预设阈值,并且物体的运动方向为正方向时,对图像进行放大处理。An image magnification processing unit, configured to perform magnification processing on the image when the absolute value of the acceleration a is greater than a preset threshold and the moving direction of the object is a positive direction.
CN201610233577.6A 2016-04-15 2016-04-15 Image zooming method and system Expired - Fee Related CN105931182B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610233577.6A CN105931182B (en) 2016-04-15 2016-04-15 Image zooming method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610233577.6A CN105931182B (en) 2016-04-15 2016-04-15 Image zooming method and system

Publications (2)

Publication Number Publication Date
CN105931182A CN105931182A (en) 2016-09-07
CN105931182B true CN105931182B (en) 2019-12-10

Family

ID=56838280

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610233577.6A Expired - Fee Related CN105931182B (en) 2016-04-15 2016-04-15 Image zooming method and system

Country Status (1)

Country Link
CN (1) CN105931182B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111273837A (en) * 2018-12-04 2020-06-12 浙江宇视科技有限公司 Image processing method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060104606A (en) * 2005-03-31 2006-10-09 주식회사 팬택 Camera zoom control device based on distance of photographer and its method
US8363019B2 (en) * 2008-05-26 2013-01-29 Lg Electronics Inc. Mobile terminal using proximity sensor and method of controlling the mobile terminal
CN102129337A (en) * 2010-01-19 2011-07-20 腾讯科技(北京)有限公司 Method and device for controlling mobile terminal browser
CN102073454A (en) * 2011-01-13 2011-05-25 宇龙计算机通信科技(深圳)有限公司 Mobile terminal and input control method for touch panel
CN103885593B (en) * 2014-03-14 2016-04-06 努比亚技术有限公司 A kind of handheld terminal and screen anti-fluttering method thereof and device
CN104636040B (en) * 2015-02-05 2017-12-12 惠州Tcl移动通信有限公司 A kind of image display processing method and device

Also Published As

Publication number Publication date
CN105931182A (en) 2016-09-07

Similar Documents

Publication Publication Date Title
CN108960163B (en) Gesture recognition method, device, equipment and storage medium
US20160246383A1 (en) Floating or mid-air operation processing method and apparatus
US20160004307A1 (en) Information processing apparatus and program
US9544556B2 (en) Projection control apparatus and projection control method
CN102681786A (en) Method and device for text selection
WO2014183552A1 (en) Method and apparatus for zooming in on selected area of preview interface
US20170269812A1 (en) Displaying method and electronic apparatus
WO2013084179A1 (en) An apparatus responsive to at least zoom-in user input, a method and a computer program
CN103077170A (en) Method and device for browsing webpage based on physical movement
CN103488296A (en) Somatosensory interaction gesture control method and somatosensory interaction gesture control device
CN105260103A (en) Picture scaling method and electronic device
CN105718188A (en) method of operating input device, input device, and motor vehicle
WO2019019372A1 (en) Picture operation and control method and device for mobile terminal, mobile terminal, and medium
CN105931182B (en) Image zooming method and system
CN105493020B (en) Touch screen display control method and mobile device
US20150058811A1 (en) Control system for display screen, input apparatus and control method
KR20100134339A (en) Information recording medium containing a method for providing an enlarged reduction interface of a screen in an information communication terminal having a touch screen and a program implementing the same
CN104777995A (en) Display apparatus and value display mathod
CN104049843B (en) An information processing method and electronic device
JP5946965B2 (en) Display system, display method, and program
CN106293086A (en) Information display control method and device
CN114594899B (en) Map display adjustment method and device
CN104461369A (en) Operational input method and electronic device
US10481778B2 (en) Display device
CN102902468A (en) Map browsing method and device of mobile terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231124

Address after: 100045 Beijing city Xicheng District Fuxingmenwai No. 1 Nan Xiang Di Zang an

Patentee after: STATE GRID JIBEI ELECTRIC POWER Co.,Ltd.

Address before: 516006 Zhongkai hi tech Zone, Huizhou, Guangdong, 86 Chang seven Road West

Patentee before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20191210

CF01 Termination of patent right due to non-payment of annual fee