WO2017101372A1 - 一种电子设备实现哈哈镜拍照效果的方法和装置 - Google Patents
一种电子设备实现哈哈镜拍照效果的方法和装置 Download PDFInfo
- Publication number
- WO2017101372A1 WO2017101372A1 PCT/CN2016/088886 CN2016088886W WO2017101372A1 WO 2017101372 A1 WO2017101372 A1 WO 2017101372A1 CN 2016088886 W CN2016088886 W CN 2016088886W WO 2017101372 A1 WO2017101372 A1 WO 2017101372A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image data
- preset
- image area
- image
- electronic device
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/18—Image warping, e.g. rearranging pixels individually
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04845—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/725—Cordless telephones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
Definitions
- the present invention relates to the field of electronic device technologies, and in particular, to a method and apparatus for implementing a photographing effect of an electronic device.
- Haha mirrors are popular with many people because of their fun, but the unique effects of haha mirrors can not be conveniently saved as electronic photos to commemorate or share.
- the camera technology of smart phones is very mature, but there is no mature solution to add the haha mirror effect to the camera application of the mobile phone. If the user wants to add a mirror effect to the photo, it can only be processed by post processing software such as PhotoShop (an image processing software), the efficiency is very low, and the photo quality will be lost to a certain extent, and the user experience is poor.
- post processing software such as PhotoShop (an image processing software)
- the embodiment of the invention provides a method and a device for realizing a photographing effect of an electronic device, which is used to solve a camera application that is not matured in the prior art, and adds a haha mirror effect to a mobile phone camera application, and a post-processing software performs a haha mirror effect processing.
- the efficiency is very low, and the photo quality will be lost to a certain extent, and the user experience will be poor.
- the embodiment of the invention discloses a method for realizing a photographing effect of an electronic device, which comprises the following steps: running a shooting mode of the electronic device; acquiring image data of each frame of the live view of the camera module of the electronic device, and Performing, according to a preset haha mirror algorithm, the image data of each frame in real time, displaying the processed image data on a shooting preview interface of the electronic device; receiving a photographing instruction; acquiring image data collected by the camera module, and according to the pre-preparation
- the haha mirror algorithm is used to process the collected image data, and generate compression coding according to the processed image data. Code image.
- the embodiment of the present invention further discloses an apparatus for realizing a photographing effect of an electronic device, comprising: an operation module for operating a shooting mode of the electronic device; and a display module for acquiring a camera module of the electronic device in real time. Aligning each frame of image data, and processing each frame of image data in real time according to a preset haha mirror algorithm, displaying the processed image data on a shooting preview interface of the electronic device; and an instruction receiving module for receiving a photographing instruction And a picture generating module, configured to acquire image data collected by the camera module, and process the collected image data according to the preset mirror image algorithm, and generate a compressed coded picture according to the processed image data.
- a computer program comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform the electronic device to implement a mirror image The method of effect.
- a computer readable medium wherein the computer program is stored.
- the method and device for realizing the photographing effect of the electronic device by the electronic device provided by the embodiment of the present invention, after running the shooting mode of the electronic device, acquiring image data of each frame of the live view of the camera module of the electronic device, and according to the preset mirror algorithm The image data of each frame is processed in real time, and the processed image data is displayed on the shooting preview interface of the electronic device. And after receiving the photographing instruction, acquiring image data collected by the camera module, processing the collected image data according to a preset haha mirror algorithm, and generating a compression encoded image according to the processed image data.
- the camera function of the electronic device is directly started, and the effect of the mirror is introduced into the photograph, so that when the user takes a photo, the preview interface and the film directly present the effect of the mirror, which is intuitive and efficient; in addition, since the camera module is directly compressed before encoding
- the frame image data collected by the group is processed according to the preset haha mirror algorithm, which can ensure that the picture pixels are not lost to the greatest extent, and the user experience is improved.
- FIG. 1 is a schematic diagram of an embodiment of a method for implementing a photo-taking effect of an electronic device according to the present invention. flow chart;
- FIG. 2 is a schematic diagram of image data in a first designated image area in a specific embodiment of a method for realizing a haha mirror photographing effect of an electronic device according to the present invention
- FIG. 3 is a schematic diagram of image data in a first specified image region after compression processing in a method for realizing a photographing effect of an electronic device according to an embodiment of the present invention
- FIG. 4 is a schematic diagram of image data in a first specified image area after augmentation processing in a method for realizing a photographing effect of an electronic device according to an embodiment of the present invention
- FIG. 5 is a schematic diagram of a color band in a third designated image area in a specific embodiment of a method for realizing a photographing effect of an electronic device according to the present invention
- FIG. 6 is a schematic diagram of a method for realizing a photo-reduction deformation of an electronic device according to an embodiment of the present invention
- FIG. 7 is a schematic diagram of a first image area and a second image area before processing in a specific embodiment of an electronic device according to the present invention.
- FIG. 8 is a schematic diagram of a first image area and a second image area after a linear transition process in a method for realizing a photographing effect of an electronic device according to an embodiment of the present invention
- FIG. 9 is a schematic diagram of a method for performing a quadratic function transition of a first image region and a second image region in a method for implementing a photo-taking effect of an electronic device according to an embodiment of the present invention.
- FIG. 10 is a schematic diagram of a first image area and a second image area arc transition processing in a method for realizing a photographing effect of an electronic device according to an embodiment of the present invention
- FIG. 11 is a structural block diagram of an embodiment of an apparatus for implementing a photographing effect of an electronic device according to the present invention.
- FIG. 12 is a schematic diagram of a process of processing image data in a specific embodiment of an apparatus for realizing a haha mirror photographing effect of an electronic device according to the present invention
- Figure 13 schematically shows a block diagram of a computing device for performing the method according to the invention
- Fig. 14 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
- the electronic device of the embodiment of the invention may be an electronic device having a photographing function, such as a mobile phone, a camera, a notebook computer or a tablet computer.
- FIG. 1 a flow chart of steps of an embodiment of a method for implementing a photo-taking effect of an electronic device according to the present invention is shown.
- the method for realizing the photographing effect of the electronic device can include the following steps:
- step S1 runs the shooting mode of the electronic device.
- S2 acquiring image data of each frame of the real-time view of the camera module of the electronic device, and processing each frame image data in real time according to a preset haha mirror algorithm, and displaying the processed image data on a shooting preview interface of the electronic device.
- the camera module may include a camera, an analog to digital conversion module, and the like. Specifically, after the step S1, the camera module of the electronic device captures the light information in real time, that is, the camera module receives the optical information, and performs pre-processing such as analog-to-digital conversion on the received optical information to obtain the image data of each frame described above.
- step S2 when the camera module is framing, the image data of each frame of the framing through the software system of the electronic device is directly processed according to the preset mirror algorithm, and then sent to the display screen of the electronic device, thereby Maximize the shooting preview interface, for example, the camera pixel (Application) application preview interface does not lose the picture pixels, and allows the user to view the photo's mirror effect in real time and intuitively, greatly improving the user. Experience.
- step S3 receives the photographing instruction.
- S4 Obtain image data collected by the camera module, process the collected image data according to a preset haha mirror algorithm, and generate a compression coded picture according to the processed image data.
- the camera module collects optical information, and performs pre-processing such as analog-to-digital conversion on the collected optical information to obtain the collected image data.
- the collected image data may be cached to the system memory, so that the captured image data can be efficiently performed according to the preset mirror algorithm in step S4. deal with.
- Step S4 can directly process the image data collected and uncompressed by the camera module according to the preset haha mirror algorithm through the software system of the electronic device, and then compress the processed image data through the software system of the electronic device.
- a picture encoded in a preset format which is a picture with the desired mirror effect of the user. Therefore, it is possible to ensure that the pixels are not lost to the greatest extent, and the user experience is greatly improved.
- the preset format may be a JPEG (Joint Photographic Experts Group) format, a GIF (Graphics Interchange Format) format, or a PNG (Portable Network Graphic Format) format. And other formats.
- the system memory occupied by the collected image data may be released, thereby improving system efficiency.
- the foregoing preset mirror algorithm may include: compressing image data in the first specified image region by a first preset ratio.
- the compressing the image data in the first specified image area by the first preset ratio may be performed by compressing the number of pixels in the image data in the first specified image area by a first preset ratio, where the first preset ratio is greater than 0 and less than 1.
- the shooting preview interface may display a compression direction selection list
- the compression direction selection list may include a horizontal compression button, a vertical compression button, a circular compression button, and the like
- the shooting preview interface may display a compression ratio adjustment button. Or compress the ratio selection list and so on.
- the shooting preview interface displays two longitudinal adjustment lines, and the area between the two longitudinal adjustment lines is the first specified image area, and the user can adjust any adjustment line to adjust The size of the first specified image area;
- the shooting preview interface displays two horizontal adjustment lines, and the area between the two horizontal adjustment lines is the first specified image area, and the user moves any one Adjusting the line, the size of the first specified image area can be adjusted;
- the shooting preview interface displays a circular adjustment line, and the area between the circular adjustment lines is the first specified image area.
- the user adjusts the radius of the circle, you can Adjust the size of the first specified image area.
- the user can adjust the first preset ratio by compressing the scale adjustment button or by compressing the scale selection list or the like.
- the image data in the first specified image area is as shown in FIG. 2, and the algorithm according to the preset haha mirror
- FIG. 3 wherein the two longitudinal adjustment lines in FIG. 2 are as shown by broken lines in the figure.
- the foregoing preset mirror algorithm may include: expanding image data in the second specified image area by a second preset ratio.
- the second preset ratio is greater than one.
- the expanding the image data in the second specified image area by the second preset ratio may be performed by expanding the number of pixels in the image data in the second specified image area by a second preset ratio.
- the shooting preview interface may display an extended direction selection list
- the extended direction selection list may include a horizontal expansion button, a vertical expansion button, a circular expansion button, and the like
- the shooting preview interface may display an expansion ratio adjustment button. Or expand the proportional selection list and so on.
- the shooting preview interface displays two longitudinal adjustment lines, and the area between the two vertical adjustment lines is the second designated image area, and the user can adjust any adjustment line to adjust The size of the second designated image area; when the user selects the vertical expansion button, the shooting preview interface displays two horizontal adjustment lines, and the area between the two horizontal adjustment lines is the second designated image area, and the user moves any one Adjusting the line, the size of the second designated image area can be adjusted; when the user selects the circular compression button, the shooting preview interface displays a circular adjustment line, and the area between the circular adjustment lines is the second specified image area. The user adjusts the radius of the circle to adjust the size of the second specified image area. In addition, the user can adjust the second preset ratio by expanding the scale adjustment button or by expanding the scale selection list.
- the image data in the second specified image region is the same as the image data in the first specified image region, that is, The image data in the second designated image area is as shown in FIG. 2.
- the image data in the first designated image area after the expansion processing according to the preset haha mirror algorithm is as shown in FIG. 4.
- the foregoing preset mirror algorithm may include: placing the third finger
- the pixels in the fixed image area are equally divided into 100 parts along the preset direction, and different coordinates are sequentially given in sequence, wherein the range of coordinates corresponding to each pixel is 1-100, and each pixel is further converted according to a preset conversion formula.
- the corresponding coordinates are subjected to transform processing, and finally each pixel is shifted to the coordinates after the transform processing.
- the preset direction may be a horizontal direction or a vertical direction or a circumferential direction.
- the preset conversion formula may specifically be:
- x is the coordinate corresponding to any one of the 100 pixels
- y is the coordinate after the transformation process.
- the preset mirror image algorithm can deform the image in the third specified image region, and the image pixels in the third specified image region do not overflow and are not reduced, and the image outside the third specified image region is not affected.
- the image data in the third designated image area is a ribbon of uniform length as shown in FIG. 5, the ribbon having a total of 10 colors.
- the preset haha mirror algorithm divides the pixels in the third specified image area into 100 groups in the horizontal direction, and assigns coordinates from 0 to 100 from left to right.
- Preset haha mirror algorithm based on Transform the coordinates of each pixel to achieve forward compression deformation, then:
- Corresponding coordinate of a pixel corresponding to coordinate 0 after the transformation process is 0;
- Corresponding coordinate of a pixel corresponding to coordinate 10 after the transformation process is 32;
- Corresponding coordinate of a pixel corresponding to coordinate 20 after transformation processing is 45;
- Corresponding coordinate of a pixel corresponding to coordinate 30 after the transformation process is 55;
- Corresponding coordinate of a pixel corresponding to coordinate 40 after the transformation process is 63;
- Corresponding coordinates of a pixel corresponding to coordinate 50 after the transformation process is 71;
- Corresponding coordinate of a pixel corresponding to coordinate 60 after transformation processing is 77;
- Corresponding coordinate of a pixel corresponding to coordinate 70 after the transformation process is 84;
- Corresponding coordinates of a pixel corresponding to the coordinate of 80 after the transformation process is 89;
- Corresponding coordinates of a pixel corresponding to a coordinate of 90 after the transformation process is 95;
- a pixel corresponding to a coordinate of 100 has a corresponding coordinate of 100 after the transform processing.
- the color band in the third designated image area is processed by the preset mirror algorithm, and the processed The ribbon is shown in Figure 6.
- the preset mirror image algorithm may include dividing the fourth specified image area into the first image area and the second image area, and then pressing the third preset on the image data in the first image area.
- the scale is expanded while compressing the image data in the second image area by a fourth preset ratio.
- the third preset ratio is greater than 0 and less than 1, and the fourth preset ratio is greater than 1.
- the shooting preview interface may display a deformation direction selection list, wherein the deformation direction selection list may include a left to right deformation button, a right to left deformation button, a top to bottom deformation button, and a slave
- the bottom up deformation button, etc. and the shooting preview interface can display rectangular or square or circular adjustment lines, etc., the area between the rectangular or square or circular adjustment lines is the fourth designated image area, and the shooting preview interface can The compression ratio adjustment button or the compression ratio selection list is displayed, or the shooting preview interface can display the expansion ratio adjustment button or the expansion ratio selection list.
- the preset mirror algorithm can divide the fourth specified image region into a first image region of the left portion and a second image region of the right portion by a longitudinal dividing line.
- the image area has a first intersection between the longitudinal dividing line and the upper outer frame of the fourth designated image area, and the second dividing point between the longitudinal dividing line and the lower outer frame of the fourth designated image area; when the user selects the deformation button from top to bottom Or when the button is deformed from the bottom to the top, the preset mirror algorithm can divide the fourth designated image area into the upper first image area and the lower second image area by the lateral dividing line, the horizontal dividing line and the fourth designated image area left part There is a third intersection between the outer frames, and a fourth intersection between the lateral dividing line and the right outer frame of the fourth designated image area.
- the user can adjust the size of the fourth designated image area by adjusting a rectangular or square or circular adjustment line, and can adjust the third preset ratio by setting a compression ratio adjustment button or a compression ratio selection list.
- the fourth preset ratio can be adjusted by setting the expansion scale adjustment button or expanding the scale selection list.
- the image data in the first image area is expanded according to a third preset ratio, and the image data in the second image area is compressed according to a fourth preset ratio, including:
- the image data in the first image area is expanded step by step according to a preset transition mode, and the image data in the second image area is sequentially incremented and compressed in a preset transition manner.
- the image data in the first image region is incremented step by step according to a preset transition mode
- the image data in the second image region is incremented step by step according to a preset transition mode. Compression can ensure smooth transition of the image at the edge of the fourth specified image area and the image outside the fourth specified image area.
- the shooting preview interface may display a transition mode selection list, where the transition mode selection list may include a straight transition button, a quadratic function transition button, or a circular transition button.
- the transition mode selection list may include a straight transition button, a quadratic function transition button, or a circular transition button.
- the shooting preview interface displays the first transition line and the second transition line;
- the shooting preview interface displays the first transition arc and the second transition arc;
- the shooting preview interface displays a transition arc.
- the user selects a straight transition button and the user selects a left to right deformation button, and the adjustment preview screen displays a rectangular adjustment line 1a and a dividing line 1b as shown in FIG.
- the preset haha mirror algorithm expands the image data of the portion on the first image region step by step from top to bottom along the first transition line, and the image data of the lower portion of the first image region, from bottom to top.
- the two transition lines are incremented step by step, and the image data of the portion of the second image region is preset by the haha mirror algorithm, and the image is progressively incremented from top to bottom along the first transition line, and the image of the lower portion of the second image region is compressed.
- the data is compressed step by step from the bottom to the second along the second transition line, and the image in the fourth specified image area processed by the preset haha mirror algorithm is as shown in FIG. 8 .
- the first transition straight line passes through the first intersection point
- the second transition straight line passes through the second intersection point
- the first transition straight line is the broken line 1c in FIG. 8
- the second transition straight line is the broken line 1d in FIG. 8
- the dividing line 1b is separated by the broken line 1c and the broken line 1d is cut into 1b1, 1b2 and 1b3.
- the user can freely adjust the position of the end point where the first transition straight line 1c does not intersect the rectangular adjustment line 1a, and the second transition straight line 1d does not intersect the rectangular adjustment line 1a.
- the position of the endpoint thus achieving the effect of adjusting the linear transition processing.
- the user selects the quadratic function transition button and the user selects the left to right deformation button, and the adjustment line 1a and the dividing line 1b of the shooting preview interface display rectangle are as shown in FIG.
- the preset haha mirror algorithm expands the image data of the portion on the first image region step by step from top to bottom along the first transition arc, and the image data of the lower portion of the first image region, from bottom to top.
- the second transition arc is incremented step by step, and the image data of the portion of the second image region is preset to be compressed step by step from top to bottom along the first transition arc and under the second image region.
- Part of the image data is compressed step by step from bottom to top along the second transition arc, and the image in the fourth specified image area processed by the preset haha mirror algorithm is as shown in FIG. 9 .
- the first transition arc passes through the first intersection point
- the second transition arc passes through the second intersection point
- the first transition arc is the broken line 2c in FIG. 9
- the second transition line is the broken line 2d in FIG. 9
- the dividing line 1b is dotted line 2c and 2d are cut off to 2b1, 2b2, and 2b3.
- the user can freely adjust the position of the end point where the first transition arc 2c does not intersect the rectangular adjustment line 1a, and the second transition arc 2d does not overlap with the rectangular adjustment line 1a.
- the position of the intersecting endpoints thereby achieving the effect of adjusting the quadratic function transition processing.
- the user selects the arc transition button and the user selects the left to right deformation button, and the adjustment preview screen displays the rectangular adjustment line 1a and the division line 1b as shown in FIG.
- the preset haha mirror algorithm expands the image data of the portion on the first image region step by step from top to bottom along the transition arc, and the image data of the lower portion of the first image region, from the bottom to the top.
- the arc is incremented step by step, and the image data of the portion of the second image region is preset by the haha mirror algorithm, and the image is compressed step by step from the top to the bottom along the transition arc, and the image data of the lower portion of the second image region is
- the lower and upper transition arcs are progressively incremented for compression, and the image in the fourth specified image region processed by the preset haha mirror algorithm is as shown in FIG. Wherein, the transition arc passes through the first intersection point and the second intersection point, the transition arc is the broken line 3c in FIG. 10, and the division line 1b is cut into 3b1 and 3b2 by the broken line 3c.
- the processing of the preset mirror algorithm is preset.
- the preset mirror algorithm of the embodiment of the present invention may include, but is not limited to, the above four types.
- the first designated image area, the second designated image area, and the third The designated image area and the fourth designated image area may be the same image area or part of the same image area, so that when photographing, the camera APP can provide various kinds of mirror effects for the user to select, and can superimpose the use of the mirror effect, for example,
- the first specified image area After the image data is compressed according to the first preset ratio, and/or the image data in the first specified image area is expanded again according to the second preset ratio, and/or the pixel edge in the first specified image area is again
- the preset direction is equally divided into 100 parts, and different coordinates are sequentially assigned in sequence, wherein the range of coordinates corresponding to each pixel is 1-100, and then the coordinates corresponding to each pixel are transformed according to a preset conversion formula, and finally Shifting each pixel to the coordinate after the transformation process, and/or dividing the first specified
- the method for realizing the photographing effect of the electronic device after running the shooting mode of the electronic device, acquiring image data of each frame of the real-time viewing of the camera module of the electronic device, and real-time each according to a preset haha mirror algorithm
- the frame image data is processed, and the processed image data is displayed on the shooting preview interface of the electronic device.
- receiving the photographing instruction acquiring image data collected by the camera module, processing the collected image data according to a preset haha mirror algorithm, and generating a compression encoded image according to the processed image data.
- the camera function of the electronic device is directly started, and one or more kinds of mirror effects are introduced into the photographing, so that the user can freely select the haha mirror effect according to the needs when the photograph is taken, and the photographing preview interface and the sheet directly present the haha mirror effect, intuitively Efficient, user experience is good;
- the image data collected by the camera module is processed directly by the software system according to the preset haha mirror algorithm before compression coding, the picture pixels can be guaranteed to be free from loss.
- the device for realizing the photographing effect of the electronic device may include:
- Run module 1 to run the shooting mode of the electronic device.
- the running module 1 runs the shooting mode of the electronic device.
- the display module 2 is configured to acquire image data of each frame of the real-time viewfinder of the camera module of the electronic device, and process each frame image data in real time according to a preset haha mirror algorithm, and display the processed image data on the electronic device for shooting. Preview interface.
- the camera module may include a camera, an analog to digital conversion module, and the like. Specifically, after the module 1 is operated, the camera module of the electronic device captures the light information in real time, that is, the camera module receives the optical information, and the interface is connected. The received optical information is subjected to pre-processing such as analog-to-digital conversion to obtain image data of each frame described above.
- the display module 2 when the camera module is framing, the image data of each frame of the framing through the software system of the electronic device is directly processed according to the preset haha mirror algorithm, and then sent to the display screen of the electronic device, thereby It can ensure that the picture preview pixel in the shooting preview interface is not lost in the shooting preview interface, and the user can see the photo mirror effect in real time and intuitively in the shooting preview interface, which greatly improves the user experience.
- the instruction receiving module 3 is configured to receive a photographing instruction.
- the instruction receiving module 3 receives the photographing instruction.
- the image generating module 4 is configured to obtain image data collected by the camera module, process the collected image data according to a preset haha mirror algorithm, and generate a compression encoded image according to the processed image data.
- the camera module collects optical information, and performs pre-processing such as analog-to-digital conversion on the collected optical information to obtain the collected image data.
- the collected image data may be cached to the system memory, so that the image generation module 4 can efficiently collect the captured image according to the preset mirror algorithm.
- the data is processed.
- the image generation module 4 can directly process the image data collected by the camera module and the uncompressed code according to the software system of the electronic device, and then process the processed image data through the software system of the electronic device.
- a picture that is compression-encoded into a preset format, and the picture is a picture having a desired mirror effect of the user. Therefore, it is possible to ensure that the pixels are not lost to the greatest extent, and the user experience is greatly improved.
- the preset format may be a format such as a JPEG format, a GIF format, or a PNG format.
- the system memory occupied by the collected image data may be released, thereby improving system efficiency.
- the foregoing preset mirror algorithm may include: compressing image data in the first specified image region by a first preset ratio.
- the compressing the image data in the first specified image area by the first preset ratio may compress the number of pixels in the image data in the first specified image area by a first preset ratio.
- the first preset ratio is greater than 0 and less than 1.
- the shooting preview interface may display a compression direction selection list
- the compression direction selection list may include a horizontal compression button, a vertical compression button, a circular compression button, and the like
- the shooting preview interface may display a compression ratio adjustment button. Or compress the ratio selection list and so on.
- the shooting preview interface displays two longitudinal adjustment lines, and the area between the two longitudinal adjustment lines is the first specified image area, and the user can adjust any adjustment line to adjust The size of the first specified image area; when the user selects the vertical compression button, the shooting preview interface displays two horizontal adjustment lines, and the area between the two horizontal adjustment lines is the first specified image area, and the user moves any one Adjusting the line, the size of the first specified image area can be adjusted; when the user selects the circular compression button, the shooting preview interface displays a circular adjustment line, and the area between the circular adjustment lines is the first specified image area. The user adjusts the radius of the circle to adjust the size of the first specified image area. In addition, the user can adjust the first preset ratio by compressing the scale adjustment button or by compressing the scale selection list or the like.
- the foregoing preset mirror algorithm may include: expanding image data in the second specified image area by a second preset ratio.
- the second preset ratio is greater than one.
- the expanding the image data in the second specified image area by the second preset ratio may be performed by expanding the number of pixels in the image data in the second specified image area by a second preset ratio.
- the shooting preview interface may display an extended direction selection list
- the extended direction selection list may include a horizontal expansion button, a vertical expansion button, a circular expansion button, and the like
- the shooting preview interface may display an expansion ratio adjustment button. Or expand the proportional selection list and so on.
- the shooting preview interface displays two longitudinal adjustment lines, and the area between the two vertical adjustment lines is the second designated image area, and the user can adjust any adjustment line to adjust The size of the second designated image area; when the user selects the vertical expansion button, the shooting preview interface displays two horizontal adjustment lines, and the area between the two horizontal adjustment lines is the second designated image area, and the user moves any one Adjusting the line, the size of the second designated image area can be adjusted; when the user selects the circular compression button, the shooting preview interface displays a circular adjustment line, and the area between the circular adjustment lines is the second specified image area. , the user adjusts the radius of the circle, you can Adjust the size of the second specified image area. In addition, the user can adjust the second preset ratio by expanding the scale adjustment button or by expanding the scale selection list.
- the preset mirror image algorithm may include: dividing pixels in the third specified image area into 100 parts in a preset direction, and sequentially assigning different coordinates in order, wherein each The corresponding coordinates of the pixel are in the range of 1-100, and then the coordinates corresponding to each pixel are transformed according to a preset conversion formula, and finally each pixel is shifted to the coordinate after the transformation process.
- the preset direction may be a horizontal direction or a vertical direction or a circumferential direction.
- the preset conversion formula may specifically be:
- x is the coordinate corresponding to any one of the 100 pixels
- y is the coordinate after the transformation process.
- the preset mirror image algorithm may include dividing the fourth specified image area into the first image area and the second image area, and then pressing the third preset on the image data in the first image area.
- the scale is expanded while compressing the image data in the second image area by a fourth preset ratio.
- the third preset ratio is greater than 0 and less than 1, and the fourth preset ratio is greater than 1.
- the shooting preview interface may display a deformation direction selection list, wherein the deformation direction selection list may include a left to right deformation button, a right to left deformation button, a top to bottom deformation button, and a slave
- the bottom up deformation button, etc. and the shooting preview interface can display rectangular or square or circular adjustment lines, etc., the area between the rectangular or square or circular adjustment lines is the fourth designated image area, and the shooting preview interface can The compression ratio adjustment button or the compression ratio selection list is displayed, or the shooting preview interface can display the expansion ratio adjustment button or the expansion ratio selection list.
- the preset mirror algorithm can divide the fourth specified image region into a first image region of the left portion and a second image region of the right portion by a longitudinal dividing line.
- the image area, the longitudinal dividing line and the upper outer frame of the fourth designated image area have the same An intersection point, the longitudinal dividing line has a second intersection with the lower outer frame of the fourth designated image area; when the user selects the deformation button from the top to the bottom or the button from the bottom to the top, the preset mirror algorithm can be passed through the horizontal dividing line
- the fourth designated image area is divided into an upper first image area and a lower second image area, and the horizontal dividing line and the fourth designated image area have a third intersection between the left outer frame, the horizontal dividing line and the fourth designated image area right There is a fourth intersection between the outer frames.
- the user can adjust the size of the fourth designated image area by adjusting a rectangular or square or circular adjustment line, and can adjust the third preset ratio by setting a compression ratio adjustment button or a compression ratio selection list.
- the fourth preset ratio can be adjusted by setting the expansion scale adjustment button or expanding the scale selection list.
- the image data in the first image area is expanded according to a third preset ratio, and the image data in the second image area is compressed according to a fourth preset ratio, including:
- the image data in the first image area is expanded step by step according to a preset transition mode, and the image data in the second image area is sequentially incremented and compressed in a preset transition manner.
- the image data in the first image area is expanded step by step according to a preset transition mode, and the image data in the second image area is sequentially incremented and compressed according to a preset transition mode, which can ensure the fourth.
- the image at the edge of the specified image area and the image outside the fourth specified image area are smoothly transitioned.
- the shooting preview interface may display a transition mode selection list, where the transition mode selection list may include a straight transition button, a quadratic function transition button, or a circular transition button.
- the transition mode selection list may include a straight transition button, a quadratic function transition button, or a circular transition button.
- the shooting preview interface displays the first transition line and the second transition line;
- the shooting preview interface displays the first transition arc and the second transition arc;
- the shooting preview interface displays a transition arc.
- the electronic device is a mobile phone.
- the user opens the camera function of the mobile phone, and the camera module 11 of the mobile phone captures the image data 21, and the display module 2 passes the software system 5 according to the preset mirror algorithm.
- the image data 21 is processed, and the display module 3 displays the processed image data 31 in real time on the shooting preview interface 41 of the camera APP.
- the command receiving module 3 receives the photographing instruction
- the image generating module 4 acquires the image data 51 collected by the camera module 11, without performing JPEG compression encoding and uploading
- the image The generating module 4 is configured by the software system 5 according to a preset mirror
- the algorithm processes the image data 51, and further generates a compression coded picture 61 according to the image data 51.
- the compressed coded picture 61 is a picture in JPEG format, and the camera APP is notified to save the picture and complete the picture.
- the preset mirror algorithm of the embodiment of the present invention may include, but is not limited to, the above four types.
- the first designated image area, the second designated image area, and the third The designated image area and the fourth designated image area may be the same image area or part of the same image area, so that when photographing, the camera APP can provide various kinds of mirror effects for the user to select, and can superimpose the use of the mirror effect, for example, And compressing the image data in the first specified image area by a first preset ratio, and/or expanding the image data in the first specified image area by a second preset ratio, and/or again
- the pixels in the specified image area are equally divided into 100 parts along the preset direction, and different coordinates are sequentially given in sequence, wherein the range of coordinates corresponding to each pixel is 1-100, and then each pixel is determined according to a preset conversion formula.
- the device for implementing the photographing effect of the electronic device after the running module runs the shooting mode of the electronic device, the display module acquires image data of each frame of the live view of the camera module of the electronic device, and according to the preset mirror algorithm The image data of each frame is processed in real time, and the processed image data is displayed on the shooting preview interface of the electronic device. And after the instruction receiving module receives the photographing instruction, the image generating module acquires the image data collected by the camera module, and processes the collected image data according to a preset haha mirror algorithm, and generates a compression encoded image according to the processed image data.
- the camera function of the electronic device is directly started, and one or more kinds of mirror effects are introduced into the photographing, so that the user can freely select the haha mirror effect according to the needs when the photograph is taken, and the photographing preview interface and the sheet directly present the haha mirror effect, intuitively Efficient, user experience is good;
- the image data collected by the camera module is processed directly by the software system according to the preset haha mirror algorithm before compression coding, the picture pixels can be guaranteed to be free from loss.
- the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
- the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. It will be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the components of the method and apparatus for implementing the mirroring effect of an electronic device in accordance with an embodiment of the present invention. Or all features.
- DSP digital signal processor
- the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
- Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
- FIG. 13 illustrates a computing device that can implement a method of implementing a mirroring effect of an electronic device in accordance with the present invention.
- the computing device conventionally includes a processor 1310 and a computer program product or computer readable medium in the form of a memory 1320.
- the memory 1320 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
- Memory 1320 has a storage space 1330 for program code 1331 for performing any of the method steps described above.
- the storage space 1330 for program code may include respective program codes 1331 for implementing various steps in the above methods, respectively.
- the program code can be read from or written to one or more computer program products.
- Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
- Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
- the storage unit may have a storage segment, a storage space, and the like that are similarly arranged to the storage 1320 in the computing device of FIG.
- the program code can be compressed, for example, in an appropriate form.
- the storage unit comprises computer readable code 1331', i.e., may be, for example, such as 1310
- a code read by a processor, such as when executed by a computing device, causes the computing device to perform various steps in the methods described above.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Computer Networks & Wireless Communication (AREA)
- Studio Devices (AREA)
- Image Processing (AREA)
Abstract
一种电子设备实现哈哈镜拍照效果的方法和装置,方法包括:运行电子设备的拍摄模式;获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面;接收拍照指令;获取摄像头模组采集的图像数据,并根据预设哈哈镜算法对采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。本发明实施例能够实现拍照时拍摄预览界面和成片直接呈现哈哈镜效果,直观高效,并集成多种哈哈镜变形效果,便于用户自由选择,且能最大程度保证图片像素不损失和预览流畅度不损失,极大提高了用户体验。
Description
本申请要求在2015年12月15日提交中国专利局、申请号为201510938775.8、发明名称为“一种电子设备实现哈哈镜拍照效果的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及电子设备技术领域,特别是涉及一种电子设备实现哈哈镜拍照效果的方法和装置。
哈哈镜由于具有趣味性而受到很多人的欢迎,但是哈哈镜特有的效果并不能很方便的保存成电子照片来进行纪念或分享。
现在智能手机的拍照技术很成熟,但是目前还没有成熟的方案将哈哈镜效果添加进手机的相机应用。如果用户想给照片添加哈哈镜效果,则只能利用PhotoShop(一种图像处理软件)等后期处理软件进行处理,效率很低,并且照片质量会有一定程度的损失,用户体验差。
发明内容
本发明实施例提供一种电子设备实现哈哈镜拍照效果的方法和装置,用以在一定程度上解决目前没有成熟的方案将哈哈镜效果添加进手机的相机应用,以及后期处理软件进行哈哈镜效果处理时,效率很低,并且照片质量会有一定程度的损失,用户体验差的问题。
为了解决上述问题,本发明实施例公开了一种电子设备实现哈哈镜拍照效果的方法,包括以下步骤:运行电子设备的拍摄模式;获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对所述每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面;接收拍照指令;获取摄像头模组采集的图像数据,并根据所述预设哈哈镜算法对所述采集的图像数据进行处理,根据处理后的图像数据生成压缩编
码图片。
为了解决上述问题,本发明实施例还公开了一种电子设备实现哈哈镜拍照效果的装置,包括:运行模块,用于运行电子设备的拍摄模式;显示模块,用于获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对所述每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面;指令接收模块,用于接收拍照指令;图片生成模块,用于获取摄像头模组采集的图像数据,并根据所述预设哈哈镜算法对所述采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行所述的电子设备实现哈哈镜拍照效果的方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了所述的计算机程序。
本发明实施例提供的一种电子设备实现哈哈镜拍照效果的方法和装置,在运行电子设备的拍摄模式后,获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面。以及在接收拍照指令后,获取摄像头模组采集的图像数据,并根据预设哈哈镜算法对采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。从而实现直接从电子设备的相机功能入手,将哈哈镜效果引入拍照中,使得用户在拍照时,拍摄预览界面和成片直接呈现哈哈镜效果,直观高效;另外,由于在压缩编码前,直接对摄像头模组采集到的帧图像数据根据预设哈哈镜算法进行处理,可以最大程度保证图片像素不损失,提高了用户体验。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作以简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明的一种电子设备实现哈哈镜拍照效果的方法实施例的步骤
流程图;
图2是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中第一指定图像区域内的图像数据的示意图;
图3是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中压缩处理后的第一指定图像区域内的图像数据的示意图;
图4是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中扩充处理后的第一指定图像区域内的图像数据的示意图;
图5是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中第三指定图像区域内的彩带的示意图;
图6是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中彩带正向压缩形变后的示意图;
图7是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中第一图像区域和第二图像区域处理前的示意图;
图8是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中第一图像区域和第二图像区域直线过渡处理后的示意图;
图9是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中第一图像区域和第二图像区域二次函数过渡处理后的示意图;
图10是本发明的一种电子设备实现哈哈镜拍照效果的方法具体实施例中第一图像区域和第二图像区域圆弧过渡处理后的示意图;
图11是本发明的一种电子设备实现哈哈镜拍照效果的装置实施例的结构框图;
图12是本发明的一种电子设备实现哈哈镜拍照效果的装置具体实施例的处理图像数据过程的示意图;
图13示意性地示出了用于执行根据本发明的方法的计算设备的框图;
图14示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于
本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例的电子设备可以为手机、相机、笔记本电脑或平板电脑等具有拍照功能的电子设备。
参照图1,示出了本发明的一种电子设备实现哈哈镜拍照效果的方法实施例的步骤流程图。该电子设备实现哈哈镜拍照效果的方法可以包括以下步骤:
S1,运行电子设备的拍摄模式。
其中,当用户打开电子设备的相机功能后,步骤S1运行电子设备的拍摄模式。
S2,获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面。
其中,摄像头模组可以包括摄像头、模数转换模块等。具体地,步骤S1后,电子设备的摄像头模组实时取景即摄像头模组接收光信息,并对接收的光信息进行模数转换等前期处理以获得上述的每一帧图像数据。
通过步骤S2,可以实现在摄像头模组取景时,通过电子设备的软件系统对取景的每一帧图像数据,直接先根据预设哈哈镜算法进行处理之后,再送给电子设备的显示屏显示,从而可以最大程度保证拍摄预览界面例如相机APP(Application,应用程序)的拍摄预览界面中图片像素不损失,且使得用户在拍摄预览界面,就可以实时直观的看到照片的哈哈镜效果,极大地提高了用户体验。
S3,接收拍照指令。
具体地,当用户根据拍摄预览界面确定所需哈哈镜效果为当前哈哈镜效果后,若用户点击拍摄按钮,步骤S3接收拍照指令。
S4,获取摄像头模组采集的图像数据,并根据预设哈哈镜算法对采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。
步骤S3后,摄像头模组采集光信息,并对采集的光信息进行模数转换等前期处理后以获得上述采集的图像数据。
其中,在本发明的一个实施例中,当摄像头模组采集到图像数据后,可以缓存该采集的图像数据至系统内存,以便于步骤S4可以高效的根据预设哈哈镜算法对采集的图像数据进行处理。
其中,步骤S4可以通过电子设备的软件系统,直接根据预设哈哈镜算法对摄像头模组采集且未压缩编码的图像数据进行处理,进而通过电子设备的软件系统,再对处理后的图像数据进行压缩编码为预设格式的图片,该图片为具有用户所需哈哈镜效果的图片。从而可以最大程度保证成片像素不损失,极大地提高了用户体验。具体地,预设格式可以为JPEG(Joint Photographic Experts Group,联合图像专家小组)格式、GIF(Graphics Interchange Format,图像互换格式)格式或PNG((Portable Network Graphic Format,可移植网络图形格式)格式等格式。
其中,当缓存该采集的图像数据至系统内存后,在步骤S4根据处理后的图像数据生成压缩编码图片后,还可以释放该采集的图像数据所占用的系统内存,从而可以提高系统效率。
具体地,在本发明的一个实施例中,上述预设哈哈镜算法可以包括:对第一指定图像区域内的图像数据按第一预设比例进行压缩。
其中,对第一指定图像区域内的图像数据按第一预设比例进行压缩可以为对第一指定图像区域内的图像数据中像素数目按第一预设比例进行压缩,第一预设比例大于0且小于1。
具体地,当用户打开相机功能后,拍摄预览界面可以显示压缩方向选择列表,压缩方向选择列表可以包括横向压缩按钮、纵向压缩按钮和圆形压缩按钮等,以及拍摄预览界面可以显示压缩比例调整按钮或压缩比例选择列表等。
其中,当用户选择横向压缩按钮时,拍摄预览界面显示两条纵向的调整线,该两条纵向的调整线之间的区域即为第一指定图像区域,用户移动任一条调整线,即可调整第一指定图像区域的大小;当用户选择纵向压缩按钮时,拍摄预览界面显示两条横向的调整线,该两条横向的调整线之间的区域即为第一指定图像区域,用户移动任一条调整线,即可调整第一指定图像区域的大小;当用户选择圆形压缩按钮时,拍摄预览界面显示圆形的调整线,该圆形的调整线之间的区域即为第一指定图像区域,用户调整圆形的半径,即可
调整第一指定图像区域的大小。另外,用户可以通过压缩比例调整按钮或通过压缩比例选择列表等,对第一预设比例进行调整。
在本发明的一个具体实施例中,当用户选择横向压缩按钮,并设置第一预设比例为50%,第一指定图像区域内的图像数据如图2所示,则在根据预设哈哈镜算法进行压缩处理后的第一指定图像区域内的图像数据如图3所示,其中,图2中的两条纵向的调整线如图中虚线所示。
具体地,在本发明的一个实施例中,上述预设哈哈镜算法可以包括:对第二指定图像区域内的图像数据按第二预设比例进行扩充。第二预设比例大于1。
其中,对第二指定图像区域内的图像数据按第二预设比例进行扩充可以为对第二指定图像区域内的图像数据中像素数目按第二预设比例进行扩充。
具体地,当用户打开相机功能后,拍摄预览界面可以显示扩充方向选择列表,扩充方向选择列表可以包括横向扩充按钮、纵向扩充按钮和圆形扩充按钮等,以及拍摄预览界面可以显示扩充比例调整按钮或扩充比例选择列表等。
其中,当用户选择横向扩充按钮时,拍摄预览界面显示两条纵向的调整线,该两条纵向的调整线之间的区域即为第二指定图像区域,用户移动任一条调整线,即可调整第二指定图像区域的大小;当用户选择纵向扩充按钮时,拍摄预览界面显示两条横向的调整线,该两条横向的调整线之间的区域即为第二指定图像区域,用户移动任一条调整线,即可调整第二指定图像区域的大小;当用户选择圆形压缩按钮时,拍摄预览界面显示圆形的调整线,该圆形的调整线之间的区域即为第二指定图像区域,用户调整圆形的半径,即可调整第二指定图像区域的大小。另外,用户可以通过扩充比例调整按钮或通过扩充比例选择列表等,对第二预设比例进行调整。
在本发明的一个具体实施例中,当用户选择横向扩充按钮,并设置第二预设比例为200%,第二指定图像区域内的图像数据与第一指定图像区域内的图像数据相同,即第二指定图像区域内的图像数据如图2所示,此时,在根据预设哈哈镜算法进行扩充处理后第一指定图像区域内的图像数据如图4所示。
在本发明的再一个实施例中,上述预设哈哈镜算法可以包括:将第三指
定图像区域内的像素沿预设方向等分为100份,并分别按顺序依次赋予不同的坐标,其中,每份像素对应坐标的范围为1-100,进而根据预设变换公式对每份像素对应坐标进行变换处理,最后将每份像素移位至变换处理后的坐标。其中,预设方向可以为横向或纵向或圆周方向等。
具体地,预设变换公式具体可以为:
y=(x/10)2
其中,x为100份像素中任一份像素对应坐标,y为变换处理后的坐标。
需要说明的是,对于预设变换公式或y=(x/10)2,当x的取值范围为0~100时,y的取值范围也是0~100,其中,x的取值范围可以为0~100内的整数或非整数。因此,上述预设哈哈镜算法可以对第三指定图像区域内的图像进行形变,第三指定图像区域内的图像像素不溢出且不减少,不会影响第三指定图像区域外的图像。
例如,在本发明的一个具体实施例中,第三指定图像区域内的图像数据为如图5所示长度均匀的一条彩带,该彩带一共10个颜色。预设哈哈镜算法将第三指定图像区域内的像素沿横向等分为100组,从左到右依次赋予坐标为0至100。预设哈哈镜算法根据对每份像素对应坐标进行变换处理,以实现正向压缩形变,那么:
对应坐标为0的一份像素在变换处理后对应的坐标为0;
对应坐标为10的一份像素在变换处理后对应的坐标为32;
对应坐标为20的一份像素在变换处理后对应的坐标为45;
对应坐标为30的一份像素在变换处理后对应的坐标为55;
对应坐标为40的一份像素在变换处理后对应的坐标为63;
对应坐标为50的一份像素在变换处理后对应的坐标为71;
对应坐标为60的一份像素在变换处理后对应的坐标为77;
对应坐标为70的一份像素在变换处理后对应的坐标为84;
对应坐标为80的一份像素在变换处理后对应的坐标为89;
对应坐标为90的一份像素在变换处理后对应的坐标为95;
对应坐标为100的一份像素在变换处理后对应的坐标为100。
所以第三指定图像区域内的彩带经过预设哈哈镜算法处理,处理后的
彩带如图6所示。
在本发明的又一个实施例中,预设哈哈镜算法可以包括:将第四指定图像区域分为第一图像区域和第二图像区域,进而对第一图像区域中的图像数据按第三预设比例进行扩充,同时对第二图像区域中的图像数据按第四预设比例进行压缩。其中,第三预设比例大于0且小于1,第四预设比例大于1。
具体地,当用户打开相机功能后,拍摄预览界面可以显示形变方向选择列表,其中,形变方向选择列表可以包括从左向右形变按钮、从右向左形变按钮、从上向下形变按钮和从下向上形变按钮等,以及拍摄预览界面可以显示矩形或方形或圆形的调整线等,矩形或方形或圆形的调整线之间的的区域即为第四指定图像区域,以及拍摄预览界面可以显示压缩比例调整按钮或压缩比例选择列表等,或拍摄预览界面可以显示扩充比例调整按钮或扩充比例选择列表等。
其中,当用户选择从左向右形变按钮或从右向左形变按钮时,预设哈哈镜算法可以通过纵向分割线将第四指定图像区域分为左部的第一图像区域和右部的第二图像区域,纵向分割线与第四指定图像区域上部外框之间具有第一交点,纵向分割线与第四指定图像区域下部外框之间具有第二交点;当用户选择从上向下形变按钮或从下向上形变按钮时,预设哈哈镜算法可以通过横向分割线将第四指定图像区域分为上部的第一图像区域和下部的第二图像区域,横向分割线与第四指定图像区域左部外框之间具有第三交点,横向分割线与第四指定图像区域右部外框之间具有第四交点。
具体地,用户通过调整矩形或方形或圆形的调整线,即可调整第四指定图像区域的大小,通过设置压缩比例调整按钮或压缩比例选择列表等即可对第三预设比例进行调整,通过设置扩充比例调整按钮或扩充比例选择列表即可对第四预设比例进行调整。
其中,对第一图像区域中的图像数据按第三预设比例进行扩充,同时对第二图像区域中的图像数据按第四预设比例进行压缩包括:
对第一图像区域中的图像数据按预设过渡方式逐级递增进行扩充,同时对第二图像区域中的图像数据按预设过渡方式逐级递增进行压缩。
需要说明的是,对第一图像区域中的图像数据按预设过渡方式逐级递增进行扩充,同时对第二图像区域中的图像数据按预设过渡方式逐级递增进行
压缩,可以保证第四指定图像区域边缘的图像与第四指定图像区域外的图像实现平滑渐变过渡。
具体地,当用户打开相机功能后,拍摄预览界面可以显示过渡方式选择列表,其中,过渡方式选择列表可以包括直线过渡按钮、二次函数过渡按钮或圆弧过渡按钮等。其中,当用户选择直线过渡按钮时,拍摄预览界面显示第一过渡直线和第二过渡直线;当用户选择二次函数过渡按钮时,拍摄预览界面显示第一过渡弧线和第二过渡弧线;当用户选择二次函数过渡按钮时,拍摄预览界面显示过渡圆弧。
在本发明的一个具体实施例中,用户选择直线过渡按钮且用户选择从左向右形变按钮,拍摄预览界面显示矩形的调整线1a和分割线1b如图7所示。此时,预设哈哈镜算法对第一图像区域上部分的图像数据,从上向下沿第一过渡直线逐级递增进行扩充,以及对第一图像区域下部分的图像数据,从下向上沿第二过渡直线逐级递增进行扩充,同时预设哈哈镜算法对第二图像区域上部分的图像数据,从上向下沿第一过渡直线逐级递增进行压缩,以及对第二图像区域下部分的图像数据,从下向上沿第二过渡直线逐级递增进行压缩,预设哈哈镜算法处理后的第四指定图像区域中的图像如图8所示。其中,第一过渡直线经过第一交点,第二过渡直线经过第二交点,第一过渡直线为图8中虚线1c,第二过渡直线为图8中虚线1d,分割线1b被虚线1c和虚线1d切断为1b1、1b2和1b3。需要说明的是,在本发明的一个实施例中,用户可以自由调整第一过渡直线1c未与矩形的调整线1a相交的端点的位置,第二过渡直线1d未与矩形的调整线1a相交的端点的位置,从而实现调整直线过渡处理的效果。
在本发明的另一个具体实施例中,用户选择二次函数过渡按钮且用户选择从左向右形变按钮,拍摄预览界面显示矩形的调整线1a和分割线1b如图7所示。此时,预设哈哈镜算法对第一图像区域上部分的图像数据,从上向下沿第一过渡弧线逐级递增进行扩充,以及对第一图像区域下部分的图像数据,从下向上沿第二过渡弧线逐级递增进行扩充,同时预设哈哈镜算法对第二图像区域上部分的图像数据,从上向下沿第一过渡弧线逐级递增进行压缩,以及对第二图像区域下部分的图像数据,从下向上沿第二过渡弧线逐级递增进行压缩,预设哈哈镜算法处理后的第四指定图像区域中的图像如图9所示。
其中,第一过渡弧线经过第一交点,第二过渡弧线经过第二交点,第一过渡弧线为图9中虚线2c,第二过渡直线为图9中虚线2d,分割线1b被虚线2c和虚线2d切断为2b1、2b2和2b3。需要说明的是,在本发明的一个实施例中,用户可以自由调整第一过渡弧线2c未与矩形的调整线1a相交的端点的位置,第二过渡弧线2d未与矩形的调整线1a相交的端点的位置,从而实现调整二次函数过渡处理的效果。
在本发明的再一个具体实施例中,用户选择圆弧过渡按钮且用户选择从左向右形变按钮,拍摄预览界面显示矩形的调整线1a和分割线1b如图7所示。此时,预设哈哈镜算法对第一图像区域上部分的图像数据,从上向下沿过渡圆弧逐级递增进行扩充,以及对第一图像区域下部分的图像数据,从下向上沿过渡圆弧逐级递增进行扩充,同时预设哈哈镜算法对第二图像区域上部分的图像数据,从上向下沿过渡圆弧逐级递增进行压缩,以及对第二图像区域下部分的图像数据,从下向上沿过渡圆弧逐级递增进行压缩,预设哈哈镜算法处理后的第四指定图像区域中的图像如图10所示。其中,过渡圆弧经过第一交点和第二交点,过渡圆弧为图10中虚线3c,分割线1b被虚线3c切断为3b1和3b2。
需要说明的是,当用户选择从右向左形变按钮,且用户选择直线过渡按钮或二次函数过渡按钮或圆弧过渡按钮,或当用户选择从上向下形变按钮,且用户选择直线过渡按钮或二次函数过渡按钮或圆弧过渡按钮,或当用户选择从下向上形变按钮,且用户选择直线过渡按钮或二次函数过渡按钮或圆弧过渡按钮等情况时,预设哈哈镜算法的处理过程参照上述当用户选择从左向右形变按钮,且用户选择直线过渡按钮或二次函数过渡按钮或圆弧过渡按钮的情况,以下不再赘述。
需要说明的是,本发明实施例的预设哈哈镜算法可以包括但不仅限于上述四种。
在本发明的一个实施例中,可以将上述四种预设哈哈镜算法中的多种或全部集成到电子设备的相机APP中,此时,第一指定图像区域、第二指定图像区域、第三指定图像区域和第四指定图像区域可以为相同的图像区域或部分为相同的图像区域,从而在拍照时,相机APP可以提供多种哈哈镜效果供用户选择,并可以叠加使用哈哈镜效果,例如可以在对第一指定图像区域内
的图像数据按第一预设比例进行压缩后,和/或再次对第一指定图像区域内的图像数据按第二预设比例进行扩充,和/或再次将第一指定图像区域内的像素沿预设方向等分为100份,并分别按顺序依次赋予不同的坐标,其中,每份像素对应坐标的范围为1-100,进而根据预设变换公式对每份像素对应坐标进行变换处理,最后将每份像素移位至变换处理后的坐标,和/或再次将第一指定图像区域分为第一图像区域和第二图像区域,进而对第一图像区域中的图像数据按第三预设比例进行扩充,同时对第二图像区域中的图像数据按第四预设比例进行压缩。从而极大地提高了用户体验更好。
根据本发明实施例的电子设备实现哈哈镜拍照效果的方法,在运行电子设备的拍摄模式后,获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面。以及在接收拍照指令后,获取摄像头模组采集的图像数据,并根据预设哈哈镜算法对采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。从而实现直接从电子设备的相机功能入手,将一种或多种哈哈镜效果引入拍照中,使得用户在拍照时,可以根据需要自由选择哈哈镜效果,且拍摄预览界面和成片直接呈现哈哈镜效果,直观高效,用户体验好;另外,由于在压缩编码前,通过软件系统根据预设哈哈镜算法直接对摄像头模组采集到的图像数据进行处理,可以最大程度保证图片像素不损失。
参照图11,示出了本发明的一种电子设备实现哈哈镜拍照效果的装置实施例的结构框图。该电子设备实现哈哈镜拍照效果的装置可以包括:
运行模块1,运行电子设备的拍摄模式。
其中,当用户打开电子设备的相机功能后,运行模块1运行电子设备的拍摄模式。
显示模块2,用于获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面。
其中,摄像头模组可以包括摄像头、模数转换模块等。具体地,运行模块1后,电子设备的摄像头模组实时取景即摄像头模组接收光信息,并对接
收的光信息进行模数转换等前期处理以获得上述的每一帧图像数据。
通过显示模块2,可以实现在摄像头模组取景时,通过电子设备的软件系统对取景的每一帧图像数据,直接先根据预设哈哈镜算法进行处理之后,再送给电子设备的显示屏显示,从而可以最大程度保证拍摄预览界面例如相机APP的拍摄预览界面中图片像素不损失,且使得用户在拍摄预览界面,就可以实时直观的看到照片的哈哈镜效果,极大地提高了用户体验。
指令接收模块3,用于接收拍照指令。
具体地,当用户根据拍摄预览界面确定所需哈哈镜效果为当前哈哈镜效果后,若用户点击拍摄按钮,指令接收模块3接收拍照指令。
图片生成模块4,用于获取摄像头模组采集的图像数据,并根据预设哈哈镜算法对采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。
指令接收模块3后,摄像头模组采集光信息,并对采集的光信息进行模数转换等前期处理后以获得上述采集的图像数据。
其中,在本发明的一个实施例中,当摄像头模组采集到图像数据后,可以缓存该采集的图像数据至系统内存,以便于图片生成模块4可以高效的根据预设哈哈镜算法对采集的图像数据进行处理。
其中,图片生成模块4可以通过电子设备的软件系统,直接根据预设哈哈镜算法对摄像头模组采集且未压缩编码的图像数据进行处理,进而通过电子设备的软件系统,再对处理后的图像数据进行压缩编码为预设格式的图片,该图片为具有用户所需哈哈镜效果的图片。从而可以最大程度保证成片像素不损失,极大地提高了用户体验。具体地,预设格式可以为JPEG格式、GIF格式或PNG格式等格式。
其中,当缓存该采集的图像数据至系统内存后,在图片生成模块4根据处理后的图像数据生成压缩编码图片后,还可以释放该采集的图像数据所占用的系统内存,从而可以提高系统效率。
具体地,在本发明的一个实施例中,上述预设哈哈镜算法可以包括:对第一指定图像区域内的图像数据按第一预设比例进行压缩。
其中,对第一指定图像区域内的图像数据按第一预设比例进行压缩可以为对第一指定图像区域内的图像数据中像素数目按第一预设比例进行压缩,
第一预设比例大于0且小于1。
具体地,当用户打开相机功能后,拍摄预览界面可以显示压缩方向选择列表,压缩方向选择列表可以包括横向压缩按钮、纵向压缩按钮和圆形压缩按钮等,以及拍摄预览界面可以显示压缩比例调整按钮或压缩比例选择列表等。
其中,当用户选择横向压缩按钮时,拍摄预览界面显示两条纵向的调整线,该两条纵向的调整线之间的区域即为第一指定图像区域,用户移动任一条调整线,即可调整第一指定图像区域的大小;当用户选择纵向压缩按钮时,拍摄预览界面显示两条横向的调整线,该两条横向的调整线之间的区域即为第一指定图像区域,用户移动任一条调整线,即可调整第一指定图像区域的大小;当用户选择圆形压缩按钮时,拍摄预览界面显示圆形的调整线,该圆形的调整线之间的区域即为第一指定图像区域,用户调整圆形的半径,即可调整第一指定图像区域的大小。另外,用户可以通过压缩比例调整按钮或通过压缩比例选择列表等,对第一预设比例进行调整。
具体地,在本发明的一个实施例中,上述预设哈哈镜算法可以包括:对第二指定图像区域内的图像数据按第二预设比例进行扩充。第二预设比例大于1。
其中,对第二指定图像区域内的图像数据按第二预设比例进行扩充可以为对第二指定图像区域内的图像数据中像素数目按第二预设比例进行扩充。
具体地,当用户打开相机功能后,拍摄预览界面可以显示扩充方向选择列表,扩充方向选择列表可以包括横向扩充按钮、纵向扩充按钮和圆形扩充按钮等,以及拍摄预览界面可以显示扩充比例调整按钮或扩充比例选择列表等。
其中,当用户选择横向扩充按钮时,拍摄预览界面显示两条纵向的调整线,该两条纵向的调整线之间的区域即为第二指定图像区域,用户移动任一条调整线,即可调整第二指定图像区域的大小;当用户选择纵向扩充按钮时,拍摄预览界面显示两条横向的调整线,该两条横向的调整线之间的区域即为第二指定图像区域,用户移动任一条调整线,即可调整第二指定图像区域的大小;当用户选择圆形压缩按钮时,拍摄预览界面显示圆形的调整线,该圆形的调整线之间的区域即为第二指定图像区域,用户调整圆形的半径,即可
调整第二指定图像区域的大小。另外,用户可以通过扩充比例调整按钮或通过扩充比例选择列表等,对第二预设比例进行调整。
在本发明的再一个实施例中,上述预设哈哈镜算法可以包括:将第三指定图像区域内的像素沿预设方向等分为100份,并分别按顺序依次赋予不同的坐标,其中,每份像素对应坐标的范围为1-100,进而根据预设变换公式对每份像素对应坐标进行变换处理,最后将每份像素移位至变换处理后的坐标。其中,预设方向可以为横向或纵向或圆周方向等。
具体地,预设变换公式具体可以为:
y=(x/10)2
其中,x为100份像素中任一份像素对应坐标,y为变换处理后的坐标。
需要说明的是,对于预设变换公式或y=(x/10)2,当x的取值范围为0~100时,y的取值范围也是0~100,其中,x的取值范围可以为0~100内的整数或非整数。因此,上述预设哈哈镜算法对第三指定图像区域内的图像进行形变时,第三指定图像区域内的图像像素不溢出且不减少,不会影响第三指定图像区域外的图像。
在本发明的又一个实施例中,预设哈哈镜算法可以包括:将第四指定图像区域分为第一图像区域和第二图像区域,进而对第一图像区域中的图像数据按第三预设比例进行扩充,同时对第二图像区域中的图像数据按第四预设比例进行压缩。其中,第三预设比例大于0且小于1,第四预设比例大于1。
具体地,当用户打开相机功能后,拍摄预览界面可以显示形变方向选择列表,其中,形变方向选择列表可以包括从左向右形变按钮、从右向左形变按钮、从上向下形变按钮和从下向上形变按钮等,以及拍摄预览界面可以显示矩形或方形或圆形的调整线等,矩形或方形或圆形的调整线之间的的区域即为第四指定图像区域,以及拍摄预览界面可以显示压缩比例调整按钮或压缩比例选择列表等,或拍摄预览界面可以显示扩充比例调整按钮或扩充比例选择列表等。
其中,当用户选择从左向右形变按钮或从右向左形变按钮时,预设哈哈镜算法可以通过纵向分割线将第四指定图像区域分为左部的第一图像区域和右部的第二图像区域,纵向分割线与第四指定图像区域上部外框之间具有第
一交点,纵向分割线与第四指定图像区域下部外框之间具有第二交点;当用户选择从上向下形变按钮或从下向上形变按钮时,预设哈哈镜算法可以通过横向分割线将第四指定图像区域分为上部的第一图像区域和下部的第二图像区域,横向分割线与第四指定图像区域左部外框之间具有第三交点,横向分割线与第四指定图像区域右部外框之间具有第四交点。
具体地,用户通过调整矩形或方形或圆形的调整线,即可调整第四指定图像区域的大小,通过设置压缩比例调整按钮或压缩比例选择列表等即可对第三预设比例进行调整,通过设置扩充比例调整按钮或扩充比例选择列表即可对第四预设比例进行调整。
其中,对第一图像区域中的图像数据按第三预设比例进行扩充,同时对第二图像区域中的图像数据按第四预设比例进行压缩包括:
对第一图像区域中的图像数据按预设过渡方式逐级递增进行扩充,同时对第二图像区域中的图像数据按预设过渡方式逐级递增进行压缩。
需要说明的是,对第一图像区域中的图像数据按预设过渡方式逐级递增进行扩充,同时对第二图像区域中的图像数据按预设过渡方式逐级递增进行压缩,可以保证第四指定图像区域边缘的图像与第四指定图像区域外的图像实现平滑过渡。
具体地,当用户打开相机功能后,拍摄预览界面可以显示过渡方式选择列表,其中,过渡方式选择列表可以包括直线过渡按钮、二次函数过渡按钮或圆弧过渡按钮等。其中,当用户选择直线过渡按钮时,拍摄预览界面显示第一过渡直线和第二过渡直线;当用户选择二次函数过渡按钮时,拍摄预览界面显示第一过渡弧线和第二过渡弧线;当用户选择二次函数过渡按钮时,拍摄预览界面显示过渡圆弧。
在本发明的一个具体实施例中,电子设备为手机,参照图12,用户打开手机的相机功能,手机的摄像头模组11取景图像数据21,显示模块2通过软件系统5根据预设哈哈镜算法对图像数据21进行处理,显示模块3将处理后的图像数据31,实时显示在相机APP的拍摄预览界面41。在用户确定所需哈哈镜效果为当前哈哈镜效果,用户点击拍摄按钮后,指令接收模块3接收拍照指令,图片生成模块4获取摄像头模组11采集的图像数据51,不进行JPEG压缩编码和上传,图片生成模块4通过软件系统5根据预设哈哈镜
算法对图像数据51进行处理,进而根据图像数据51生成压缩编码图片61,压缩编码图片61为JPEG格式的图片,通知相机APP保存该图片,完成拍照。
需要说明的是,本发明实施例的预设哈哈镜算法可以包括但不仅限于上述四种。
在本发明的一个实施例中,可以将上述四种预设哈哈镜算法中的多种或全部集成到电子设备的相机APP中,此时,第一指定图像区域、第二指定图像区域、第三指定图像区域和第四指定图像区域可以为相同的图像区域或部分为相同的图像区域,从而在拍照时,相机APP可以提供多种哈哈镜效果供用户选择,并可以叠加使用哈哈镜效果,例如可以在对第一指定图像区域内的图像数据按第一预设比例进行压缩后,和/或再次对第一指定图像区域内的图像数据按第二预设比例进行扩充,和/或再次将第一指定图像区域内的像素沿预设方向等分为100份,并分别按顺序依次赋予不同的坐标,其中,每份像素对应坐标的范围为1-100,进而根据预设变换公式对每份像素对应坐标进行变换处理,最后将每份像素移位至变换处理后的坐标,和/或再次将第一指定图像区域分为第一图像区域和第二图像区域,进而对第一图像区域中的图像数据按第三预设比例进行扩充,同时对第二图像区域中的图像数据按第四预设比例进行压缩。从而极大地提高了用户体验更好。
根据本发明实施例的电子设备实现哈哈镜拍照效果的装置,在运行模块运行电子设备的拍摄模式后,显示模块获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面。以及在指令接收模块接收拍照指令后,图片生成模块获取摄像头模组采集的图像数据,并根据预设哈哈镜算法对采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。从而实现直接从电子设备的相机功能入手,将一种或多种哈哈镜效果引入拍照中,使得用户在拍照时,可以根据需要自由选择哈哈镜效果,且拍摄预览界面和成片直接呈现哈哈镜效果,直观高效,用户体验好;另外,由于在压缩编码前,通过软件系统根据预设哈哈镜算法直接对摄像头模组采集到的图像数据进行处理,可以最大程度保证图片像素不损失。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较
简单,相关之处参见方法实施例的部分说明即可。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的电子设备实现哈哈镜拍照效果的方法和装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图13示出了可以实现根据本发明的电子设备实现哈哈镜拍照效果的方法的计算设备。该计算设备传统上包括处理器1310和以存储器1320形式的计算机程序产品或者计算机可读介质。存储器1320可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1320具有用于执行上述方法中的任何方法步骤的程序代码1331的存储空间1330。例如,用于程序代码的存储空间1330可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1331。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图14所述的便携式或者固定存储单元。该存储单元可以具有与图13的计算设备中的存储器1320类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码1331’,即可以由例如诸如1310
之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。
Claims (14)
- 一种电子设备实现哈哈镜拍照效果的方法,其特征在于,包括以下步骤:运行电子设备的拍摄模式;获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对所述每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面;接收拍照指令;获取摄像头模组采集的图像数据,并根据所述预设哈哈镜算法对所述采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。
- 根据权利要求1所述的方法,其特征在于,所述预设哈哈镜算法包括:对第一指定图像区域内的图像数据按第一预设比例进行压缩;或对第二指定图像区域内的图像数据按第二预设比例进行扩充。
- 根据权利要求1所述的方法,其特征在于,所述预设哈哈镜算法包括:将第三指定图像区域内的像素沿预设方向等分为100份,并分别按顺序依次赋予不同的坐标;每份所述像素对应坐标的范围为1-100;根据预设变换公式对每份所述像素对应坐标进行变换处理;将每份所述像素移位至变换处理后的坐标。
- 根据权利要求1所述的方法,其特征在于,所述预设哈哈镜算法包括:将第四指定图像区域分为第一图像区域和第二图像区域;对所述第一图像区域中的图像数据按第三预设比例进行扩充,同时对所述第二图像区域中的图像数据按第四预设比例进行压缩。
- 根据权利要求5所述的方法,其特征在于,所述对所述第一图像区域中的图像数据按第三预设比例进行扩充,同时对所述第二图像区域中的图像 数据按第四预设比例进行压缩,包括:对所述第一图像区域中的图像数据按预设过渡方式逐级递增进行扩充,同时对所述第二图像区域中的图像数据按所述预设过渡方式逐级递增进行压缩。
- 一种电子设备实现哈哈镜拍照效果的装置,其特征在于,包括以下步骤:运行模块,用于运行电子设备的拍摄模式;显示模块,用于获取电子设备的摄像头模组实时取景的每一帧图像数据,并根据预设哈哈镜算法实时对所述每一帧图像数据进行处理,将处理后的图像数据显示在电子设备的拍摄预览界面;指令接收模块,用于接收拍照指令;图片生成模块,用于获取摄像头模组采集的图像数据,并根据所述预设哈哈镜算法对所述采集的图像数据进行处理,根据处理后的图像数据生成压缩编码图片。
- 根据权利要求7所述的装置,其特征在于,所述预设哈哈镜算法包括:对第一指定图像区域内的图像数据按第一预设比例进行压缩;或对第二指定图像区域内的图像数据按第二预设比例进行扩充。
- 根据权利要求7所述的装置,其特征在于,所述预设哈哈镜算法包括:将第三指定图像区域内的像素沿预设方向等分为100份,并分别按顺序依次赋予不同的坐标;每份所述像素对应坐标的范围为1-100;根据预设变换公式对每份所述像素对应坐标进行变换处理;将每份所述像素移位至变换处理后的坐标。
- 根据权利要求7所述的装置,其特征在于,所述预设哈哈镜算法包括:将第四指定图像区域分为第一图像区域和第二图像区域;对所述第一图像区域中的图像数据按第三预设比例进行扩充,同时对所述第二图像区域中的图像数据按第四预设比例进行压缩。
- 根据权利要求11所述的装置,其特征在于,所述对所述第一图像区域中的图像数据按第三预设比例进行扩充,同时对所述第二图像区域中的图像数据按第四预设比例进行压缩,包括:对所述第一图像区域中的图像数据按预设过渡方式逐级递增进行扩充,同时对所述第二图像区域中的图像数据按所述预设过渡方式逐级递增进行压缩。
- 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-6中的任一个所述的电子设备实现哈哈镜拍照效果的方法。
- 一种计算机可读介质,其中存储了如权利要求13所述的计算机程序。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US15/245,116 US20170171473A1 (en) | 2015-12-15 | 2016-08-23 | Method for realizing photographing effect of a distorting mirror and electronic device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510938775.8 | 2015-12-15 | ||
| CN201510938775.8A CN105976307A (zh) | 2015-12-15 | 2015-12-15 | 一种电子设备实现哈哈镜拍照效果的方法和装置 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US15/245,116 Continuation US20170171473A1 (en) | 2015-12-15 | 2016-08-23 | Method for realizing photographing effect of a distorting mirror and electronic device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017101372A1 true WO2017101372A1 (zh) | 2017-06-22 |
Family
ID=56988373
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/088886 Ceased WO2017101372A1 (zh) | 2015-12-15 | 2016-07-06 | 一种电子设备实现哈哈镜拍照效果的方法和装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105976307A (zh) |
| WO (1) | WO2017101372A1 (zh) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN201467293U (zh) * | 2009-09-01 | 2010-05-12 | 天津三星电子有限公司 | 具有趣味前景特效功能的数码摄像机 |
| CN202026405U (zh) * | 2011-03-17 | 2011-11-02 | 天津三星光电子有限公司 | 一种具有滤镜功能的数码摄像机 |
| CN102546899A (zh) * | 2010-12-10 | 2012-07-04 | 上海晨兴希姆通电子科技有限公司 | 手机及该手机的图片处理方法 |
| US20120242852A1 (en) * | 2011-03-21 | 2012-09-27 | Apple Inc. | Gesture-Based Configuration of Image Processing Techniques |
| CN103716548A (zh) * | 2013-12-06 | 2014-04-09 | 乐视致新电子科技(天津)有限公司 | 一种视频图片特效处理方法和装置 |
| CN104199610A (zh) * | 2014-08-27 | 2014-12-10 | 联想(北京)有限公司 | 一种信息处理方法及电子设备 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101667300B (zh) * | 2009-10-16 | 2012-05-02 | 拓维信息系统股份有限公司 | 基于手机平台的人物变形设计方法 |
| CN101902544A (zh) * | 2010-05-31 | 2010-12-01 | 西安电子科技大学 | 嵌入式电子哈哈镜系统 |
| CN102082864B (zh) * | 2010-11-22 | 2013-10-02 | 成都品果科技有限公司 | Camera360手机摄影平台及瞬间处理方法 |
| CN103020900B (zh) * | 2012-11-15 | 2015-06-24 | 小米科技有限责任公司 | 一种图像处理方法及装置 |
| CN103391414B (zh) * | 2013-07-24 | 2017-06-06 | 杭州趣维科技有限公司 | 一种应用于手机平台的视频处理装置及处理方法 |
-
2015
- 2015-12-15 CN CN201510938775.8A patent/CN105976307A/zh active Pending
-
2016
- 2016-07-06 WO PCT/CN2016/088886 patent/WO2017101372A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN201467293U (zh) * | 2009-09-01 | 2010-05-12 | 天津三星电子有限公司 | 具有趣味前景特效功能的数码摄像机 |
| CN102546899A (zh) * | 2010-12-10 | 2012-07-04 | 上海晨兴希姆通电子科技有限公司 | 手机及该手机的图片处理方法 |
| CN202026405U (zh) * | 2011-03-17 | 2011-11-02 | 天津三星光电子有限公司 | 一种具有滤镜功能的数码摄像机 |
| US20120242852A1 (en) * | 2011-03-21 | 2012-09-27 | Apple Inc. | Gesture-Based Configuration of Image Processing Techniques |
| CN103716548A (zh) * | 2013-12-06 | 2014-04-09 | 乐视致新电子科技(天津)有限公司 | 一种视频图片特效处理方法和装置 |
| CN104199610A (zh) * | 2014-08-27 | 2014-12-10 | 联想(北京)有限公司 | 一种信息处理方法及电子设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105976307A (zh) | 2016-09-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9860448B2 (en) | Method and electronic device for stabilizing video | |
| CN105190511B (zh) | 图像处理方法、图像处理装置和图像处理程序 | |
| CN111357296B (zh) | 影像分发装置、影像分发系统、影像分发方法及存储介质 | |
| CN105100615A (zh) | 一种图像的预览方法、装置及终端 | |
| WO2015143841A1 (zh) | 移动终端及其拍摄方法 | |
| WO2014146561A1 (zh) | 缩略图生成方法及系统 | |
| US20170150041A1 (en) | Double-exposure photographing method and apparatus of electronic device | |
| CN112954193A (zh) | 拍摄方法、装置、电子设备及介质 | |
| CN104754223A (zh) | 一种生成缩略图的方法及拍摄终端 | |
| CN103826064A (zh) | 图像处理方法、装置及手持电子设备 | |
| CN106231195A (zh) | 一种智能终端的拍照处理方法和装置 | |
| CN104836957A (zh) | 一种照片拍摄的处理方法及装置 | |
| JP6541327B2 (ja) | 画像処理装置、画像処理方法およびプログラム | |
| CN111034187A (zh) | 动态图像的生成方法、装置、可移动平台和存储介质 | |
| CN117692582B (zh) | 视频处理方法及电子设备 | |
| CN110913118B (zh) | 视频处理方法、装置及存储介质 | |
| CN106878625A (zh) | 双摄像头同步曝光方法及系统 | |
| JP6053365B2 (ja) | サーバシステム、画像処理システム、プログラム及び画像処理方法 | |
| CN107564084B (zh) | 一种动图合成方法、装置及存储设备 | |
| CN114390206A (zh) | 拍摄方法、装置和电子设备 | |
| WO2017101372A1 (zh) | 一种电子设备实现哈哈镜拍照效果的方法和装置 | |
| US20170171473A1 (en) | Method for realizing photographing effect of a distorting mirror and electronic device | |
| CN104349065B (zh) | 一种图片拍摄方法、装置和智能终端 | |
| CN104899915A (zh) | 一种图片处理方法及终端 | |
| US20260059190A1 (en) | Method to quickly generate preview thumbnail and mobile electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16874434 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16874434 Country of ref document: EP Kind code of ref document: A1 |