[go: up one dir, main page]

CN111432123A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN111432123A
CN111432123A CN202010239780.0A CN202010239780A CN111432123A CN 111432123 A CN111432123 A CN 111432123A CN 202010239780 A CN202010239780 A CN 202010239780A CN 111432123 A CN111432123 A CN 111432123A
Authority
CN
China
Prior art keywords
image
input
reference line
sub
user
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.)
Pending
Application number
CN202010239780.0A
Other languages
Chinese (zh)
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202010239780.0A priority Critical patent/CN111432123A/en
Publication of CN111432123A publication Critical patent/CN111432123A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

本发明实施例提供一种图像处理方法及装置,方法包括:获取第一图像;在第一图像上确定参考线;根据第一图像中位于参考线的第一侧的第一子图像,得到镜像图像;将第一图像中位于参考线的第二侧的第二子图像替换为镜像图像,得到第二图像;显示第二图像。在本发明实施例中,可以自动生成倒影图像,实现倒影图像的模拟生成,减少拍摄过程中对环境或道具以及拍摄技巧的依赖,降低拍摄困难度,提升用户体验。

Figure 202010239780

Embodiments of the present invention provide an image processing method and device. The method includes: acquiring a first image; determining a reference line on the first image; and obtaining a mirror image according to a first sub-image located on a first side of the reference line in the first image an image; replacing the second sub-image on the second side of the reference line in the first image with a mirror image to obtain a second image; displaying the second image. In the embodiment of the present invention, the reflection image can be automatically generated, the simulated generation of the reflection image can be realized, the dependence on the environment or props and the shooting skills during the shooting process is reduced, the shooting difficulty is reduced, and the user experience is improved.

Figure 202010239780

Description

图像处理方法及装置Image processing method and device

技术领域technical field

本发明涉及图像技术领域,尤其涉及一种图像处理方法及装置。The present invention relates to the field of image technology, and in particular, to an image processing method and device.

背景技术Background technique

随着信息技术的发展进步,各种电子设备在摄影程序中提供了丰富的拍摄模式,比如,美食模式、建筑模式、人像模式等。With the development and progress of information technology, various electronic devices provide a wealth of shooting modes in photography programs, such as food mode, architecture mode, portrait mode, etc.

现有这些拍摄模式通常利用人工智能算法自动识别出图像中的主体,对照片图像元素参数做增强和衰减,从而达到优化的效果。然而,现有的拍摄模式都是针对某张图像的优化,当用户需要呈现倒影效果的图像时,现有拍摄模式便无法满足使用需求,要么需要亲临水域环境中拍摄,要么得借助于镜面工具拍摄。而且,都需要用户具备一定的拍摄技巧才能保证良好的倒影效果。These existing shooting modes usually use artificial intelligence algorithms to automatically identify the subject in the image, and enhance and attenuate the parameters of the photo image elements, so as to achieve the optimal effect. However, the existing shooting modes are all optimized for a certain image. When the user needs to present an image with a reflection effect, the existing shooting modes cannot meet the needs of use. Either they need to shoot in the water environment, or they need to use the mirror tool. shoot. Moreover, users are required to have certain shooting skills to ensure a good reflection effect.

因此,目前在拍摄形成倒影图像时,用户通常要依赖于环境或道具以及拍摄技巧才能实现良好的倒影效果,操作复杂且难度大。Therefore, at present, when shooting to form a reflection image, the user usually relies on the environment or props and shooting skills to achieve a good reflection effect, and the operation is complicated and difficult.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种图像处理方法、装置、电子设备及计算机可读存储介质,能够解决目前拍摄倒影图像对环境或道具以及拍摄技巧重度依赖,操作复杂且难度大的问题。Embodiments of the present invention provide an image processing method, apparatus, electronic device, and computer-readable storage medium, which can solve the problems that the current shooting of reflected images is heavily dependent on the environment, props, and shooting skills, and the operation is complicated and difficult.

为了解决上述技术问题,本发明是这样实现的:In order to solve the above-mentioned technical problems, the present invention is achieved in this way:

第一方面,本发明实施例提供一种图像处理方法,应用于电子设备,所述方法包括:In a first aspect, an embodiment of the present invention provides an image processing method, which is applied to an electronic device, and the method includes:

获取第一图像;get the first image;

在所述第一图像上确定参考线;determining a reference line on the first image;

根据所述第一图像中位于所述参考线的第一侧的第一子图像,得到镜像图像;obtaining a mirror image according to the first sub-image located on the first side of the reference line in the first image;

将所述第一图像中位于所述参考线的第二侧的第二子图像替换为所述镜像图像,得到第二图像;replacing the second sub-image on the second side of the reference line in the first image with the mirror image to obtain a second image;

显示第二图像。Display the second image.

第二方面,本发明实施例还提供了一种图像处理装置,所述装置包括:In a second aspect, an embodiment of the present invention further provides an image processing apparatus, the apparatus comprising:

获取模块,用于获取第一图像;an acquisition module for acquiring the first image;

确定模块,用于在所述第一图像上确定参考线;a determining module for determining a reference line on the first image;

镜像模块,用于根据所述第一图像中位于所述参考线的第一侧的第一子图像,得到镜像图像;a mirroring module, configured to obtain a mirror image according to the first sub-image located on the first side of the reference line in the first image;

替换模块,用于将所述第一图像中位于所述参考线的第二侧的第二子图像替换为所述镜像图像,得到第二图像;a replacement module, configured to replace the second sub-image on the second side of the reference line in the first image with the mirror image to obtain a second image;

显示模块,用于显示所述第二图像。A display module, used for displaying the second image.

第三方面,本发明实施例还提供了一种电子设备,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如第一方面所述的图像处理方法的步骤。In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor When executed, the steps of the image processing method described in the first aspect are realized.

第四方面,本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如第一方面所述的图像处理方法的步骤。In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the image processing described in the first aspect is implemented steps of the method.

在本发明实施例中,通过在第一图像上确定参考线,根据第一图像中位于参考线的第一侧的第一子图像,得到镜像图像,将参考线的第二侧的第二子图像替换为第一子图像的镜像图像,得到第二图像,即可以显示一个包括第一子图像及其镜像图像的第二图像。从而,可以自动生成倒影图像,实现倒影图像的模拟生成,减少拍摄过程中对环境或道具以及拍摄技巧的依赖,降低拍摄困难度,提升用户体验。In this embodiment of the present invention, by determining the reference line on the first image, a mirror image is obtained according to the first sub-image located on the first side of the reference line in the first image, and the second sub-image on the second side of the reference line is The image is replaced with a mirror image of the first sub-image to obtain a second image, that is, a second image including the first sub-image and its mirror image can be displayed. Therefore, the reflection image can be automatically generated, the simulated generation of the reflection image can be realized, the dependence on the environment or props and the shooting skills during the shooting process is reduced, the shooting difficulty is reduced, and the user experience is improved.

附图说明Description of drawings

图1表示本发明实施例提供的一种图像处理方法的流程图;FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present invention;

图2表示本发明实施例的一种参考线的示意图;FIG. 2 shows a schematic diagram of a reference line according to an embodiment of the present invention;

图3表示本发明实施例的镜像图像的示意图;FIG. 3 shows a schematic diagram of a mirror image according to an embodiment of the present invention;

图4表示本发明实施例提供的另一种图像处理方法的流程图;FIG. 4 shows a flowchart of another image processing method provided by an embodiment of the present invention;

图5表示本发明实施例的另一种参考线的示意图;5 is a schematic diagram of another reference line according to an embodiment of the present invention;

图6表示本发明实施例的多种水面类型的示意图;6 is a schematic diagram showing various water surface types according to an embodiment of the present invention;

图7-1表示本发明实施例中一种模糊度的效果图;FIG. 7-1 shows an effect diagram of a ambiguity in an embodiment of the present invention;

图7-2表示本发明实施例中另一种模糊度的效果图;Fig. 7-2 shows an effect diagram of another ambiguity in an embodiment of the present invention;

图8表示本发明实施例提供的一种图像处理装置的结构框图;FIG. 8 shows a structural block diagram of an image processing apparatus provided by an embodiment of the present invention;

图9表示本发明实施例提供的另一种图像处理装置的结构框图;FIG. 9 shows a structural block diagram of another image processing apparatus provided by an embodiment of the present invention;

图10表示本发明实施例提供的一种电子设备的结构框图。FIG. 10 shows a structural block diagram of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。It is to be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.

在本发明的各种实施例中,应理解,下述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。In various embodiments of the present invention, it should be understood that the size of the sequence numbers of the following processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, rather than the implementation of the present invention The implementation of the examples constitutes no limitation.

实施例一Example 1

参见图1,示出了本发明实施例提供的一种图像处理方法的流程图,该方法的步骤如下:Referring to FIG. 1, a flowchart of an image processing method provided by an embodiment of the present invention is shown. The steps of the method are as follows:

步骤101,获取第一图像。Step 101, acquiring a first image.

对于图像的处理,首先需要具有提供给用户预览的图像。该图像为电子设备获取到的第一图像。For image processing, it is first necessary to have an image that is provided to the user for preview. The image is the first image obtained by the electronic device.

可以理解的是,这样的第一图像可以是用户通过其他设备拍摄,通过存储卡或者无线方式从其他设备传输至当前进行图像处理的设备中,也可以为当前进行图像处理的电子设备自行拍摄获得的。It can be understood that such a first image may be captured by the user through other devices, transmitted from other devices to the device currently performing image processing through a memory card or wirelessly, or may be captured by the electronic device currently performing image processing. of.

具体的,步骤101中对于第一图像的获取,可通过如下方式一或者方式二的方法实现。Specifically, the acquisition of the first image in step 101 may be implemented by the following methods in the first mode or the second mode.

方式一:在电子设备执行拍照操作时获取。Method 1: Obtain when the electronic device performs a photographing operation.

当用户在使用电子设备时,可以通过点击屏幕上的拍照应用图标,启动拍照应用,电子设备通过显示屏向用户展示实时预览画面,当预览画面的拍摄方位、角度和呈现的画面元素符合心理预期效果时,电子设备通过接收用户的快门触发操作,将图像保存。从而用户可以在执行拍照操作时获取第一图像。When the user is using the electronic device, he can click the photo application icon on the screen to start the photo application, and the electronic device displays the real-time preview screen to the user through the display screen. When the shooting orientation, angle and displayed screen elements of the preview screen meet psychological expectations During the effect, the electronic device saves the image by receiving the user's shutter triggering operation. Therefore, the user can acquire the first image when performing the photographing operation.

需要说明的是,在现有技术中,具备拍摄功能的各类电子设备通常为用户提供了美食模式、建筑模式、人像模式等专门类别的拍摄模式,在拍摄时,通过图像识别,自动判断出被摄主体对象的类别,进行相应的图像优化。类似的,在实施本方案时,可以将用于产生倒影图像的功能内置为与美食模式、建筑模式、人像模式等并列的一种倒影模式。一种进入倒影模式的方法为:可以在拍照程序中将倒影模式设定为默认的拍摄模式,即用户打开拍照应用之后,首屏默认展示倒影模式,无需额外操作步骤,极为简便。另外一种进入倒影模式的方法为:用户打开拍照应用之后,由用户在显示界面上选择切换至倒影模式。在第二种方法中,为了提高切换效率,还可以根据各种拍摄模式的使用频率高低、累计使用时间长短和最近一次使用时间的远近等条件,对各个模式进行排序。比如,将使用频率高的拍摄模式展示在无需用户滑动操作可以直接选择的位置,将使用频率低的拍摄模式展示在需要用户滑动操作才能唤出的位置。从而,基于用户使用习惯出发,可以提高用户操作便利性。It should be noted that, in the prior art, various electronic devices with shooting functions usually provide users with special categories of shooting modes such as gourmet mode, architectural mode, and portrait mode. The category of the subject object, and the corresponding image optimization is performed. Similarly, when this solution is implemented, the function for generating a reflection image can be built in as a reflection mode that is juxtaposed with the gourmet mode, the building mode, and the portrait mode. One way to enter the reflection mode is: you can set the reflection mode as the default shooting mode in the photo program, that is, after the user opens the photo application, the first screen will display the reflection mode by default, no additional steps are required, and it is extremely simple. Another method for entering the reflection mode is: after the user opens the camera application, the user selects to switch to the reflection mode on the display interface. In the second method, in order to improve the switching efficiency, the modes can also be sorted according to conditions such as the frequency of use of various shooting modes, the length of the cumulative use time, and the distance of the most recent use time. For example, a shooting mode that is frequently used is displayed at a position that can be directly selected without the user's sliding operation, and a shooting mode that is used less frequently is displayed at a position that requires a user's sliding operation to be called out. Therefore, based on the user's usage habits, the user's operational convenience can be improved.

方式二:从其它电子设备中获取。Method 2: Obtain from other electronic devices.

在实施本申请提供的图像处理方法时,除了对当前设备实时拍摄得到的图像进行处理,还可以借助于存储卡、U盘等移动存储介质,或者蓝牙、WiFi、移动通信网络等无线方式访问其他目标设备。比如,其它手机、电脑、服务器等。通过读取目标设备的存储器中预先存储的图像,可以对当前设备以外的其他设备的图像进行处理,以生成倒影图像。When implementing the image processing method provided by this application, in addition to processing the images captured by the current device in real time, it is also possible to access other mobile storage media such as memory cards, U disks, or other wireless means such as Bluetooth, WiFi, and mobile communication networks. target device. For example, other mobile phones, computers, servers, etc. By reading images pre-stored in the memory of the target device, images of other devices other than the current device can be processed to generate a reflection image.

步骤102,在所述第一图像上确定参考线。Step 102, determining a reference line on the first image.

当获取到第一图像后,电子设备通过显示屏向用户以可视化的方式展示第一图像的画面内容。如图2所示,需要在该第一图像上,确定一条参考线m,该参考线为虚拟的肉眼可见的参考线,用于模拟水面的边界。可以理解的是,该参考线的一侧用于呈现实景画面,另一侧用于呈现倒影图像。具体的,实际实施时,该参考线可以为虚线或实线,当然,该参考线还可以按一定的频率在第一图像上闪现以提示用户该参考线所处的位置。作为一种实现方式,该参考线可以默认生成在屏幕中间位置且以水平线的方式呈现,需要说明的是,用户也可以对该参考线的形状位置进行调整。After acquiring the first image, the electronic device displays the screen content of the first image to the user in a visual manner through the display screen. As shown in FIG. 2 , a reference line m needs to be determined on the first image, and the reference line is a virtual reference line visible to the naked eye, which is used to simulate the boundary of the water surface. It can be understood that one side of the reference line is used to present the real picture, and the other side is used to present the reflected image. Specifically, in actual implementation, the reference line may be a dotted line or a solid line. Of course, the reference line may also flash on the first image at a certain frequency to prompt the user where the reference line is located. As an implementation manner, the reference line can be generated in the middle of the screen by default and presented as a horizontal line. It should be noted that the user can also adjust the shape and position of the reference line.

步骤103,根据所述第一图像中位于所述参考线的第一侧的第一子图像,得到镜像图像。Step 103: Obtain a mirror image according to the first sub-image located on the first side of the reference line in the first image.

基于所确定的参考线,将第一图像划分为了不同的区域。如图3所示,以水平直线参考线m为例,参考线m将第一图像分割为上下两部分,参考线m上方的第一侧为第一子图像,参考线m下方的第二侧为第二子图像。利用图像翻转算法,将第一子图像进行翻转得到第一子图像的镜像图像,比如,在图像二维平面内,以参考线做为水平方向的坐标轴x,定义参考线以上的区域为坐标轴y的正方向,可将坐标轴y的正方向的所有像素点以坐标轴x为对称轴进行对称复制。即新生成的镜像图像和第一子图像关于参考线这条轴线镜像对称。需要说明的是,若参考线为曲线,仍可以参照上述方法,以曲线上的点作为中点,可以计算得到与第一子图像中像素点镜像的镜像点,此处不再赘述。Based on the determined reference lines, the first image is divided into different regions. As shown in Figure 3, taking the reference line m as an example, the reference line m divides the first image into two parts, the upper and lower parts, the first side above the reference line m is the first sub-image, and the second side below the reference line m is the first sub-image. for the second sub-image. Using the image flipping algorithm, the first sub-image is flipped to obtain a mirror image of the first sub-image. For example, in the two-dimensional image plane, the reference line is used as the coordinate axis x in the horizontal direction, and the area above the reference line is defined as the coordinate In the positive direction of the axis y, all the pixels in the positive direction of the coordinate axis y can be symmetrically copied with the coordinate axis x as the symmetry axis. That is, the newly generated mirror image and the first sub-image are mirror-symmetrical about the axis of the reference line. It should be noted that, if the reference line is a curve, the above method can still be referred to, and the point on the curve is used as the midpoint to calculate the mirror image point mirrored with the pixel point in the first sub-image, which will not be repeated here.

步骤104,将所述第一图像中位于所述参考线的第二侧的第二子图像替换为所述镜像图像,得到第二图像。Step 104: Replace the second sub-image on the second side of the reference line in the first image with the mirror image to obtain a second image.

原始的第一图像中包括第一子图像和第二子图像,第一子图像和第二子图像为不同的画面元素,而基于参考线所得到的镜像图像是与第一子图像具有相同画面元素的图像,并且镜像图像与第一子图像关于参考线镜像对称。为了得到具有倒影效果的合成图像,可以参考线为替换边界,将第二子图像替换为镜像图像。具体的,比如,可以利用图像识别算法识别出参考线所分割出第二子图像的区域,对第二子图像的区域进行抠图删除,将镜像图像填充在被删除后的区域中,当然,也可以以参考线为合成边界,直接将镜像图像叠加覆盖在第二子图像的上层,以遮挡第二子图像的画面元素。从而,便可以得到参考线一侧为实景画面,另一侧为数字化处理得到的虚拟倒影的第二图像。The original first image includes a first sub-image and a second sub-image, the first sub-image and the second sub-image are different picture elements, and the mirror image obtained based on the reference line has the same picture as the first sub-image The image of the element, and the mirror image is mirror-symmetrical to the first sub-image with respect to the reference line. In order to obtain a composite image with a reflection effect, the reference line can be used as a replacement boundary, and the second sub-image can be replaced with a mirror image. Specifically, for example, an image recognition algorithm can be used to identify the area of the second sub-image segmented by the reference line, cut out and delete the area of the second sub-image, and fill the mirror image in the deleted area. Of course, The reference line can also be used as a composite boundary, and the mirror image can be directly superimposed and covered on the upper layer of the second sub-image, so as to block the picture elements of the second sub-image. Thus, one side of the reference line is a real scene image, and the other side is a second image of a virtual reflection obtained by digital processing.

步骤105,显示所述第二图像。Step 105, displaying the second image.

对于得到的具有倒影效果的第二图像,可在显示屏上以缩略图模式或者全屏模式展示,并且,在展示时,用户还可在显示屏上通过放大操作查看参考线位置或其它位置的图像细节,以确认第二图像的合成质量。The obtained second image with reflection effect can be displayed on the display screen in thumbnail mode or full-screen mode, and during display, the user can also zoom in on the display screen to view the image at the reference line position or other positions details to confirm the composite quality of the second image.

在本发明实施例中,通过在第一图像上确定参考线,根据第一图像中位于参考线的第一侧的第一子图像,得到镜像图像,将参考线的第二侧的第二子图像替换为第一子图像的镜像图像,得到第二图像,即可以显示一个包括第一子图像及其镜像图像的第二图像。从而,可以自动生成倒影图像,实现倒影图像的模拟生成,减少拍摄过程中对环境或道具以及拍摄技巧的依赖,降低拍摄困难度,提升用户体验。In this embodiment of the present invention, by determining the reference line on the first image, a mirror image is obtained according to the first sub-image located on the first side of the reference line in the first image, and the second sub-image on the second side of the reference line is The image is replaced with a mirror image of the first sub-image to obtain a second image, that is, a second image including the first sub-image and its mirror image can be displayed. Therefore, the reflection image can be automatically generated, the simulated generation of the reflection image can be realized, the dependence on the environment or props and the shooting skills during the shooting process is reduced, the shooting difficulty is reduced, and the user experience is improved.

实施例二Embodiment 2

参见图4,示出了本发明实施例提供的另一种图像处理方法的流程图,该方法的步骤如下:Referring to FIG. 4 , a flowchart of another image processing method provided by an embodiment of the present invention is shown. The steps of the method are as follows:

步骤201,获取第一图像。Step 201, acquiring a first image.

步骤201中对于第一图像的获取方法,可参照实施例一中步骤101的说明,此处不再赘述。For the acquisition method of the first image in step 201, reference may be made to the description of step 101 in the first embodiment, and details are not repeated here.

步骤202,接收用户的第一输入。Step 202, receiving a first input from the user.

在获取到第一图像后,电子设备需要接收用户的操作请求,该操作请求即用户的第一输入。第一输入可以是电子设备通过物理按键接收到的操作请求,也可以是电子设备通过触控屏上的虚拟按键或手势操作接收到的操作请求,还可以是电子设备通过光学传感器接收到的与眼控技术相关的操作请求。After acquiring the first image, the electronic device needs to receive an operation request from the user, where the operation request is the user's first input. The first input can be an operation request received by the electronic device through physical keys, an operation request received by the electronic device through virtual keys or gesture operations on the touch screen, or an operation request received by the electronic device through an optical sensor. Operation requests related to eye control technology.

具体的,可采用下述方法接收第一输入:Specifically, the following methods can be used to receive the first input:

子步骤a1,在所述第一图像上提供采集控件。In sub-step a1, an acquisition control is provided on the first image.

可以在第一图像上生成一透明的图层,在该图层上提供输入框、滑动条或选择菜单等采集控件,用户可以向输入框输入数据、滑动滑动条的位置、选择菜单中的不同选项。A transparent layer can be generated on the first image, and collection controls such as an input box, a slider or a selection menu can be provided on the layer. The user can input data into the input box, slide the position of the slider, and select different menu items. options.

子步骤a2,通过所述采集控件接收用户的第一输入。Sub-step a2, receiving the user's first input through the collection control.

通过上述采集控件,用户可以在采集控件中输入对参考线的位置和/或形状的要求。以输入框为例,用户可以通过输入坐标点及曲率确定参考线的位置以及其形状为直线还是曲线。以滑动条为例,用户可以通过滑动滑动条的距离确定参考线的位置并调节其形状为直线还是曲线。Through the above acquisition controls, the user can input requirements for the position and/or shape of the reference line in the acquisition controls. Taking the input box as an example, the user can determine the position of the reference line and whether its shape is a straight line or a curve by inputting coordinate points and curvature. Taking the slider as an example, the user can determine the position of the reference line by sliding the distance of the slider and adjust whether its shape is a straight line or a curve.

接收第一输入的另一种方法如下:Another way to receive the first input is as follows:

接收用户在所述第一图像上的滑动轨迹或锚点作为第一输入。The user's sliding track or anchor point on the first image is received as the first input.

随着触控技术越来越精准,可以直接接收用户在第一图像上的滑动轨迹或逐个点选的锚点。通过轨迹或锚点信息形成调整后的参考线。由于显示屏上向用户直观展示了第一图像,当用户基于可视化的界面滑动画出参考线或点选锚点绘制参考线时,更能准确定位参考线的位置,所形成的参考线的形状也更能吻合倒影图像的需求。可以理解的是,无论是滑动轨迹构成的参考线还是锚点连接成的参考线,电子设备在收到用户的第一输入之后,可以通过线条的平滑处理、拟合等手段进一步优化参考线的形状,以使其更真实的模拟水面边界。As the touch technology becomes more and more accurate, it is possible to directly receive the user's sliding track on the first image or the anchor points that are clicked one by one. Adjusted reference lines are formed from track or anchor point information. Since the first image is intuitively displayed to the user on the display screen, when the user draws the reference line based on the visual interface or clicks the anchor point to draw the reference line, the position of the reference line can be accurately located, and the shape of the formed reference line can be more accurately located. It can also better meet the needs of reflection images. It can be understood that, whether it is a reference line formed by a sliding trajectory or a reference line connected by anchor points, after receiving the first input from the user, the electronic device can further optimize the reference line by smoothing and fitting the lines. shape to make it more realistic to simulate the water boundary.

步骤203,响应于所述第一输入,确定所述参考线在所述第一图像上的位置和/或形状。Step 203, in response to the first input, determine the position and/or shape of the reference line on the first image.

电子设备在接收到用户的第一输入之后,基于用户所输入的信息,对第一输入中的数据进行图形可视化处理,将第一输入所包括的参考线上各个点的坐标、线条曲率等直观展示在第一图像上,从而,确定下参考线与第一图像上画面元素的相对位置关系及其形状,以便于进行镜像。比如,当用户的第一输入表示参考线在第一图像的中间位置以水平直线呈现时,在响应第一输入之后,可将参考线的位置展示在第一图像的中间位置。After receiving the first input from the user, the electronic device performs graphic visualization processing on the data in the first input based on the information input by the user, and visualizes the coordinates of each point on the reference line included in the first input, the curvature of the line, etc. It is displayed on the first image, thereby determining the relative positional relationship between the lower reference line and the picture element on the first image and its shape, so as to facilitate mirroring. For example, when the user's first input indicates that the reference line is presented as a horizontal straight line in the middle position of the first image, after responding to the first input, the position of the reference line can be displayed in the middle position of the first image.

可选的,对参考线进行展示时,若用户觉得位置或者形状中至少一个不合适,还可以返回到接收第一输入的界面,重新输入,从而对参考线进行调整,具体调整的操作与电子设备接收第一输入,响应第一输入的步骤相同,此处不再赘述。如图5所示,示出了一种经过调整的参考线m的示意。对于参考线的位置、形状的调整,有助于模拟不同的水域边界和水域面积,从而,提升倒影图像的逼真效果。Optionally, when the reference line is displayed, if the user feels that at least one of the position or the shape is inappropriate, the user can return to the interface for receiving the first input and re-enter the reference line to adjust the reference line. The specific adjustment operation and electronic The device receives the first input, and the steps for responding to the first input are the same, which will not be repeated here. As shown in FIG. 5 , a schematic diagram of an adjusted reference line m is shown. The adjustment of the position and shape of the reference line is helpful to simulate different water boundaries and water areas, thereby enhancing the realistic effect of the reflection image.

当然,可选的,上述步骤202和203,也可以替换为直接在第一图像上确定参考线,本发明实施例对此不作具体限定。例如,根据用户默认选择的参考线的位置和/或形状,直接确定参考线。Of course, optionally, the foregoing steps 202 and 203 may also be replaced by directly determining the reference line on the first image, which is not specifically limited in this embodiment of the present invention. For example, the reference line is directly determined according to the position and/or shape of the reference line selected by the user by default.

步骤204,接收用户的第二输入。Step 204, receiving a second input from the user.

与电子设备接收用户的第一输入类似,区别点在于,第一输入与参考线相关,而第二输入用于从预设的至少两种水面类型素材中选择出目标水面类型。Similar to the electronic device receiving the user's first input, the difference is that the first input is related to the reference line, and the second input is used to select a target water surface type from at least two preset water surface type materials.

步骤205,响应于所述第二输入,确定目标水面类型。Step 205, in response to the second input, determine the target water surface type.

在本发明实施例提供的方法中,可以预先存储各种不同水面类型的图片素材。电子设备在接收到来自用户的第二输入之后,响应于第二输入,可以从至少两种类型的水面素材中确定目标水面类型。比如,如图6所示,电子设备显示屏上展示了A、B、C三种不同类型的水面图像素材,分别表示湖面、海面和河面,电子设备接收用户对C类型水面图像的选择信息之后,可以应用C类型水面图像所具有的水面质感到第一子图像,可以更真实模拟还原不同水域类型下的倒影效果,提升倒影图像的逼真度。In the method provided by the embodiment of the present invention, picture materials of various water surface types may be stored in advance. After receiving the second input from the user, the electronic device may determine the target water surface type from at least two types of water surface material in response to the second input. For example, as shown in Figure 6, three different types of water surface image materials A, B, and C are displayed on the display screen of the electronic device, representing the lake surface, the sea surface and the river surface respectively. After the electronic device receives the user's selection information for the C type water surface image , the water surface texture of the C-type water surface image can be applied to the first sub-image, which can simulate and restore the reflection effect under different water types more realistically, and improve the fidelity of the reflection image.

步骤206,根据所述第一子图像和所述目标水面类型,得到所述镜像图像。Step 206: Obtain the mirror image according to the first sub-image and the target water surface type.

在前述步骤得到第一子图像和目标水面类型之后,得到镜像图像的一种方法是先将第一子图像从第一图像中复制分离出来得到第一子图像的副本,然后将第一子图像的副本与目标水面类型对应的图片素材融合,比如,叠加调整透明度等。然后将融合后的图像以参考线为轴线镜像处理得到镜像图像。得到镜像图像的另一种方法可以是先将第一子图像从第一图像中复制分离出来得到第一子图像的副本,然后将第一子图像的副本以参考线为轴线镜像处理得到待处理的镜像图像,将待处理的镜像图像与目标水面类型对应的图片素材融合,比如,叠加调整透明度等。融合完毕可以得到最终的镜像图像。需要说明的是,基于目标水面类型与第一子图像所得到的镜像图像,由于其引入了水面素材,相较于直接得到的镜像图像而言,倒影图像的效果更加逼真。After obtaining the first sub-image and the target water surface type in the preceding steps, one method of obtaining the mirror image is to first copy and separate the first sub-image from the first image to obtain a copy of the first sub-image, and then copy the first sub-image The copy of the image is fused with the image material corresponding to the target water surface type, for example, superimposed to adjust the transparency, etc. Then the fused image is mirrored with the reference line as the axis to obtain a mirror image. Another method for obtaining the mirror image may be to first copy and separate the first sub-image from the first image to obtain a copy of the first sub-image, and then mirror the copy of the first sub-image with the reference line as the axis to obtain the to-be-processed copy. The mirror image to be processed is merged with the picture material corresponding to the target water surface type, for example, superimposed to adjust the transparency, etc. After the fusion, the final mirror image can be obtained. It should be noted that the mirror image obtained based on the target water surface type and the first sub-image has a more realistic effect than the directly obtained mirror image due to the introduction of water surface material.

可选的,除了采取如步骤204至步骤206的方法得到镜像图像,还可以通过以下步骤对步骤204至步骤206进行替换,或同时采取步骤204至步骤206,得到镜像图像:Optionally, in addition to obtaining the mirror image by the methods from steps 204 to 206, steps 204 to 206 can also be replaced by the following steps, or steps 204 to 206 can be taken at the same time to obtain the mirror image:

a、接收用户的第三输入。a. Receive a third input from the user.

与电子设备接收用户的第一输入类似,区别点在于,第一输入与参考线相关,而第三输入用于对镜像图像的模糊度进行设置。Similar to the electronic device receiving the user's first input, the difference is that the first input is related to the reference line, and the third input is used to set the blurriness of the mirror image.

b、响应于所述第三输入,确定所述镜像图像的模糊度。b. In response to the third input, determining the blurriness of the mirror image.

电子设备在接收到来自用户的第三输入之后,响应于第三输入,可以为用户提供模糊度设置控件,比如,模糊度输入框、模糊度设置拨轮或滚动条等。用户可以通过模糊度设置控件确定一个模糊度数值,该模糊度数值可以为0-100%之间,表示画面的模糊轻重程度,0表示完全清晰,100%表示完全模糊,画面元素不可辨识。比如,用户可以通过模糊度输入框输入50%模糊度,从而确定镜像图像的模糊度为50%,50%的模糊度可以用于生成更逼真的镜像图像,可以更真实模拟还原不同水域类型下的倒影效果,提升倒影图像的逼真度。After receiving the third input from the user, in response to the third input, the electronic device may provide the user with a blurriness setting control, such as a blurriness input box, a blurriness setting wheel or a scroll bar, and the like. The user can determine a blur degree value through the blur degree setting control. The blur degree value can be between 0-100%, indicating the degree of blurring of the picture, 0 means completely clear, 100% means completely blurred, and the picture elements are indistinguishable. For example, the user can input a 50% blur degree through the blur degree input box to determine the blur degree of the mirror image as 50%. The 50% blur degree can be used to generate a more realistic mirror image, which can be more realistically simulated and restored under different water types. The reflection effect can improve the fidelity of the reflection image.

c、根据所述第一子图像和所述模糊度,得到所述镜像图像。c. Obtain the mirror image according to the first sub-image and the blur degree.

在前述步骤得到第一子图像和模糊度之后,得到镜像图像的一种方法是先将第一子图像从第一图像中复制分离出来得到第一子图像的副本,然后将第一子图像的副本通过高斯模糊等模糊算法按照所确定的模糊度进行处理。然后将处理后的图像以参考线为轴线镜像处理得到镜像图像。得到镜像图像的另一种方法可以是先将第一子图像从第一图像中复制分离出来得到第一子图像的副本,然后将第一子图像的副本以参考线为轴线镜像处理得到待处理的镜像图像,将待处理的镜像图像通过高斯模糊等模糊算法按照所确定的模糊度进行处理,处理完毕可以得到最终的镜像图像。需要说明的是,基于模糊度与第一子图像所得到的镜像图像,由于对镜像图像中呈现了模糊效果,相较于直接得到的镜像图像而言,倒影图像的效果更加逼真。After obtaining the first sub-image and the blur degree in the preceding steps, one method of obtaining a mirror image is to first copy and separate the first sub-image from the first image to obtain a copy of the first sub-image, and then copy the first sub-image The duplicates are processed according to the determined ambiguity by a blurring algorithm such as Gaussian blurring. Then, the processed image is mirrored with the reference line as the axis to obtain a mirror image. Another method for obtaining the mirror image may be to first copy and separate the first sub-image from the first image to obtain a copy of the first sub-image, and then mirror the copy of the first sub-image with the reference line as the axis to obtain the to-be-processed copy. The mirror image to be processed is processed by a blurring algorithm such as Gaussian blur according to the determined blur degree, and the final mirror image can be obtained after processing. It should be noted that, in the mirror image obtained based on the blur degree and the first sub-image, since the mirror image presents a blurring effect, the effect of the mirror image is more realistic compared to the directly obtained mirror image.

步骤207,将所述第一图像中位于所述参考线的第二侧的第二子图像替换为所述镜像图像,得到第二图像。Step 207: Replace the second sub-image on the second side of the reference line in the first image with the mirror image to obtain a second image.

步骤207与步骤104类似,可参照步骤104的说明,此处不再赘述。Step 207 is similar to step 104, and reference may be made to the description of step 104, which will not be repeated here.

步骤208,显示所述第二图像。Step 208, displaying the second image.

对于得到的具有倒影效果的第二图像,可在显示屏上以缩略图模式或者全屏模式展示,并且,在展示时,用户还可在显示屏上通过放大操作查看参考线位置或其它位置的图像细节,以确认第二图像的合成质量。The obtained second image with reflection effect can be displayed on the display screen in thumbnail mode or full-screen mode, and during display, the user can also zoom in on the display screen to view the image at the reference line position or other positions details to confirm the composite quality of the second image.

此外,可选的,在显示第二图像之后,本方法还可以包括以下步骤:In addition, optionally, after displaying the second image, the method may further include the following steps:

步骤209、接收用户的第四输入。Step 209: Receive a fourth input from the user.

与电子设备接收用户的第一输入类似,区别点在于,第一输入与参考线相关,而第四输入用于对水面类型进行修改调整。Similar to the electronic device receiving the user's first input, the difference is that the first input is related to the reference line, and the fourth input is used to modify and adjust the water surface type.

步骤210、响应于所述第四输入,确定第二水面类型,并将所述第二图像中的所述镜像图像调整至与所述第二水面类型相对应。Step 210: In response to the fourth input, determine a second water surface type, and adjust the mirror image in the second image to correspond to the second water surface type.

可以理解的是,在前述步骤中,电子设备基于用户的第二输入确定了目标水面类型。用户还可以在显示第二图像之后,在第二图像的视觉效果不满足心理预期的情况下,对水面类型进行修改。电子设备在接收到用户的第四输入之后,可以向用户提供水面类型选择界面,由用户重新选择确定一个与目标水面类型不同的第二水面类型。电子设备响应于这样的确定信息,可将镜像图像调整至与第二水面类型相对应。具体过程,与步骤206的描述类似。It can be understood that, in the foregoing steps, the electronic device determines the target water surface type based on the user's second input. The user can also modify the water surface type after the second image is displayed, if the visual effect of the second image does not meet psychological expectations. After receiving the user's fourth input, the electronic device may provide the user with a water surface type selection interface, and the user may reselect and determine a second water surface type different from the target water surface type. In response to such determination information, the electronic device may adjust the mirror image to correspond to the second water surface type. The specific process is similar to the description of step 206 .

除了按照步骤209和步骤210的方法对镜像图像重新调整,还可以采取步骤211和步骤212继续调整或者替换步骤209和步骤210。In addition to re-adjusting the mirror image according to the methods of steps 209 and 210 , steps 211 and 212 may also be taken to continue to adjust or replace steps 209 and 210 .

步骤211、接收用户的第五输入。Step 211: Receive a fifth input from the user.

与电子设备接收用户的第一输入类似,区别点在于,第一输入与参考线相关,而第五输入用于对镜像图像的模糊度进行修改调整。Similar to the electronic device receiving the user's first input, the difference is that the first input is related to the reference line, and the fifth input is used to modify and adjust the blurriness of the mirror image.

步骤212、响应于所述第五输入,调整所述第二图像中的所述镜像图像的模糊度。Step 212: In response to the fifth input, adjust the blurriness of the mirror image in the second image.

可以理解的是,在前述步骤中,电子设备基于用户的第三输入确定了镜像图像的模糊度。用户还可以在显示第二图像之后,在第二图像的视觉效果不满足心理预期的情况下,对镜像图像的模糊度进行修改。电子设备在接收到用户的第五输入之后,可以向用户提供模糊度调整界面,由用户重新选择确定一个与前述模糊度数值不同的另一数值。如图7-1所示,示出了通过滑动条将模糊度调整为20%的示意效果,如图7-2所示,示出了通过滑动条将模糊度调整为75%的示意效果。因而,可以根据实际模糊度的需求,调整镜像图像的模糊度,以尽可能还原真实的倒影场景。It can be understood that, in the foregoing steps, the electronic device determines the blurriness of the mirror image based on the user's third input. The user may also modify the blurriness of the mirror image after displaying the second image, if the visual effect of the second image does not meet psychological expectations. After receiving the user's fifth input, the electronic device may provide the user with a blurring degree adjustment interface, and the user may reselect and determine another value different from the aforementioned blurring degree value. As shown in Figure 7-1, it shows the schematic effect of adjusting the blurriness to 20% through the slider, and as shown in Figure 7-2, it shows the schematic effect of adjusting the blurriness to 75% through the slider. Therefore, the blur degree of the mirror image can be adjusted according to the actual blur degree requirements, so as to restore the real reflection scene as much as possible.

此外,可选的,在图像中存在杂物时,本方法还可以包括以下步骤:In addition, optionally, when there are sundries in the image, the method may further include the following steps:

步骤213,接收第六输入。Step 213, receiving a sixth input.

电子设备还可以通过显示屏接收用户的触摸选择信息,通过麦克风接收语音控制指令,还可以通过前置摄像头对眼球轨迹进行追踪。The electronic device can also receive the user's touch selection information through the display screen, receive voice control instructions through the microphone, and can track the eye trajectory through the front camera.

在显示界面上,可以基于用户的审美感受将影响画面美感的杂物元素选择出来,选择的方式同样可以不限于触摸操作。第六输入也就是用户对于图像中杂物元素的选择信息,利用一种或几种不同的方式接收用户的第六输入信息,用于确定第一图像中的杂物元素。On the display interface, sundry elements that affect the beauty of the screen may be selected based on the user's aesthetic feeling, and the selection method may also not be limited to touch operations. The sixth input is the user's selection information for the sundry elements in the image, and the user's sixth input information is received in one or more different ways, and is used to determine the sundry elements in the first image.

步骤214,响应于所述第六输入,确定所述第一图像中的杂物元素。Step 214, in response to the sixth input, determine the clutter element in the first image.

电子设备在接收到来自用户的第六输入之后,响应于第六输入,可以将第一图像中部分元素确定为杂物元素。比如,根据用户在第一图像上的触摸滑动轨迹,将圈起来的部分元素确定为杂物元素,标记为用户想要去除的对象。可以理解的是,本实施例中,也可以通过人工智能算法,自动识别勾勒出画面中各个主体的边界,由用户选择其中一个或多个主体作为杂物元素。After receiving the sixth input from the user, the electronic device may determine, in response to the sixth input, some elements in the first image as sundry elements. For example, according to the user's touch and slide track on the first image, some of the circled elements are determined as sundry elements, and marked as objects that the user wants to remove. It can be understood that, in this embodiment, an artificial intelligence algorithm can also be used to automatically identify and outline the boundaries of each subject in the screen, and the user selects one or more of the subjects as sundry elements.

步骤215,消除所述杂物元素。Step 215, eliminating the sundry elements.

抠图技术已日臻成熟,可以采用基于感知颜色空间的自然图像抠图算法将抠掉杂物元素的图像保留下来。基于已有的图像处理方法,可以对杂物元素四周的像素进行识别,利用线性或者非线性的算法进行图像画面的拟合,从而,对图像进行修复,将图像中的杂物元素消除,避免杂物元素出现在倒影图像中,避免干扰视觉效果。The matting technology has matured day by day, and the natural image matting algorithm based on the perceptual color space can be used to retain the image with the sundry elements removed. Based on the existing image processing methods, the pixels around the sundry elements can be identified, and the image picture can be fitted with a linear or non-linear algorithm, so as to repair the image, eliminate the sundry elements in the image, and avoid the Clutter elements appear in the reflected image to avoid interfering with the visual effect.

在本发明实施例中,通过在第一图像上确定参考线,根据第一图像中位于参考线的第一侧的第一子图像,得到镜像图像,将参考线的第二侧的第二子图像替换为第一子图像的镜像图像,得到第二图像,即可以显示一个包括第一子图像及其镜像图像的第二图像。从而,可以自动生成倒影图像,实现倒影图像的模拟生成,减少拍摄过程中对环境或道具以及拍摄技巧的依赖,降低拍摄困难度,提升用户体验。并且上述过程中还引入了水面类型或模糊处理,此外,还可以通过接收用户的输入,对目标水面类型及模糊度进行调整,对镜像图像的模糊度进行修改,对图像中的杂物进行消除,从而,进一步提升倒影图像的逼真程度。In this embodiment of the present invention, by determining the reference line on the first image, a mirror image is obtained according to the first sub-image located on the first side of the reference line in the first image, and the second sub-image on the second side of the reference line is The image is replaced with a mirror image of the first sub-image to obtain a second image, that is, a second image including the first sub-image and its mirror image can be displayed. Therefore, the reflection image can be automatically generated, the simulated generation of the reflection image can be realized, the dependence on the environment or props and the shooting skills during the shooting process is reduced, the shooting difficulty is reduced, and the user experience is improved. And the above process also introduces the type of water surface or blurring. In addition, by receiving user input, the target water surface type and blur degree can be adjusted, the blur degree of the mirror image can be modified, and the sundries in the image can be eliminated. , thereby further improving the fidelity of the reflection image.

实施例三Embodiment 3

参照图8,示出了一种图像处理装置的框图,所述装置包括:Referring to FIG. 8, a block diagram of an image processing apparatus is shown, and the apparatus includes:

获取模块301,用于获取第一图像。The acquiring module 301 is used for acquiring a first image.

确定模块302,用于在所述第一图像上确定参考线。A determination module 302, configured to determine a reference line on the first image.

镜像模块303,用于根据所述第一图像中位于所述参考线的第一侧的第一子图像,得到镜像图像。The mirroring module 303 is configured to obtain a mirror image according to the first sub-image located on the first side of the reference line in the first image.

替换模块304,用于所述第一图像中位于所述参考线的第二侧的第二子图像替换为所述镜像图像,得到第二图像。The replacement module 304 is configured to replace the second sub-image located on the second side of the reference line in the first image with the mirror image to obtain a second image.

显示模块305,用于显示所述第二图像。The display module 305 is configured to display the second image.

在本发明实施例中,通过在第一图像上确定参考线,根据第一图像中位于参考线的第一侧的第一子图像,得到镜像图像,将参考线的第二侧的第二子图像替换为第一子图像的镜像图像,得到第二图像,即可以显示一个包括第一子图像及其镜像图像的第二图像。从而,可以自动生成倒影图像,实现倒影图像的模拟生成,减少拍摄过程中对环境或道具以及拍摄技巧的依赖,降低拍摄困难度,提升用户体验。In this embodiment of the present invention, by determining the reference line on the first image, a mirror image is obtained according to the first sub-image located on the first side of the reference line in the first image, and the second sub-image on the second side of the reference line is The image is replaced with a mirror image of the first sub-image to obtain a second image, that is, a second image including the first sub-image and its mirror image can be displayed. Therefore, the reflection image can be automatically generated, the simulated generation of the reflection image can be realized, the dependence on the environment or props and the shooting skills during the shooting process is reduced, the shooting difficulty is reduced, and the user experience is improved.

实施例四Embodiment 4

参照图9,示出了另一种图像处理装置的框图,所述装置包括:Referring to FIG. 9, a block diagram of another image processing apparatus is shown, and the apparatus includes:

获取模块401,用于获取第一图像。The acquiring module 401 is used for acquiring a first image.

确定模块402,用于在所述第一图像上确定参考线。A determination module 402, configured to determine a reference line on the first image.

可选的,所述确定模块402可以包括:Optionally, the determining module 402 may include:

第一接收模块4021,用于接收第一输入。The first receiving module 4021 is used to receive the first input.

第一响应模块4022,用于响应于所述第一输入,确定所述参考线在所述第一图像上的位置和/或形状。A first response module 4022, configured to determine the position and/or shape of the reference line on the first image in response to the first input.

镜像模块403,用于根据所述第一图像中位于所述参考线的第一侧的第一子图像,得到镜像图像。The mirroring module 403 is configured to obtain a mirror image according to the first sub-image located on the first side of the reference line in the first image.

替换模块404,用于所述第一图像中位于所述参考线的第二侧的第二子图像替换为所述镜像图像,得到第二图像。The replacement module 404 is configured to replace the second sub-image located on the second side of the reference line in the first image with the mirror image to obtain a second image.

显示模块405,用于显示所述第二图像。The display module 405 is configured to display the second image.

可选的,所述镜像模块403可以包括:Optionally, the mirroring module 403 may include:

第二接收子模块4031,用于接收用户的第二输入。The second receiving sub-module 4031 is configured to receive the second input of the user.

第二响应子模块4032,用于响应于所述第二输入,确定目标水面类型。The second response sub-module 4032 is configured to determine the target water surface type in response to the second input.

镜像子模块,用于根据所述第一子图像和所述目标水面类型,得到所述镜像图像。A mirror image sub-module, configured to obtain the mirror image according to the first sub image and the target water surface type.

可选的,另一种图像处理装置中,所述镜像模块403可以包括:Optionally, in another image processing apparatus, the mirroring module 403 may include:

第三接收子模块,用于接收用户的第三输入。The third receiving sub-module is configured to receive the third input from the user.

第三响应子模块,用于响应于所述第三输入,确定所述镜像图像的模糊度。A third response sub-module, configured to determine the blurriness of the mirror image in response to the third input.

镜像子模块,用于根据所述第一子图像和所述模糊度,得到所述镜像图像。A mirror image sub-module, configured to obtain the mirror image according to the first sub image and the blur degree.

可选的,所述图像处理装置中,还可以包括:Optionally, the image processing apparatus may further include:

第四接收模块406,用于接收用户的第四输入。The fourth receiving module 406 is configured to receive a fourth input from the user.

第四响应模块407,用于响应于所述第四输入,确定第二水面类型,并将所述第二图像中的所述镜像图像调整至与所述第二水面类型相对应。The fourth response module 407 is configured to determine a second water surface type in response to the fourth input, and adjust the mirror image in the second image to correspond to the second water surface type.

和/或,and / or,

第五接收模块,用于接收用户的第五输入。The fifth receiving module is used for receiving the fifth input of the user.

第五响应模块,用于响应于所述第五输入,调整所述第二图像中的所述镜像图像的模糊度。A fifth response module, configured to adjust the blur degree of the mirror image in the second image in response to the fifth input.

可选的,所述图像处理装置中,还可以包括:Optionally, the image processing apparatus may further include:

第六接收模块,用于接收用户的第六输入;a sixth receiving module, configured to receive the sixth input of the user;

第六响应模块,用于响应于所述第六输入,确定所述第一图像中的杂物元素;a sixth response module, configured to determine debris elements in the first image in response to the sixth input;

消除模块,用于消除所述杂物元素。An elimination module for eliminating the sundry elements.

在本发明实施例中,通过在第一图像上确定参考线,根据第一图像中位于参考线的第一侧的第一子图像,得到镜像图像,将参考线的第二侧的第二子图像替换为第一子图像的镜像图像,得到第二图像,即可以显示一个包括第一子图像及其镜像图像的第二图像。从而,可以自动生成倒影图像,实现倒影图像的模拟生成,减少拍摄过程中对环境或道具以及拍摄技巧的依赖,降低拍摄困难度,提升用户体验。并且上述过程中还引入了水面类型或模糊处理,此外,还可以通过接收用户的输入,对目标水面类型及模糊度进行调整,对镜像图像的模糊度进行修改,对图像中的杂物进行消除,从而,进一步提升倒影图像的逼真程度。In this embodiment of the present invention, by determining the reference line on the first image, a mirror image is obtained according to the first sub-image located on the first side of the reference line in the first image, and the second sub-image on the second side of the reference line is The image is replaced with a mirror image of the first sub-image to obtain a second image, that is, a second image including the first sub-image and its mirror image can be displayed. Therefore, the reflection image can be automatically generated, the simulated generation of the reflection image can be realized, the dependence on the environment or props and the shooting skills during the shooting process is reduced, the shooting difficulty is reduced, and the user experience is improved. And the above process also introduces the type of water surface or blurring. In addition, by receiving user input, the target water surface type and blur degree can be adjusted, the blur degree of the mirror image can be modified, and the sundries in the image can be eliminated. , thereby further improving the fidelity of the reflection image.

对于该图像处理装置的实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处及有益效果参见方法实施例的部分说明即可。As for the embodiment of the image processing apparatus, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts and beneficial effects can be referred to the partial description of the method embodiment.

本发明实施例还提供了一种电子设备,包括:The embodiment of the present invention also provides an electronic device, including:

包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如前述实施例提供的图像处理方法的步骤。本发明实施例提供的电子设备能够实现图1至图7-2的方法实施例中电子设备实现的各个过程,为避免重复,这里不再赘述。It includes a processor, a memory, and a computer program stored on the memory and executable on the processor, and when the computer program is executed by the processor, implements the steps of the image processing method provided by the foregoing embodiments. The electronic device provided in the embodiment of the present invention can implement each process implemented by the electronic device in the method embodiments of FIG. 1 to FIG. 7-2 . To avoid repetition, details are not repeated here.

图10为实现本发明各个实施例的一种电子设备的硬件结构示意图;10 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention;

该电子设备500包括但不限于:射频单元501、网络模块502、音频输出单元503、输入单元504、传感器505、显示单元506、用户输入单元507、接口单元508、存储器509、处理器510、以及电源511等部件。本领域技术人员可以理解,图10中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本发明实施例中,电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and Power 511 and other components. Those skilled in the art can understand that the structure of the electronic device shown in FIG. 10 does not constitute a limitation on the electronic device, and the electronic device may include more or less components than the one shown, or combine some components, or different components layout. In this embodiment of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.

其中,处理器510,用于获取第一图像;Wherein, the processor 510 is configured to acquire the first image;

在所述第一图像上确定参考线;determining a reference line on the first image;

根据所述第一图像中位于所述参考线的第一侧的第一子图像,得到镜像图像;obtaining a mirror image according to the first sub-image located on the first side of the reference line in the first image;

将所述第一图像中位于所述参考线的第二侧的第二子图像替换为所述镜像图像,得到第二图像;replacing the second sub-image on the second side of the reference line in the first image with the mirror image to obtain a second image;

通过显示单元506显示所述第二图像。The second image is displayed by the display unit 506 .

在本发明实施例中,通过在第一图像上确定参考线,根据第一图像中位于参考线的第一侧的第一子图像,得到镜像图像,将参考线的第二侧的第二子图像替换为第一子图像的镜像图像,得到第二图像,即可以显示一个包括第一子图像及其镜像图像的第二图像。从而,可以自动生成倒影图像,实现倒影图像的模拟生成,减少拍摄过程中对环境或道具以及拍摄技巧的依赖,降低拍摄困难度,提升用户体验。In this embodiment of the present invention, by determining the reference line on the first image, a mirror image is obtained according to the first sub-image located on the first side of the reference line in the first image, and the second sub-image on the second side of the reference line is The image is replaced with a mirror image of the first sub-image to obtain a second image, that is, a second image including the first sub-image and its mirror image can be displayed. Therefore, the reflection image can be automatically generated, the simulated generation of the reflection image can be realized, the dependence on the environment or props and the shooting skills during the shooting process is reduced, the shooting difficulty is reduced, and the user experience is improved.

应理解的是,本发明实施例中,射频单元501可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器510处理;另外,将上行的数据发送给基站。通常,射频单元501包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元501还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in this embodiment of the present invention, the radio frequency unit 501 can be used for receiving and sending signals during sending and receiving of information or during a call. Specifically, after receiving the downlink data from the base station, it is processed by the processor 510; The uplink data is sent to the base station. Generally, the radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.

电子设备通过网络模块502为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The electronic device provides the user with wireless broadband Internet access through the network module 502, such as helping the user to send and receive emails, browse web pages, access streaming media, and the like.

音频输出单元503可以将射频单元501或网络模块502接收的或者在存储器509中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元503还可以提供与电子设备500执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元503包括扬声器、蜂鸣器以及受话器等。The audio output unit 503 may convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into audio signals and output as sound. Also, the audio output unit 503 may also provide audio output related to a specific function performed by the electronic device 500 (eg, call signal reception sound, message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, and the like.

输入单元504用于接收音频或视频信号。输入单元504可以包括图形处理器(Graphics Processing Unit,GPU)5041和麦克风5042,图形处理器5041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元506上。经图形处理器5041处理后的图像帧可以存储在存储器509(或其它存储介质)中或者经由射频单元501或网络模块502进行发送。麦克风5042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元501发送到移动通信基站的格式输出。The input unit 504 is used to receive audio or video signals. The input unit 504 may include a graphics processor (Graphics Processing Unit, GPU) 5041 and a microphone 5042, and the graphics processor 5041 is used for still pictures or video images obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode data is processed. The processed image frames may be displayed on the display unit 506 . The image frames processed by the graphics processor 5041 may be stored in the memory 509 (or other storage medium) or transmitted via the radio frequency unit 501 or the network module 502 . The microphone 5042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 501 for output in the case of a telephone call mode.

电子设备500还包括至少一种传感器505,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板5061的亮度,接近传感器可在电子设备500移动到耳边时,关闭显示面板5061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器505还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The electronic device 500 also includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 5061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 5061 and the display panel 5061 when the electronic device 500 is moved to the ear. / or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of electronic devices (such as horizontal and vertical screen switching, related games , magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 505 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, Infrared sensors, etc., are not repeated here.

显示单元506用于显示由用户输入的信息或提供给用户的信息。显示单元506可包括显示面板5061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板5061。The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.

用户输入单元507可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元507包括触控面板5071以及其他输入设备5072。触控面板5071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板5071上或在触控面板5071附近的操作)。触控面板5071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器510,接收处理器510发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板5071。除了触控面板5071,用户输入单元507还可以包括其他输入设备5072。具体地,其他输入设备5072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 507 may be used to receive input numerical or character information, and generate key signal input related to user setting and function control of the electronic device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072 . The touch panel 5071, also referred to as a touch screen, can collect the user's touch operations on or near it (such as the user's finger, stylus, etc., any suitable object or accessory on or near the touch panel 5071). operate). The touch panel 5071 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, 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 then sends it to the touch controller. To the processor 510, the command sent by the processor 510 is received and executed. In addition, the touch panel 5071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 5071 , the user input unit 507 may also include other input devices 5072 . Specifically, other input devices 5072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.

进一步的,触控面板5071可覆盖在显示面板5061上,当触控面板6071检测到在其上或附近的触摸操作后,传送给处理器510以确定触摸事件的类型,随后处理器510根据触摸事件的类型在显示面板5061上提供相应的视觉输出。虽然在图10中,触控面板5071与显示面板5061是作为两个独立的部件来实现电子设备的输入和输出功能,但是在某些实施例中,可以将触控面板5071与显示面板5061集成而实现电子设备的输入和输出功能,具体此处不做限定。Further, the touch panel 5071 can be covered on the display panel 5061. When the touch panel 6071 detects a touch operation on or near it, it transmits it to the processor 510 to determine the type of the touch event, and then the processor 510 determines the type of the touch event according to the touch The type of event provides a corresponding visual output on display panel 5061. Although in FIG. 10 , the touch panel 5071 and the display panel 5061 are used as two independent components to realize the input and output functions of the electronic device, but in some embodiments, the touch panel 5071 and the display panel 5061 can be integrated The implementation of the input and output functions of the electronic device is not specifically limited here.

接口单元508为外部装置与电子设备500连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元508可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到电子设备500内的一个或多个元件或者可以用于在电子设备500和外部装置之间传输数据。The interface unit 508 is an interface for connecting an external device to the electronic device 500 . For example, external devices may include wired or wireless headset ports, external power (or battery charger) ports, wired or wireless data ports, memory card ports, ports for connecting devices with identification modules, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 508 may be used to receive input (eg, data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 500 or may be used between the electronic device 500 and external Transfer data between devices.

存储器509可用于存储软件程序以及各种数据。存储器509可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器509可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 509 may be used to store software programs as well as various data. The memory 509 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of the mobile phone (such as audio data, phone book, etc.), etc. Additionally, memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

处理器510是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器509内的软件程序和/或模块,以及调用存储在存储器509内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。处理器510可包括一个或多个处理单元;优选的,处理器510可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器510中。The processor 510 is the control center of the electronic device, using various interfaces and lines to connect various parts of the entire electronic device, by running or executing the software programs and/or modules stored in the memory 509, and calling the data stored in the memory 509. , perform various functions of electronic equipment and process data, so as to monitor electronic equipment as a whole. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem The processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 510.

电子设备500还可以包括给各个部件供电的电源511(比如电池),优选的,电源511可以通过电源管理系统与处理器510逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The electronic device 500 may also include a power supply 511 (such as a battery) for supplying power to various components. Preferably, the power supply 511 may be logically connected to the processor 510 through a power management system, so as to manage charging, discharging, and power consumption management through the power management system and other functions.

另外,电子设备500包括一些未示出的功能模块,在此不再赘述。In addition, the electronic device 500 includes some functional modules not shown, which will not be repeated here.

本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, each process of the above image processing method embodiments can be implemented, and the same technology can be achieved. The effect, in order to avoid repetition, is not repeated here. The computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present invention.

上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本发明的保护之内。The embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of the present invention, without departing from the spirit of the present invention and the scope protected by the claims, many forms can be made, which all belong to the protection of the present invention.

Claims (10)

1. An image processing method applied to an electronic device, the method comprising:
acquiring a first image;
determining a reference line on the first image;
obtaining a mirror image according to a first sub-image which is positioned on the first side of the reference line in the first image;
replacing a second sub-image positioned on a second side of the reference line in the first image with the mirror image to obtain a second image;
and displaying the second image.
2. The method according to claim 1, wherein the determining a reference line on the first image specifically comprises:
receiving a first input of a user;
in response to the first input, a position and/or a shape of the reference line on the first image is determined.
3. The method according to claim 1, wherein obtaining a mirror image from a first sub-image of the first image on a first side of the reference line comprises:
receiving a second input of the user;
determining a target water surface type in response to the second input;
and obtaining the mirror image according to the first sub-image and the type of the target water surface.
4. The method according to claim 1, wherein obtaining a mirror image from a first sub-image of the first image on a first side of the reference line comprises:
receiving a third input of the user;
determining a degree of blur of the mirror image in response to the third input;
and obtaining the mirror image according to the first sub-image and the ambiguity.
5. The method of claim 1, wherein after the displaying the second image, the method further comprises:
receiving a fourth input from the user;
in response to the fourth input, determining a second water surface type and adjusting the mirror image in the second image to correspond to the second water surface type;
and/or the presence of a gas in the gas,
receiving a fifth input of the user;
adjusting a degree of blur of the mirrored image in the second image in response to the fifth input.
6. An image processing apparatus characterized by comprising:
the acquisition module is used for acquiring a first image;
a determining module for determining a reference line on the first image;
the mirror image module is used for obtaining a mirror image according to a first sub-image which is positioned on the first side of the reference line in the first image;
the replacing module is used for replacing a second sub-image which is positioned on the second side of the reference line in the first image with the mirror image to obtain a second image;
and the display module is used for displaying the second image.
7. The apparatus of claim 6, wherein the determining module comprises:
a first receiving submodule for receiving a first input;
a first response submodule for determining a position and/or a shape of the reference line on the first image in response to the first input.
8. The apparatus of claim 6, wherein the mirroring module comprises:
the second receiving submodule is used for receiving a second input of the user;
a second response submodule for determining a target water surface type in response to the second input;
and the mirror image submodule is used for obtaining the mirror image according to the first sub image and the type of the target water surface.
9. The apparatus of claim 6, wherein the mirroring module comprises:
the third receiving submodule is used for receiving a third input of the user;
a third response submodule for determining a degree of blur of the mirrored image in response to the third input;
and the mirror image submodule is used for obtaining the mirror image according to the first sub-image and the ambiguity.
10. The apparatus of claim 6, further comprising:
the fourth receiving module is used for receiving a fourth input of the user;
a fourth response module, configured to determine a second water surface type in response to the fourth input, and adjust the mirror image in the second image to correspond to the second water surface type;
and/or the presence of a gas in the gas,
the fifth receiving module is used for receiving fifth input of the user;
a fifth response module to adjust a blur level of the mirrored image in the second image in response to the fifth input.
CN202010239780.0A 2020-03-30 2020-03-30 Image processing method and device Pending CN111432123A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010239780.0A CN111432123A (en) 2020-03-30 2020-03-30 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010239780.0A CN111432123A (en) 2020-03-30 2020-03-30 Image processing method and device

Publications (1)

Publication Number Publication Date
CN111432123A true CN111432123A (en) 2020-07-17

Family

ID=71550308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010239780.0A Pending CN111432123A (en) 2020-03-30 2020-03-30 Image processing method and device

Country Status (1)

Country Link
CN (1) CN111432123A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112135047A (en) * 2020-09-23 2020-12-25 努比亚技术有限公司 Image processing method, mobile terminal and computer storage medium
CN112346613A (en) * 2020-10-29 2021-02-09 深圳Tcl新技术有限公司 Icon display effect control method, terminal and computer-readable storage medium
CN113674435A (en) * 2021-07-27 2021-11-19 阿里巴巴新加坡控股有限公司 Image processing method, electronic map display method and device and electronic equipment
CN114286009A (en) * 2021-12-29 2022-04-05 维沃移动通信有限公司 Inverted image shooting method and device, electronic equipment and storage medium
CN114445805A (en) * 2022-01-29 2022-05-06 北京百度网讯科技有限公司 Attribute recognition model training, attribute recognition method, device and equipment
WO2025001807A1 (en) * 2023-06-27 2025-01-02 北京字跳网络技术有限公司 Image processing method and apparatus, and device and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199610A (en) * 2014-08-27 2014-12-10 联想(北京)有限公司 Information processing method and electronic device
CN107945135A (en) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN108055463A (en) * 2017-12-26 2018-05-18 努比亚技术有限公司 Image processing method, terminal and storage medium
WO2018122448A1 (en) * 2016-12-29 2018-07-05 Nokia Technologies Oy Method and apparatus for determining and varying the panning speed of an image based on saliency
CN108632413A (en) * 2018-05-15 2018-10-09 维沃移动通信有限公司 A camera method and mobile terminal
CN108900903A (en) * 2018-07-27 2018-11-27 北京市商汤科技开发有限公司 Method for processing video frequency and device, electronic equipment and storage medium
CN110599394A (en) * 2019-09-12 2019-12-20 北京字节跳动网络技术有限公司 Method and device for processing pictures in online presentation, storage medium and equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199610A (en) * 2014-08-27 2014-12-10 联想(北京)有限公司 Information processing method and electronic device
WO2018122448A1 (en) * 2016-12-29 2018-07-05 Nokia Technologies Oy Method and apparatus for determining and varying the panning speed of an image based on saliency
CN107945135A (en) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN108055463A (en) * 2017-12-26 2018-05-18 努比亚技术有限公司 Image processing method, terminal and storage medium
CN108632413A (en) * 2018-05-15 2018-10-09 维沃移动通信有限公司 A camera method and mobile terminal
CN108900903A (en) * 2018-07-27 2018-11-27 北京市商汤科技开发有限公司 Method for processing video frequency and device, electronic equipment and storage medium
CN110599394A (en) * 2019-09-12 2019-12-20 北京字节跳动网络技术有限公司 Method and device for processing pictures in online presentation, storage medium and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一米微读: "如何制作水中倒影的特效图片效果", 《百度经验》 *
大方有约: "怎样让图片产生倒影效果", 《百度经验》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112135047A (en) * 2020-09-23 2020-12-25 努比亚技术有限公司 Image processing method, mobile terminal and computer storage medium
CN112346613A (en) * 2020-10-29 2021-02-09 深圳Tcl新技术有限公司 Icon display effect control method, terminal and computer-readable storage medium
CN113674435A (en) * 2021-07-27 2021-11-19 阿里巴巴新加坡控股有限公司 Image processing method, electronic map display method and device and electronic equipment
CN114286009A (en) * 2021-12-29 2022-04-05 维沃移动通信有限公司 Inverted image shooting method and device, electronic equipment and storage medium
CN114286009B (en) * 2021-12-29 2025-07-11 维沃移动通信有限公司 Reflection image shooting method, device, electronic device and storage medium
CN114445805A (en) * 2022-01-29 2022-05-06 北京百度网讯科技有限公司 Attribute recognition model training, attribute recognition method, device and equipment
WO2025001807A1 (en) * 2023-06-27 2025-01-02 北京字跳网络技术有限公司 Image processing method and apparatus, and device and medium

Similar Documents

Publication Publication Date Title
CN108668083B (en) Photographing method and terminal
CN109862267B (en) Shooting method and terminal equipment
CN107817939B (en) Image processing method and mobile terminal
CN111432123A (en) Image processing method and device
WO2019174628A1 (en) Photographing method and mobile terminal
CN107872623A (en) A shooting method, mobile terminal and computer-readable storage medium
CN109032445B (en) A screen display control method and terminal device
CN111026316A (en) Image display method and electronic equipment
US20200341623A1 (en) Image display method and mobile terminal
CN109683777B (en) Image processing method and terminal equipment
CN111159449B (en) Image display method and electronic device
CN109788204A (en) Shooting processing method and terminal device
CN108632413B (en) Photographing method and mobile terminal
CN111124231B (en) Image generation method and electronic device
CN110086998B (en) A shooting method and terminal
CN110536005B (en) Object display adjustment method and terminal
CN110515521A (en) A screenshot method and mobile terminal
CN111124227A (en) Image display method and electronic equipment
CN110650367A (en) Video processing method, electronic device, and medium
CN111752450A (en) Display method, device and electronic device
CN111464746B (en) Photographing method and electronic equipment
CN107959755B (en) A kind of photographing method, mobile terminal and computer readable storage medium
CN111176526B (en) Picture display method and electronic equipment
CN110908517B (en) Image editing method, device, electronic device and medium
CN110443752B (en) Image processing method and mobile terminal

Legal Events

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200717

RJ01 Rejection of invention patent application after publication