WO2017075779A1 - 图像拼接的方法和电子设备 - Google Patents

图像拼接的方法和电子设备 Download PDF

Info

Publication number
WO2017075779A1
WO2017075779A1 PCT/CN2015/093844 CN2015093844W WO2017075779A1 WO 2017075779 A1 WO2017075779 A1 WO 2017075779A1 CN 2015093844 W CN2015093844 W CN 2015093844W WO 2017075779 A1 WO2017075779 A1 WO 2017075779A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
control object
control
position information
text
Prior art date
Application number
PCT/CN2015/093844
Other languages
English (en)
French (fr)
Inventor
孙锐
江继勇
毛峰
张宁
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to US15/773,563 priority Critical patent/US10719926B2/en
Priority to PCT/CN2015/093844 priority patent/WO2017075779A1/zh
Priority to CN201580083380.2A priority patent/CN108027967B/zh
Publication of WO2017075779A1 publication Critical patent/WO2017075779A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/32Indexing scheme for image data processing or generation, in general involving image mosaicing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • Embodiments of the present invention relate to the field of image processing technologies, and in particular, to a method and an electronic device for image stitching.
  • the method commonly used in the prior art is to analyze the "bottom" of the previous (N-1 screen) screenshot and the "top” of the next (Nth screen) screenshot by pixel comparison method. region.
  • the existing method of image comparison can accurately recognize the overlapping regions of two images for a scene using a solid color chat background.
  • the relative position of the "chat background” is changed momentarily. Only by the method of image comparison, the overlapping regions of the two images cannot be found, so that the image formed by the stitching exists. Repeated content, similar to the accuracy of such image stitching needs to be further improved.
  • the embodiment of the invention provides a technical solution for image splicing, and the technical solution includes:
  • an embodiment of the present invention provides a method for image stitching, comprising: acquiring a control object of a first image; acquiring a control object of the second image; and identifying the same control object and the same control object of the first image and the second image; Location information, the location information including first location information indicating a location of the same control object in the first image, and second location information indicating a location of the same control object in the second image; According to the position of the same control object The information splicing the first image and the second image into a third image; thereby accurately identifying a repeated region or content in the first image and the second image, and the first image is based on the same region or location information of the content The second image is spliced into a third image, and the obtained third image has no duplicate content, which improves the accuracy of image splicing.
  • the foregoing determining the same control object of the first image and the second image and the location information of the same control object is specifically: acquiring the control in the first image Position information of the object in the first image, acquiring the first intermediate image according to the acquired position information of the control object in the first image and the control object in the first image in the first image; and acquiring the second image Position information of the control object in the second image, acquiring a second intermediate image according to the acquired position information of the control object in the second image and the control object in the second image in the second image; comparing the first intermediate image with The second intermediate image determines the same control object in the first intermediate image and the second intermediate image, determines position information of the same control object in the first intermediate image, and determines position information of the same control object in the second intermediate image.
  • the background of the first intermediate image is a solid color
  • the background of the second intermediate image is a solid color
  • the background of the image is the same as the background of the second intermediate image; thereby avoiding the influence of the background image with the personalized setting information in the first image and the second image on the same control object in the first image and the second image, and improving The accuracy of the same control object in the first image and the second image is determined.
  • the first intermediate image is the same size as the first image
  • the second intermediate image is the same size as the second image
  • the position information of the control object in the first image is the same as the position information of the control object in the first intermediate image
  • the position information of the control object in the intermediate image is the same; thereby improving the accuracy of determining the same control object in the first image and the second image.
  • the The position information in the image acquires the first intermediate image, or the second intermediate image is obtained according to the acquired position information of the control object in the second image and the control object in the second image in the second image, including:
  • control object is a text control
  • extract the text in the text control and arrange the text in the text control in the middle background image according to the position information of the control object in the image to which it belongs;
  • the bottomless text control is laid out in the middle background image according to the position information of the control object in the image to which it belongs; or, if the control object is a bottom-through text control, the bottom is extracted.
  • the text in the text control, and according to the position information of the control object in the image to which it belongs, the text in the text control is laid out in the middle background image, or the text control in the bottom is replaced with a patch image, and according to the text
  • the position information of the control in the image to which it belongs, the color block image is laid out in the middle background image, and the size of the color patch image is the same as the size of the bottomless text control; or
  • control object is a dynamic image control
  • the dynamic image control is replaced with a static image
  • the static image is laid out in the middle background image according to the position information of the dynamic image control in the image, the size of the static image and the dynamic image control The same size.
  • the location information is coordinate information.
  • the first image and the second image are spliced according to the position information of the same control object
  • the three images are specifically: acquiring the first image to be stitched according to the first position information, and splicing the first image to be stitched into a third image; or acquiring the second image to be stitched according to the second position information, The image and the second stitched image are stitched into a third image.
  • an embodiment of the present invention provides an electronic device, including: an acquiring unit, a control object for acquiring a first image, and a control object for acquiring a second image; and an identifying unit, configured to identify the first image and the second The same control object of the image and position information of the same control object; the position information includes first position information and second position information; the first position information indicates a position of the same control object in the first image; and the second position information indicates the same control object a position in the second image; a splicing unit configured to splicing the first image and the second image into a third image according to position information of the same control object; thereby the electronic device can accurately identify the first image and the second image
  • the repeating area or content, the first image and the second image are spliced into a third image according to the location information of the same area or content, and the obtained third image does not have duplicate content, which improves the accuracy of image stitching.
  • the identifying unit is specific And the method is: acquiring position information of the control object in the first image in the first image; acquiring first information according to the position information of the control object in the first image and the control object in the first image in the first image An intermediate image; acquiring position information of the control object in the second image in the second image; acquiring second information according to position information of the control object in the acquired second image and the control object in the second image in the second image Intermediate image; comparing the first intermediate image with the second intermediate image, determining the same control object in the first intermediate image and the second intermediate image; determining position information of the same control object in the first intermediate image; determining that the same control object is in the first Two location information in the intermediate image.
  • the background of the first intermediate image is a solid color
  • the background of the second intermediate image is a solid color
  • the background of the image is the same as the background of the second intermediate image; thereby avoiding the influence of the background image with the personalized setting information in the first image and the second image on the same control object in the first image and the second image, and improving The accuracy of the same control object in the first image and the second image is determined.
  • the first intermediate image is the same size as the first image
  • the second intermediate image is the same size as the second image
  • the position information of the control object in the first image is the same as the position information of the control object in the first intermediate image
  • the position information of the control object in the intermediate image is the same; thereby improving the accuracy of determining the same control object in the first image and the second image.
  • the recognition unit is in the control object according to the acquired first image and the control object in the first image Obtaining the first intermediate image by the position information in the first image, or acquiring the second intermediate image according to the position information of the control object in the acquired second image and the control object in the second image in the second image, Specifically used for:
  • control object is a text control
  • extract the text in the text control and arrange the text in the text control in the middle background image according to the position information of the control object in the image to which it belongs;
  • the bottomless text control is laid out in the middle background image according to the position information of the control object in the image to which it belongs; or, if the control object is a bottom-through text control, the bottom is extracted.
  • the size of the patch image is the same as the size of the bottomless text control. ;or,
  • control object is a dynamic image control
  • the dynamic image control is replaced with a static image
  • the static image is laid out in the middle background image according to the position information of the dynamic image control in the image, the size of the static image and the dynamic image control The same size.
  • the location information is coordinate information.
  • the splicing unit is configured to: acquire the first image to be spliced according to the first location information, The first image to be stitched and the second image are stitched into a third image; or the second image to be stitched is obtained according to the second position information, and the first image and the second image to be stitched are stitched into a third image.
  • an embodiment of the present invention provides an electronic device, including: a memory, configured to store an instruction;
  • a processor configured to invoke instruction execution stored in the memory: acquiring a control object of the first image, and acquiring a control object of the second image; identifying the same control object of the first image and the second image, and location information of the same control object,
  • the location information includes first location information indicating a location of the same control object in the first image, and second location information indicating a location of the same control object in the second image; Position information splicing the first image and the second image into a third image;
  • a display for displaying the first image, the second image, and the third image
  • the electronic device can accurately identify the repeated region or content in the first image and the second image, and splicing the first image and the second image into the third image according to the location information of the same region or content, and obtaining the third image. There is no duplicate content in the image, which improves the accuracy of image stitching.
  • the processor when the processor identifies the same control object of the first image and the second image and the location information of the same control object, the processor is specifically configured to: acquire the first Position information of the control object in the image in the first image; acquiring the first intermediate image according to the acquired position information of the control object in the first image and the control object in the first image in the first image; acquiring the second Position information of the control object in the image in the second image; root Obtaining a second intermediate image according to the acquired position information of the control object in the second image and the control object in the second image in the second image; comparing the first intermediate image with the second intermediate image to determine the first intermediate image and The same control object in the second intermediate image; determining position information of the same control object in the first intermediate image; determining position information of the same control object in the second intermediate image.
  • the background of the first intermediate image is a solid color
  • the background of the second intermediate image is a solid color
  • the background of the image is the same as the background of the second intermediate image; thereby avoiding the influence of the background image with the personalized setting information in the first image and the second image on the same control object in the first image and the second image, and improving The accuracy of the same control object in the first image and the second image is determined.
  • the first intermediate image is the same size as the first image
  • the second intermediate image is the same size as the second image
  • the position information of the control object in the first image is the same as the position information of the control object in the first intermediate image
  • the position information of the control object in the intermediate image is the same; thereby improving the accuracy of determining the same control object in the first image and the second image.
  • the processor is in the control object according to the acquired first image and the control object in the first image Obtaining the first intermediate image by the position information in the first image, or acquiring the second intermediate image according to the position information of the control object in the acquired second image and the control object in the second image in the second image, Specifically used for:
  • control object is a text control
  • extract the text in the text control and arrange the text in the text control in the middle background image according to the position information of the control object in the image to which it belongs;
  • the bottomless text control is laid out in the middle background image according to the position information of the control object in the image to which it belongs; or, if the control object is a bottom-through text control, the bottom is extracted.
  • the text in the text control, and according to the position information of the control object in the image to which it belongs, the text in the text control is laid out in the middle background image, or the text control in the bottom is replaced with a patch image, and according to The position information of the text control in the image to which it belongs, the color block image is laid out in the middle background image, and the size of the color patch image is the same as the size of the bottomless text control; or
  • control object is a dynamic image control
  • the dynamic image control is replaced with a static image
  • the static image is laid out in the middle background image according to the position information of the dynamic image control in the image, the size of the static image and the dynamic image control The same size.
  • the location information is coordinate information.
  • the processor, the first image and the second image are in the position information according to the same control object
  • the method is specifically configured to: obtain the first image to be spliced according to the first location information, and splicing the first image to be spliced into a third image; or acquiring the second POS according to the second location information.
  • the image is stitched, and the first image and the second image to be stitched are stitched into a third image.
  • the method for splicing the image provided by the embodiment of the present invention can accurately identify the repeated region or content in the first image and the second image, and the first image and the second image according to the location information of the same region or content.
  • the splicing is the third image, and the obtained third image does not have duplicate content, which improves the accuracy of image splicing.
  • FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for image stitching according to the present invention
  • 3A is a schematic diagram of a first image according to an embodiment of the present invention.
  • FIG. 3B is a schematic diagram of a second image according to an embodiment of the present disclosure.
  • 3C is a schematic diagram of a third image according to an embodiment of the present invention.
  • FIG. 3D is another schematic diagram of a third image according to an embodiment of the present invention.
  • FIG. 4A is a schematic diagram of a first intermediate image according to an embodiment of the present invention.
  • 4B is a schematic diagram of a second intermediate image according to an embodiment of the present invention.
  • FIG. 5A is a middle background diagram of the control object layout in FIG. 3B according to an embodiment of the present invention. a schematic diagram of the image;
  • FIG. 5B is a schematic diagram of a text-through text control provided by an embodiment of the present invention.
  • FIG. 5C is a schematic diagram of placing a bottom-through text control in an intermediate background image according to an embodiment of the present invention.
  • 5D is another schematic diagram of placing a bottom-through text control in an intermediate background image according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an electronic device according to Embodiment 1 of the present invention.
  • FIG. 7 is a schematic structural diagram of an electronic device according to Embodiment 2 of the present invention.
  • the present invention can be applied to an electronic device, which can be a device having a display screen such as a mobile phone, a tablet computer (PAD), a notebook computer, or a wearable device.
  • a display screen such as a mobile phone, a tablet computer (PAD), a notebook computer, or a wearable device.
  • the embodiment of the present invention is exemplified by the electronic device 100. It can be understood by those skilled in the art that the embodiments in the present invention are equally applicable to other devices, such as a handheld device, an in-vehicle device, a wearable device, Computing equipment, and various forms of user equipment (English: User Equipment, UE for short), mobile station (English: Mobile station, MS for short), terminal (terminal), terminal equipment (Terminal Equipment), and the like.
  • FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • the electronic device 100 may include a touch-sensitive display unit 130, an acceleration sensor 151, a proximity light sensor 152, an ambient light sensor 153, a memory 120, a processor 190, a radio frequency unit 110, an audio circuit 160, a speaker 161, a microphone 162, and wireless fidelity ( English: wireless fidelity, abbreviation: WiFi) module 170, Bluetooth module 180, power supply 193, external interface 197 and other components.
  • a touch-sensitive display unit 130 an acceleration sensor 151, a proximity light sensor 152, an ambient light sensor 153, a memory 120, a processor 190, a radio frequency unit 110, an audio circuit 160, a speaker 161, a microphone 162, and wireless fidelity ( English: wireless fidelity, abbreviation: WiFi) module 170, Bluetooth module 180, power supply 193, external interface 197 and other components.
  • WiFi wireless fidelity
  • FIG. 1 is merely an example of an electronic device, and does not constitute a limitation on an electronic device, and may include more or less components than those illustrated, or a combination of certain components, or different components.
  • the touch-sensitive display unit 130 is sometimes referred to as a "touch screen" for convenience, and may also be referred to as or referred to as a touch-sensitive display system, and may also be referred to as a display having a touch-sensitive surface.
  • the display having a touch-sensitive surface includes a touch-sensitive surface and a display screen; the screen interface can be displayed, and a touch action can also be received.
  • the touch sensitive display unit 130 provides an input interface and an output interface between the device and the user.
  • the touch sensitive display unit 130 can collect touch operations on or near the user, such as operations by the user on the touch sensitive display unit or near the touch sensitive display unit using any suitable object such as a finger, a joint, a stylus, or the like.
  • the touch sensitive display unit can detect a touch action on the touch sensitive display unit, a grid capacitance value of the touch sensitive display unit, and contact coordinates, and send the touch action, the grid capacitance value of the touch sensitive display unit, and the contact coordinate information.
  • the processor 190 is provided and can receive commands from the processor 190 and execute them.
  • the touch sensitive display unit 130 displays a visual output.
  • the visual output can include images, text, icons, video, and any combination thereof (collectively referred to as "graphics"). In some embodiments, the visual output can correspond to a first image, a second image, or a third image.
  • Touch sensitive display unit 130 may use LCD (Liquid Crystal Display) technology, LPD (Light Emitting Polymer Display) technology, or LED (Light Emitting Diode) technology, although other display technologies may be used in other embodiments.
  • Touch sensitive display unit 130 may utilize any of a variety of touch sensing techniques now known or later developed, as well as other proximity sensor arrays or for determining one or more points in contact with touch sensitive display unit 130.
  • Other elements to detect contact and any movement or interruption thereof include, but are not limited to, capacitive, resistive, infrared, and surface acoustic wave techniques. In an exemplary embodiment, a projected mutual capacitance sensing technique is used.
  • the electronic device 100 can include a touchpad (not shown) for activating or deactivating a particular function.
  • the touchpad is a touch sensitive area of the device that is different from the touch sensitive display unit in that it does not display a visual output.
  • the touchpad can be a touch-sensitive surface that is separate from the touch-sensitive display unit 130, or an extension of the touch-sensitive surface formed by the touch-sensitive display unit.
  • the acceleration sensor 151 can detect the magnitude of acceleration in each direction (typically three axes). At the same time, the acceleration sensor 151 can also be used to detect the magnitude and direction of gravity when the terminal is stationary, and can be used for identifying the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as step counting) , tapping, etc. However, it can be understood that it does not belong to the necessary configuration of the electronic device 100, and can completely change the scope of the invention as needed. Omitted inside.
  • the electronic device 100 may also include one or more proximity light sensors 152 for turning off and disabling the touch function of the touch-sensitive surface when the electronic device 100 is closer to the user (eg, close to the ear when the user is making a call) Avoid user misuse of the touch sensitive display unit.
  • the electronic device 100 may further include one or more ambient light sensors 153 for keeping the touch-sensitive display unit off when the electronic device 100 is located in a user's pocket or other dark area to prevent the electronic device 100 from consuming unnecessary when in the locked state. Battery power consumption is incorrectly operated.
  • the proximity light sensor and the ambient light sensor can be integrated into one component or as two separate components.
  • FIG. 1 shows the proximity photosensor and the ambient light sensor, it can be understood that it does not belong to the essential configuration of the electronic device 100, and may be omitted as needed within the scope of not changing the essence of the invention.
  • the memory 120 can be used to store instructions and data.
  • the memory 120 may mainly include a storage instruction area and a storage data area.
  • the storage data area stores location information of images, control objects, and control objects.
  • the storage instruction area can store an operating system, instructions required for at least one function, and the like.
  • the instructions may cause the processor 190 to perform the following methods, the specific method comprising: acquiring a control object of the first image; acquiring a control object of the second image; identifying the same control object of the first image and the second image, and the location of the same control object Information, the location information includes first location information indicating a location of the same control object in the first image, and second location information indicating a location of the same control object in the second image; The position information of the control object splices the first image and the second image into a third image.
  • the processor 190 is a control center of the electronic device 100, and connects various parts of the entire mobile phone using various interfaces and lines, and executes the electronic device 100 by operating or executing an instruction stored in the memory 120 and calling data stored in the memory 120. A variety of functions and processing data to monitor the phone as a whole.
  • the processor 190 may include one or more processing units; preferably, the processor 190 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 190.
  • the processors, memories can be implemented on a single chip, and in some embodiments, they can also be implemented separately on separate chips.
  • the processor 190 also uses And calling the instruction in the memory to accurately identify the repeated region or content in the first image and the second image, and stitching the first image and the second image into the third image according to the location information of the same region or content, There is no duplicate content in the obtained third image, which improves the accuracy of image stitching.
  • the radio frequency unit 110 can be used for receiving and transmitting signals during the transmission and reception of information or during a call. Specifically, after receiving the downlink information of the base station, the processing is performed by the processor 190. In addition, the uplink data is designed to be sent to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • the radio unit 110 can also communicate with network devices and other devices through wireless communication.
  • the wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (English: General Packet Radio Service, referred to as: GPRS) ), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (English: Long Term Evolution, LTE for short) ), e-mail, short message service (English: Short Messaging Service, referred to as: SMS).
  • GSM Global System of Mobile communication
  • General Packet Radio Service English: General Packet Radio Service, referred to as: GPRS
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • the audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the electronic device 100.
  • the audio circuit 160 can transmit the converted electrical data of the received audio data to the speaker 161 for conversion to the sound signal output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal by the audio circuit 160. After receiving, it is converted into audio data, and then processed by the audio data output processor 190, sent to the terminal, for example, via the radio frequency unit 110, or outputted to the memory 120 for further processing.
  • the audio circuit may also include a headphone jack. 163, used to provide a connection interface between the audio circuit and the earphone.
  • WiFi is a short-range wireless transmission technology
  • the electronic device 100 can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 170, which provides wireless broadband Internet access for users.
  • FIG. 1 shows the WiFi module 170, it can be understood that it does not belong to the essential configuration of the electronic device 100, and may be omitted as needed within the scope of not changing the essence of the invention.
  • Bluetooth is a short-range wireless communication technology. Using Bluetooth technology, it can effectively simplify the communication between mobile communication terminal devices such as handheld computers, notebook computers and mobile phones, and it can also be successfully simplified. By communicating between the above devices and the Internet, the electronic device 100 makes data transmission between the electronic device 100 and the Internet more rapid and efficient through the Bluetooth module 180, broadening the road for wireless communication. Bluetooth technology is an open solution for wireless transmission of voice and data.
  • FIG. 1 shows the WiFi module 170, it can be understood that it does not belong to the essential configuration of the electronic device 100, and may be omitted as needed within the scope of not changing the essence of the invention.
  • the electronic device 100 further includes a power source 193 (such as a battery) for supplying power to the various components.
  • a power source 193 such as a battery
  • the power source can be logically connected to the processor 190 through the power management system to manage functions such as charging, discharging, and power management through the power management system. .
  • the electronic device 100 further includes an external interface 197, which may be a standard Micro USB interface or a multi-pin connector, which may be used to connect the electronic device 100 to communicate with other devices, or may be used to connect the charger to The electronic device 100 is charged.
  • an external interface 197 which may be a standard Micro USB interface or a multi-pin connector, which may be used to connect the electronic device 100 to communicate with other devices, or may be used to connect the charger to The electronic device 100 is charged.
  • the electronic device 100 may further include a camera, a flash, and the like, and details are not described herein.
  • N is a positive integer greater than or equal to 2
  • N is 2 to illustrate the image splicing method provided by the embodiment of the present invention.
  • the processing between adjacent two images is similar to the processing between the two images described below.
  • FIG. 2 is a flowchart of Embodiment 1 of the image splicing method of the present invention. As shown in FIG. 2, the method of the embodiment is described by splicing two images (the first image and the second image) as an example. Methods can include:
  • Obtaining a control object of the first image acquiring a control object of the second image (S101); identifying the same control object in the control object of the first image and the control object of the second image and position information of the same control object (S102); The first image and the second image are spliced into a third image according to the position information of the same control object (S103).
  • a control object of two images that need to be stitched can be acquired.
  • the embodiment of the present invention illustrates the first image and the second image, and the first image and the second image may be any two images stored in a memory of the electronic device. It can be acquired by the camera and stored in the memory of the electronic device, or it can be generated by the display interface of the display screen of the electronic device. If the image is generated by the display interface of the display of the electronic device, The specific buttons of the electronic device are acquired and stored in the memory of the electronic device.
  • Control objects are the parts that make up an image. Control objects can include: text control objects, dynamic image control objects, static image control objects, background control objects, and the like. Exemplarily, taking FIG. 3A as an example, FIG. 3A includes a background control object, a text control object, and an expression control object.
  • An alternative way to obtain the control object of the first image and the control object of the second image is to first identify the control object type in the image, such as the text control type, the dynamic image control type, the background control type, and the like. Then, according to the identified control object type, the control object corresponding to each control object type is obtained.
  • FIG. 3A is a schematic diagram of a first image according to an embodiment of the present invention.
  • the first image shown in FIG. 3A includes a text control object: a time frame, "hello”, “where are you now”, “in Xi'an”, “really, I am also in Xi'an", “Great, have time to gather”; expression control object; "*" type background control object.
  • first identifying the first image includes a text control type, an expression control type, and a background control type. Then, according to the identified control object type, the control object corresponding to each control object type is obtained.
  • control object corresponding to the text control type includes a time frame, "hello”, “where are you now”, “in Xi'an”, “true” Qiao, I am also in Xi'an, "very good, have time to gather”;
  • control object corresponding to the background control type is "*" type background control;
  • control object corresponding to the expression control type is smiley expression control.
  • FIG. 3B is a schematic diagram of a second image according to an embodiment of the present invention.
  • the second figure shown in FIG. 3B includes a text control object “too good, there is time to gather together”, “good, then today”, “nothing at noon” , "OK”; "*" type background control object.
  • first identifying the second image includes a text control type and a background control type, and then obtaining a control object corresponding to each control object type according to the identified control object type, for example, the control object corresponding to the text control type includes: "Great, there is time to gather together", “Okay, then today”, “Nothing at noon”, “Good”; the control object corresponding to the background control type is "*" type background control .
  • the background control object may include user-defined personalized setting information, such as a user-defined graphic, a flower or a character image, etc., as a personalized background interface, exemplary, FIG. 3A And Figure 3B contains a user-defined "*" type personalized background control object.
  • At least the following two implementations can identify the type of the control object in the image: 1) Identify the type of the control object in the image through the "Auxiliary Service” tool provided by the Android platform. Taking FIG. 3A as an example, the "auxiliary service” tool provided by the Android platform recognizes that FIG. 3A includes a text control type, a static image control type, and a background control type. 2) Identify the feature color judgment control object by the image recognition method, and determine the control object type in combination with the naming of the control object. For example, the feature color of the instant messaging chat dialog box is green. When the green feature color is recognized by the image recognition method, the object having the green feature color is initially determined as the control object, and the control object having the green feature color is further obtained.
  • control object can be determined to be a text control by naming the control object. If the control is named IMAGEVIW, you can determine that the control is an image control.
  • the control object of the first image may be compared with the control object of the second image, and the control object of the first image is identified.
  • the same control object exists in both the first image and the second image.
  • the location information of the same control object includes first location information and second location information. The first location information indicates a location of the same control object in the first image; the second location information indicates a location of the same control object in the second image.
  • the same control object here refers to: taking two control objects as text control objects as an example, the text content of the two text control objects is the same and the color of the text box is the same.
  • the personalized control object affects the accuracy of the same control object that recognizes two images
  • the user-defined personality is selected in the process of comparing the control object of the first image with the control object of the second image.
  • Control object isolation That is: user-defined personalized control objects are not considered as comparison objects.
  • the background control object is a user-defined “*” type personalized control object.
  • the background control object is not used to identify the same control object in the first image and the second image.
  • the position information in this embodiment may be coordinate information.
  • the location information may include first location information and second location information.
  • the first location information may indicate coordinate information of the same control object in the first image.
  • the second location information may indicate coordinate information of the same control object in the second image.
  • the information is X axis: 4-14; Y axis: 0-2; if the horizontal coordinate of the second image is the X axis, the longitudinal coordinate of the second image is the Y axis, and the lower left corner of the second image is the origin coordinate, then " Great, there is time to gather.”
  • the coordinate information in the second image is X-axis: 4-14, Y-axis: 17-19.
  • the first image and the second image are spliced into a third image according to the position information of the same control object.
  • the location information may be coordinate information.
  • the same control object is located at the bottom of the first image, and the same control object is located at the top of the second image.
  • the position information of the same control object in the first image that is, the first position information
  • the area above the first position information in the first image is intercepted, and the first image to be stitched is obtained.
  • the first image to be stitched is spliced with the second image to form a third image.
  • the area below the second position information in the second image is intercepted to obtain the second image to be stitched.
  • FIG. 3C is a schematic diagram of a third image according to an embodiment of the present invention.
  • FIG. 3D is another schematic diagram of a third image according to an embodiment of the present invention.
  • FIG. 3A and FIG. 3B when the “very good, time-aggregated” text control object is identified as the same control object of the first image and the second image, the same control object is identified in FIG. 3A.
  • the coordinate information in the first image is the X axis: 4-14, and the Y axis: 0-2.
  • the coordinate information of the same control object in the second image shown in FIG. 3B is the X axis: 4-14, and the Y axis: 17-19.
  • An implementation manner of splicing the first image and the second image into the third image is: capturing an area of the first image with the Y coordinate of 2 or more, obtaining the first image to be stitched, and the first image to be stitched and the second image The stitching forms a third image (as shown in Figure 3C).
  • Another implementation manner is: intercepting an area below the Y-axis coordinate 17 in the second image, obtaining a second image to be stitched, and stitching the first image and the second image to be stitched to form a third image (as shown in FIG. 3D) .
  • the image splicing method provided by the embodiment obtains the control object of the first image and the control object of the second image respectively, and then identifies the same control object in the first image and the second image and the position information of the same control object, thereby
  • the same area or content in the first image can be accurately identified, and the first image and the second image are spliced into a third image according to the same area or content, and the obtained third image does not have duplicate content, which improves image stitching.
  • the accuracy is the accuracy.
  • S1021 Acquire location information of a control object in the first image in the first image, and acquire location information of the control object in the second image in the second image.
  • the location information may be coordinate information, and the coordinate information includes an abscissa and an ordinate. For example, taking the lower left corner of the first image as an origin, the horizontal direction of the control object in the first image relative to the origin may be obtained. Coordinates and ordinates.
  • S1022 Acquire a first intermediate image according to position information of the control object in the acquired first image and the control object in the first image in the first image, according to the acquired control object and the second image in the second image.
  • the position information of the control object in the second image acquires the second intermediate image.
  • the first image is The control object is laid out in the middle background image of the solid color to obtain the first intermediate image.
  • the first intermediate background image does not include the control object having the personalized information in the first image, such as in the first image. Background control object.
  • the intermediate background image in this embodiment is a solid color background image.
  • the size of the first image is the same as the size of the first intermediate image, and the size referred to herein refers to the length and the width, that is, the length of the first image is the same as the length of the first intermediate image, and the width of the first image and the first intermediate image The width is the same.
  • the position information of the control object in the first image in the first image is the same as the position information of the control object in the first intermediate image. It can be understood that the first image is different from the first intermediate image in that the first intermediate image is based on the first image, and the personalized information such as the background image is removed.
  • FIG. 4A is a schematic diagram of a first intermediate image according to an embodiment of the present invention.
  • the coordinate information of a control object in the first image is: X axis: 4-14, Y axis: 0-2; then the coordinate information of the control object in the first intermediate image Also: X axis: 4-14, Y axis: 0-2.
  • the control object in the first image shown in FIG. 3A is laid out in the middle background image.
  • the background image of the first intermediate image is a solid color background image.
  • the control object in the second image After acquiring the position information of the control object and the control object in the second image in the second image, according to the position information of the control object in the second image in the second image, the control object in the second image is laid out in a solid color
  • the middle background image (the same as the control object in the first image of the layout is the same in the first intermediate background image)
  • the second intermediate image is obtained, and it should be noted that in order to solve the personalized information such as the background image, the same is recognized in the two images.
  • the control object has an effect, and the second intermediate background image does not include a control object having personalized information in the second image, such as a background control object in the second image.
  • the intermediate background image in this embodiment is a solid color background image.
  • the size of the second image is the same as the size of the second intermediate image, and the size referred to herein refers to the length and the width, that is, the length of the second image is the same as the length of the second intermediate image, and the width of the second image is in the middle of the second image.
  • the width of the image is the same.
  • the position information of the control object in the second image in the second image is the same as the position information of the control object in the second intermediate image. It can be understood that the second image is different from the second intermediate image in that the second intermediate image is based on the second image, and the personalized information such as the background image is removed.
  • FIG. 4B is a schematic diagram of a second intermediate image according to an embodiment of the present invention.
  • the coordinate information of a control object in the second image is: X axis: 4-14, Y axis: 17-19; then the coordinate information of the control object in the second intermediate image Also: X axis: 4-14, Y axis: 17-19.
  • the control object in the second image shown in FIG. 3B is laid out in the intermediate background image to obtain a second intermediate image as shown in FIG. 4B.
  • the background image of the second intermediate image is a solid color background image.
  • the background image of the first intermediate image is the same as the background image of the second intermediate image.
  • the first intermediate image and the second intermediate image are compared with each other.
  • the same control object in the first intermediate image and the second intermediate image may be determined by comparing the first intermediate image and the second intermediate image pixel by pixel.
  • the position information of the same control object in the two images is obtained.
  • by comparing the first intermediate image shown in FIG. 4A with the second intermediate image shown in FIG. 4B on a pixel-by-pixel basis it can be determined that “very good, there is time to gather” as the first intermediate image and the second.
  • the same control object for the middle image is compared with the first intermediate image and the second intermediate image.
  • the coordinates of the same control object in the first intermediate image are: X axis: 4-14, Y axis: 0-2, the same
  • the coordinates of the control object in the second intermediate image are: X axis: 4-14, Y axis: 17-19.
  • the image splicing method provided in this embodiment avoids the determination that the user-defined personalized background image affects the same control object by arranging the control objects of the two images in the same solid color background image, so that the spliced image is not There is duplicate content, which improves the accuracy of image stitching.
  • control object in the first image and the control object in the second image are used. Any control object is described as an example, and other control objects are similar.
  • the specific process is as follows.
  • FIG. 5A is a schematic diagram of a control object layout in FIG. 3B in an intermediate background image according to an embodiment of the present invention.
  • the control object is a text control
  • the text in the text control is extracted, and the text in the text control is laid out in the middle background image.
  • the coordinate information of the text in the intermediate background image is the same as the coordinate information of the text in the associated image (the first image or the second image).
  • the control object layout as shown in FIG. 3B is shown in the intermediate background image as shown in FIG. 5A.
  • the control object is a text control and the text control is a bottomless text control
  • the text control is laid out in the middle background image.
  • a bottomless text control means that the background of the image to which the text control belongs is not visible through the text control.
  • the coordinate information of the text control in the intermediate background image is the same as the coordinate information of the text control in the associated image (the first image or the second image).
  • the control object layout as shown in FIG. 3B is shown in the intermediate background image as shown in FIG. 4B.
  • FIG. 5C is a schematic diagram of placing a text-through text control in an intermediate background image according to an embodiment of the present invention.
  • a bottom-through text control refers to the background of the image to which the text control belongs by being visible through the text control. If the control object is a text control, and the text control is a bottom-through text control, the text in the text control is extracted, and the extracted text is laid out in the middle background image; the coordinate information of the text in the intermediate background image is The text has the same coordinate information in the associated image; the control object layout as shown in FIG. 5B is shown in the intermediate background image as shown in FIG. 5C. or,
  • FIG. 5D is another schematic diagram of placing a bottomed text control in an intermediate background image according to an embodiment of the present invention.
  • the control object is a text control
  • the text control is a bottom-through text control
  • the text control is replaced with a patch image
  • the patch image is laid out in the middle background image
  • the patch image and the text control are The same size, ie the length of the patch image and the text control
  • the length is the same
  • the width of the patch image is the same as the width of the text control
  • the coordinate information of the patch image in the intermediate background image is the same as the coordinate information of the text control in the associated image; as shown in FIG. 4B
  • the control object layout is shown in the intermediate background image as shown in FIG. 5D, and the black patch image shown in FIG. 5D replaces the bottom text control in FIG. 5B.
  • the control object is a dynamic image control, such as a dynamic expression or a video
  • the dynamic image control is replaced with a static image
  • the static image is disposed in the intermediate background image
  • the static image has the same size as the dynamic image control, that is, the length of the static image is the same as the length of the dynamic image control, and the width of the static image is the same as the width of the dynamic image control; the static image is in the intermediate background image
  • the coordinate information is the same as the coordinate information of the dynamic image control in the associated image.
  • the still image may also be a patch image.
  • FIG. 6 is a schematic structural diagram of an electronic device according to Embodiment 1 of the present invention.
  • the electronic device in this embodiment may include: an obtaining unit 11, an identifying unit 12, and a splicing unit 13; Obtaining a control object of the first image; acquiring a control object of the second image; the recognition unit 12, configured to identify the same control object of the first image and the second image, and location information of the same control object; the location information includes the first location information And second position information; the first position information indicates a position of the same control object in the first image; the second position information indicates a position of the same control object in the second image; the splicing unit 13 is configured to position the same control object The information stitches the first image and the second image into a third image.
  • the identifying unit 12 is specifically configured to: acquire position information of the control object in the first image in the first image; according to the acquired control object in the first image and the control object in the first image, Position information in the image acquires a first intermediate image; acquires position information of the control object in the second image in the second image; according to the acquired control object in the second image and the control object in the second image in the second Position information in the image acquires a second intermediate image; compares the first intermediate image with the second intermediate image, determines the same control object in the first intermediate image and the second intermediate image; determines the position of the same control object in the first intermediate image Information; determining location information of the same control object in the second intermediate image.
  • the background of the first intermediate image is a solid color
  • the background of the second intermediate image is a solid color
  • the background of the first intermediate image is the same as the background of the second intermediate image.
  • the first intermediate image is the same size as the first image; the second intermediate image is the same size as the second image; the position information of the control object in the first image and the control in the first intermediate image
  • the position information of the object is the same; the position information of the control object in the second image is the same as the position information of the control object in the second intermediate image.
  • the identifying unit 12 acquires the first intermediate image according to the position information of the control object in the acquired first image and the control object in the first image in the first image, or according to the acquired second image.
  • the specific object is used to:
  • control object is a text control
  • extract the text in the text control and arrange the text in the text control in the middle background image according to the position information of the control object in the image to which it belongs;
  • the bottomless text control is laid out in the middle background image according to the position information of the control object in the image to which it belongs; or, if the control object is a bottom-through text control, the bottom is extracted.
  • the text in the text control, and according to the position information of the control object in the image to which it belongs, the text in the text control is laid out in the middle background image, or the text control in the bottom is replaced with a patch image, and according to The position information of the text control in the image to which it belongs, the color block image is laid out in the middle background image, and the size of the color patch image is the same as the size of the bottomless text control; or
  • control object is a dynamic image control
  • the dynamic image control is replaced with a static image
  • the static image is laid out in the middle background image according to the position information of the dynamic image control in the image, the size of the static image and the dynamic image control The same size.
  • the location information is coordinate information.
  • the splicing unit 13 is configured to: obtain the first image to be spliced according to the first location information, and splicing the first image to be spliced into a third image; or acquiring the second POS according to the second location information.
  • the image is stitched, and the first image and the second image to be stitched are stitched into a third image.
  • the electronic device in this embodiment may be used to implement the technical solutions of the foregoing method embodiments of the present invention, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
  • FIG. 7 is a schematic structural diagram of an electronic device according to Embodiment 2 of the present invention.
  • the electronic device of this embodiment may include: a memory 21 and a processor 22, and a display 23; a storage instruction; the processor 22 is configured to invoke the instruction execution stored in the memory 21 to: acquire a control object of the first image, and acquire a control object of the second image; identify the same control object of the first image and the second image, and the same control Location information of the object, the location information includes first location information and second location information, and the first location information indicates that the same control object is in the first a position in an image, the second position information indicating a position of the same control object in the second image; and stitching the first image and the second image into a third image according to position information of the same control object.
  • the display 23 is configured to display the first image, the second image, and the third image.
  • the processor 22 when the processor 22 identifies the same control object of the first image and the second image and the location information of the same control object, the processor 22 is specifically configured to: acquire location information of the control object in the first image in the first image; Acquiring a first intermediate image according to position information of the control object in the first image and the control object in the first image in the first image; acquiring position information of the control object in the second image in the second image; Obtaining a second intermediate image according to the acquired position information of the control object in the second image and the control object in the second image in the second image; comparing the first intermediate image with the second intermediate image to determine the first intermediate image and The same control object in the second intermediate image; determining position information of the same control object in the first intermediate image; determining position information of the same control object in the second intermediate image.
  • the background of the first intermediate image is a solid color
  • the background of the second intermediate image is a solid color
  • the background of the first intermediate image is the same as the background of the second intermediate image.
  • the first intermediate image is the same size as the first image; the second intermediate image is the same size as the second image; the position information of the control object in the first image and the position information of the control object in the first intermediate image The same; the position information of the control object in the second image is the same as the position information of the control object in the second intermediate image.
  • the processor 22 acquires the first intermediate image according to the position information of the control object in the acquired first image and the control object in the first image in the first image, or according to the acquired second image.
  • the specific object is used to:
  • control object is a text control
  • extract the text in the text control and arrange the text in the text control in the middle background image according to the position information of the control object in the image to which it belongs;
  • the bottomless text control is laid out in the middle background image according to the position information of the control object in the image to which it belongs; or, if the control object is a bottom-through text control, the bottom is extracted.
  • the position information of the control in the image to which it belongs, the color block image is laid out in the middle background image, the size of the color block image and the bottomless text
  • the size of this control is the same; or,
  • control object is a dynamic image control
  • the dynamic image control is replaced with a static image
  • the static image is laid out in the middle background image according to the position information of the dynamic image control in the image, the size of the static image and the dynamic image control The same size.
  • the location information is coordinate information.
  • the processor 22 is configured to: acquire the first image to be spliced according to the first location information, and set the first to be spliced The spliced image and the second image are spliced into a third image; or the second image to be spliced is obtained according to the second position information, and the first image and the second image to be spliced are spliced into a third image.
  • the electronic device in this embodiment may be used to implement the technical solutions of the foregoing method embodiments of the present invention, and the implementation principles and technical effects thereof are similar, and details are not described herein again.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)
  • Telephone Function (AREA)

Abstract

本发明实施例提供一种图像拼接的方法和电子设备,此方法包括:获取第一图像的控件对象;获取第二图像的控件对象;识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息;位置信息包括第一位置信息和第二位置信息;第一位置信息指示相同控件对象在第一图像中的位置;第二位置信息指示相同控件对象在第二图像中的位置;根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像;从而可准确识别出第一图像中与第二图像中的重复区域或内容,根据所述相同区域或内容的位置信息将第一图像与第二图像拼接为第三图像,获得的第三图像中不存在重复的内容,提高了图像拼接的准确性。

Description

图像拼接的方法和电子设备 技术领域
本发明实施例涉及图像处理技术领域,尤其涉及一种图像拼接的方法和电子设备。
背景技术
移动互联网时代,我们经常会使用手机屏幕截图并分享。但遇到超过一屏的内容需要分享时,就只能连续截多个屏幕的内容了,操作比较麻烦,且可读性变差了。于是,“长截屏”、“滚动截屏”这类应用应运而生。长截屏、滚动截屏应用的最关键体验是最终拼接的“长图”是否准确,而长图能否拼接准确,最关键的技术是要能准确识别待拼接的截图的重复区域,把重复区域去除掉并拼接。
现有技术中普遍采用的办法是通过图像比较的方法,逐像素分析上一张(第N-1屏)截图的“底部”和下一张(第N屏)截图的“顶部”有没有重复区域。现有的这种图像比较的方法,对于使用纯色聊天背景的场景,能够准确的识别出两张图像的重复区域。但是,一旦用户使用了非纯色的聊天背景,“聊天背景”的相对位置时时刻刻在改变,仅通过图像比较的方法,就找不到两张图像的重复区域了,这样拼接形成的图像存在重复的内容,类似这种图像拼接的准确性需要进一步提高。
发明内容
为了准确确定待拼接图像的重复区域或内容,改善图像拼接存在重复内容的问题。本发明实施例提供一种图像拼接的技术方案,所述技术方案包括:
第一方面,本发明实施例提供一种图像拼接的方法,包括:获取第一图像的控件对象;获取第二图像的控件对象;识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息,位置信息包括第一位置信息和第二位置信息,第一位置信息指示相同控件对象在第一图像中的位置,第二位置信息指示相同控件对象在第二图像中的位置;然后根据相同控件对象的位置 信息将第一图像与第二图像拼接为第三图像;从而可以准确识别出第一图像中与第二图像中的重复区域或内容,根据所述相同区域或内容的位置信息将第一图像与第二图像拼接为第三图像,获得的第三图像中不存在重复的内容,提高了图像拼接的准确性。
根据第一方面,在第一方面的第一种可能的实现方式中,上述的识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息具体为:获取第一图像中的控件对象在第一图像中的位置信息,根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像;以及获取第二图像中的控件对象在第二图像中的位置信息,根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像;比较第一中间图像与第二中间图像,确定第一中间图像与第二中间图像中的相同控件对象,确定相同控件对象在第一中间图像中的位置信息,确定相同控件对象在第二中间图像中的位置信息。
根据第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,第一中间图像的背景是纯色的;第二中间图像的背景是纯色的;第一中间图像的背景和第二中间图像的背景相同;从而可以避免第一图像与第二图像中的具有个性化设置信息的背景图像对无法确定第一图像与第二图像中相同控件对象的影响,提高确定第一图像与第二图像中相同控件对象的准确性。
根据第一方面的第一种可能的实现方式或第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,第一中间图像与第一图像的尺寸相同;第二中间图像与第二图像的尺寸相同;第一图像中的控件对象的位置信息与第一中间图像中的控件对象的位置信息相同;第二图像中的控件对象的位置信息与第二中间图像中的控件对象的位置信息相同;从而提高确定第一图像与第二图像中相同控件对象的准确性。
根据以上第一方面的任意一种可能的实现方式,在第一方面的第四种可能的实现方式中,根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像,或者,根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像,包括:
若控件对象为文本控件,提取出文本控件中的文本,并根据控件对象在所属图像中的位置信息,将文本控件中的文本布局在中间背景图像中;或者,
若控件对象为不透底的文本控件,则根据控件对象在所属图像中的位置信息,将不透底的文本控件布局在中间背景图像中;或者,若控件对象为透底的文本控件,则提取出透底的文本控件中的文本,并根据控件对象在所属图像中的位置信息,将透底的文本控件中的文本布局在中间背景图像中,或者,将透底的文本控件替换为色块图像,并根据文本控件在所属图像中的位置信息,将色块图像布局在中间背景图像中,色块图像的尺寸与不透底的文本控件的尺寸相同;或者,
若控件对象为动态图像控件,则将动态图像控件替换为静态图像,并根据动态图像控件在所属图像中的位置信息,将静态图像布局在中间背景图像中,静态图像的尺寸与动态图像控件的尺寸相同。
根据第一方面或以上第一方面的任意一种可能的实现方式,在第一方面的第五种可能的实现方式中,位置信息为坐标信息。
根据第一方面或以上第一方面的任意一种可能的实现方式,在第一方面的第六种可能的实现方式中,根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像具体为:根据第一位置信息获取第一待拼接图像,将第一待拼接图像与第一图像拼接为第三图像;或者,根据第二位置信息获取第二待拼接图像,将第一图像与第二拼接图像拼接为第三图像。
第二方面,本发明实施例提供一种电子设备,包括:获取单元,用于获取第一图像的控件对象,以及获取第二图像的控件对象;识别单元,用于识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息;位置信息包括第一位置信息和第二位置信息;第一位置信息指示相同控件对象在第一图像中的位置;第二位置信息指示相同控件对象在第二图像中的位置;拼接单元,用于根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像;从而电子设备可以准确识别出第一图像中与第二图像中的重复区域或内容,根据所述相同区域或内容的位置信息将第一图像与第二图像拼接为第三图像,获得的第三图像中不存在重复的内容,提高了图像拼接的准确性。
根据第二方面,在第二方面的第一种可能的实现方式中,识别单元具体 用于:获取第一图像中的控件对象在第一图像中的位置信息;根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像;获取第二图像中的控件对象在第二图像中的位置信息;根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像;比较第一中间图像与第二中间图像,确定第一中间图像与第二中间图像中的相同控件对象;确定相同控件对象在第一中间图像中的位置信息;确定相同控件对象在第二中间图像中的位置信息。
根据第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,第一中间图像的背景是纯色的;第二中间图像的背景是纯色的;第一中间图像的背景和第二中间图像的背景相同;从而可以避免第一图像与第二图像中的具有个性化设置信息的背景图像对无法确定第一图像与第二图像中相同控件对象的影响,提高确定第一图像与第二图像中相同控件对象的准确性。
根据第二方面的第一种可能的实现方式或第二方面的第二种可能的实现方式,在第二方面的第三种可能的实现方式中,第一中间图像与第一图像的尺寸相同;第二中间图像与第二图像的尺寸相同;第一图像中的控件对象的位置信息与第一中间图像中的控件对象的位置信息相同;第二图像中的控件对象的位置信息与第二中间图像中的控件对象的位置信息相同;从而提高确定第一图像与第二图像中相同控件对象的准确性。
根据以上第二方面的任意一种可能的实现方式,在第二方面的第四种可能的实现方式中,识别单元在根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像,或者,根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像时,具体用于:
若控件对象为文本控件,提取出文本控件中的文本,并根据控件对象在所属图像中的位置信息,将文本控件中的文本布局在中间背景图像中;或者,
若控件对象为不透底的文本控件,则根据控件对象在所属图像中的位置信息,将不透底的文本控件布局在中间背景图像中;或者,若控件对象为透底的文本控件,则提取出透底的文本控件中的文本,并根据控件对象在所属图像中的位置信息,将透底的文本控件中的文本布局在中间背景图像中,或 者,将透底的文本控件替换为色块图像,并根据文本控件在所属图像中的位置信息,将色块图像布局在中间背景图像中,色块图像的尺寸与不透底的文本控件的尺寸相同;或者,
若控件对象为动态图像控件,则将动态图像控件替换为静态图像,并根据动态图像控件在所属图像中的位置信息,将静态图像布局在中间背景图像中,静态图像的尺寸与动态图像控件的尺寸相同。
根据第二方面或以上第二方面的任意一种可能的实现方式,在第二方面的第五种可能的实现方式中,位置信息为坐标信息。
根据第二方面或以上第二方面的任意一种可能的实现方式,在第二方面的第六种可能的实现方式中,拼接单元具体用于:根据第一位置信息获取第一待拼接图像,将第一待拼接图像与第二图像拼接为第三图像;或者,根据第二位置信息获取第二待拼接图像,将第一图像与第二待拼接图像拼接为第三图像。
第三方面,本发明实施例提供一种电子设备,包括:存储器,用于存储指令;
处理器,用于调用存储器中存储的指令执行:获取第一图像的控件对象,以及获取第二图像的控件对象;识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息,位置信息包括第一位置信息和第二位置信息,第一位置信息指示相同控件对象在第一图像中的位置,第二位置信息指示相同控件对象在第二图像中的位置;根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像;
显示器,用于显示第一图像、第二图像以及第三图像;
从而电子设备可以准确识别出第一图像中与第二图像中的重复区域或内容,根据所述相同区域或内容的位置信息将第一图像与第二图像拼接为第三图像,获得的第三图像中不存在重复的内容,提高了图像拼接的准确性。
根据第三方面,在第三方面的第一种可能的实现方式中,处理器在识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息时,具体用于:获取第一图像中的控件对象在第一图像中的位置信息;根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像;获取第二图像中的控件对象在第二图像中的位置信息;根 据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像;比较第一中间图像与第二中间图像,确定第一中间图像与第二中间图像中的相同控件对象;确定相同控件对象在第一中间图像中的位置信息;确定相同控件对象在第二中间图像中的位置信息。
根据第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,第一中间图像的背景是纯色的;第二中间图像的背景是纯色的;第一中间图像的背景和第二中间图像的背景相同;从而可以避免第一图像与第二图像中的具有个性化设置信息的背景图像对无法确定第一图像与第二图像中相同控件对象的影响,提高确定第一图像与第二图像中相同控件对象的准确性。
根据第三方面的第一种可能的实现方式或第三方面的第二种可能的实现方式,在第三方面的第三种可能的实现方式中,第一中间图像与第一图像的尺寸相同;第二中间图像与第二图像的尺寸相同;第一图像中的控件对象的位置信息与第一中间图像中的控件对象的位置信息相同;第二图像中的控件对象的位置信息与第二中间图像中的控件对象的位置信息相同;从而提高确定第一图像与第二图像中相同控件对象的准确性。
根据以上第三方面的任意一种可能的实现方式,在第三方面的第四种可能的实现方式中,处理器在根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像,或者,根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像时,具体用于:
若控件对象为文本控件,提取出文本控件中的文本,并根据控件对象在所属图像中的位置信息,将文本控件中的文本布局在中间背景图像中;或者,
若控件对象为不透底的文本控件,则根据控件对象在所属图像中的位置信息,将不透底的文本控件布局在中间背景图像中;或者,若控件对象为透底的文本控件,则提取出透底的文本控件中的文本,并根据控件对象在所属图像中的位置信息,将透底的文本控件中的文本布局在中间背景图像中,或者,则将透底的文本控件替换为色块图像,并根据文本控件在所属图像中的位置信息,将色块图像布局在中间背景图像中,色块图像的尺寸与不透底的文本控件的尺寸相同;或者,
若控件对象为动态图像控件,则将动态图像控件替换为静态图像,并根据动态图像控件在所属图像中的位置信息,将静态图像布局在中间背景图像中,静态图像的尺寸与动态图像控件的尺寸相同。
根据第三方面或以上第三方面的任意一种可能的实现方式,在第三方面的第五种可能的实现方式中,位置信息为坐标信息。
根据第三方面或以上第三方面的任意一种可能的实现方式,在第三方面的第六种可能的实现方式中,处理器在根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像时,具体用于:根据第一位置信息获取第一待拼接图像,将第一待拼接图像与第二图像拼接为第三图像;或者,根据第二位置信息获取第二待拼接图像,将第一图像与第二待拼接图像拼接为第三图像。
通过本发明实施例提供的上述图像拼接的方法,可以准确识别出第一图像中与第二图像中的重复区域或内容,根据所述相同区域或内容的位置信息将第一图像与第二图像拼接为第三图像,获得的第三图像中不存在重复的内容,提高了图像拼接的准确性。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的电子设备的结构示意图;
图2为本发明图像拼接的方法实施例一的流程图;
图3A为本发明实施例提供的第一图像的一种示意图;
图3B为本发明实施例提供的第二图像的一种示意图;
图3C为本发明实施例提供的第三图像的一种示意图;
图3D为本发明实施例提供的第三图像的另一种示意图;
图4A为本发明实施例提供的第一中间图像的一种示意图;
图4B为本发明实施例提供的第二中间图像的一种示意图;
图5A为本发明实施例提供的图3B中的控件对象布局在中间背景图 像中的一种示意图;
图5B为本发明实施例提供的透底的文本控件的一种示意图;
图5C为本发明实施例提供的将透底的文本控件布局在中间背景图像中的一种示意图;
图5D为本发明实施例提供的将透底的文本控件布局在中间背景图像中的另一种示意图;
图6为本发明实施例一提供的电子设备的结构示意图;
图7为本发明实施例二提供的电子设备的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明可以应用于电子设备中,该电子设备可以为手机、平板电脑(PAD)、笔记本电脑或者可穿戴设备等具有显示屏的设备。
为便于说明,本发明中的实施例以电子设备100作示例性说明,本领域技术人员可以理解的,本发明中的实施例同样适用于其他装置,例如手持设备、车载设备、可穿戴设备、计算设备,以及各种形式的用户设备(英文:User Equipment,简称:UE),移动台(英文:Mobile station,简称:MS),终端(terminal),终端设备(Terminal Equipment)等等。
图1为本发明实施例提供的电子设备的结构示意图。
电子设备100可以包括触敏显示单元130、加速度传感器151、接近光传感器152、环境光传感器153、存储器120、处理器190、射频单元110、音频电路160、扬声器161、麦克风162、无线保真(英文:wireless fidelity,简称:WiFi)模块170、蓝牙模块180、电源193、外部接口197等部件。
本领域技术人员可以理解,图1仅仅是电子设备的举例,并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件。
所述触敏显示单元130有时为了方便被称为“触摸屏”,并且也可被称为是或者被叫做触敏显示器系统,也可以被称为具有触敏表面(touch-sensitive surface)的显示器。所述具有触敏表面的显示器包括触敏表面和显示屏;可以显示屏幕界面、也可以接收触摸动作。
触敏显示单元130提供设备与用户之间的输入接口和输出接口。所述触敏显示单元130可收集用户在其上或附近的触摸操作,例如用户使用手指、关节、触笔等任何适合的物体在触敏显示单元上或在触敏显示单元附近的操作。触敏显示单元可以检测对触敏显示单元的触摸动作、触敏显示单元的网格电容值、触点坐标,将所述触摸动作、触敏显示单元的网格电容值、触点坐标信息发送给所述处理器190,并能接收所述处理器190发来的命令并加以执行。触敏显示单元130显示视觉输出。视觉输出可包括图像、文本、图标、视频及它们的任何组合(统称为“图形”)。在一些实施例中,视觉输出可对应于第一图像、第二图像或第三图像。
触敏显示单元130可使用LCD(液晶显示器)技术、LPD(发光聚合物显示器)技术、或LED(发光二极管)技术,但是在其他实施例中可使用其他显示技术。触敏显示单元130可以利用现在已知的或以后将开发出的多种触摸感测技术中的任何技术,以及其他接近传感器阵列或用于确定与触敏显示单元130接触的一个或多个点的其他元件来检测接触及其任何移动或中断,该多种触摸感测技术包括但不限于电容性的、电阻性的、红外线的、和表面声波技术。在一示例性实施例中,使用投射式互电容感测技术。
在一些实施例中,除了触敏显示单元之外,电子设备100可包括用于激活或解除激活特定功能的触控板(未示出)。在一些实施例中,触控板是设备的触敏区域,该触敏区域与触敏显示单元不同,其不显示视觉输出。触控板可以是与触敏显示单元130分开的触敏表面,或者是由触敏显示单元形成的触敏表面的延伸部分。
所述加速度传感器151可检测各个方向上(一般为三轴)加速度的大小。同时,所述加速度传感器151还可用于检测终端静止时重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准),振动识别相关功能(比如计步器、敲击)等。但是可以理解的是,其并不属于电子设备100的必须构成,完全可以根据需要在不改变发明的本质的范围 内而省略。
电子设备100还可以包括一个或多个接近光传感器152,用于当所述电子设备100距用户较近时(例如当用户正在打电话时靠近耳朵)关闭并禁用触敏表面的触摸功能,以避免用户对触敏显示单元的误操作。电子设备100还可以包括一个或多个环境光传感器153,用于当电子设备100位于用户口袋里或其他黑暗区域时保持触敏显示单元关闭,以防止电子设备100在锁定状态时消耗不必要的电池功耗或被误操作。在一些实施例中,接近光传感器和环境光传感器可以集成在一颗部件中,也可以作为两个独立的部件。至于电子设备100还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。虽然图1示出了接近光传感器和环境光传感器,但是可以理解的是,其并不属于电子设备100的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
所述存储器120可用于存储指令和数据。存储器120可主要包括存储指令区和存储数据区。存储数据区可存储图像、控件对象、控件对象的位置信息。存储指令区可存储操作系统、至少一个功能所需的指令等。所述指令可使处理器190执行以下方法,具体方法包括:获取第一图像的控件对象;获取第二图像的控件对象;识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息,位置信息包括第一位置信息和第二位置信息,第一位置信息指示相同控件对象在第一图像中的位置,第二位置信息指示相同控件对象在第二图像中的位置;然后根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像。
处理器190是电子设备100的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的指令以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器190可包括一个或多个处理单元;优选的,处理器190可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器190中。在一些实施例中,处理器、存储器、可以在单一芯片上实现,在一些实施例中,他们也可以在独立的芯片上分别实现。在本发明实施例中,处理器190还用 于调用存储器中的指令以实现准确识别出第一图像中与第二图像中的重复区域或内容,根据所述相同区域或内容的位置信息将第一图像与第二图像拼接为第三图像,获得的第三图像中不存在重复的内容,提高了图像拼接的准确性。
所述射频单元110可用于收发信息或通话过程中信号的接收和发送,特别地,将基站的下行信息接收后,给处理器190处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,射频单元110还可以通过无线通信与网络设备和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(英文:Global System of Mobile communication,简称:GSM)、通用分组无线服务(英文:General Packet Radio Service,简称:GPRS)、码分多址(英文:Code Division Multiple Access,简称:CDMA)、宽带码分多址(英文:Wideband Code Division Multiple Access,简称:WCDMA)、长期演进(英文:Long Term Evolution,简称:LTE)、电子邮件、短消息服务(英文:Short Messaging Service,简称:SMS)等。
音频电路160、扬声器161、麦克风162可提供用户与电子设备100之间的音频接口。音频电路160可将接收到的音频数据转换后的电信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,麦克风162将收集的声音信号转换为电信号,由音频电路160接收后转换为音频数据,再将音频数据输出处理器190处理后,经射频单元110以发送给比如另一终端,或者将音频数据输出至存储器120以便进一步处理,音频电路也可以包括耳机插孔163,用于提供音频电路和耳机之间的连接接口。
WiFi属于短距离无线传输技术,电子设备100通过WiFi模块170可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图1示出了WiFi模块170,但是可以理解的是,其并不属于电子设备100的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
蓝牙是一种短距离无线通讯技术。利用蓝牙技术,能够有效地简化掌上电脑、笔记本电脑和手机等移动通信终端设备之间的通信,也能够成功地简 化以上这些设备与因特网(Internet)之间的通信,电子设备100通过蓝牙模块180使电子设备100与因特网之间的数据传输变得更加迅速高效,为无线通信拓宽道路。蓝牙技术是能够实现语音和数据无线传输的开放性方案。然图1示出了WiFi模块170,但是可以理解的是,其并不属于电子设备100的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
电子设备100还包括给各个部件供电的电源193(比如电池),优选的,电源可以通过电源管理系统与处理器190逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
电子设备100还包括外部接口197,所述外部接口可以是标准的Micro USB接口,也可以是多针连接器,可以用于连接电子设备100与其他装置进行通信,也可以用于连接充电器为电子设备100充电。
尽管未示出,电子设备100还可以包括摄像头、闪光灯等,在此不再赘述。
本发明提供下述各实施例可以用于拼接N张图像,N为大于或等于2的正整数,下面以N为2进行举例来说明本发明实施例提供的图像拼接方法,N张图像中每相邻两张图像之间的处理方式与下述两张图像之间的处理方式类似。
图2为本发明图像拼接的方法实施例一的流程图,如图2所示,本实施例的方法以拼接两张图像(第一图像与第二图像)为例进行说明,本实施例的方法可以包括:
获取第一图像的控件对象,获取第二图像的控件对象(S101);识别第一图像的控件对象与第二图像的控件对象中的相同控件对象以及该相同控件对象的位置信息(S102);根据所述相同控件对象的位置信息将第一图像和第二图像拼接为第三图像(S103)。
S101、获取第一图像的控件对象;获取第二图像的控件对象。
本实施例中,可以获取需要进行拼接的两张图像的控件对象。为了便于说明,本发明实施例以第一图像与第二图像说明,第一图像与第二图像可以是任意两张保存在电子设备的存储器中的图像。可以通过摄像头获取并保存在电子设备的存储器中,也可以是由电子设备的显示屏的显示界面生成的。如果所述图像是由电子设备的显示屏的显示界面生成的,可以通过按 压电子设备特定的按键获取并保存在电子设备的存储器中。控件对象为组成图像的部件。控件对象可以包括:文本控件对象、动态图像控件对象、静态图像控件对象、背景控件对象等。示例性的,以图3A为例,图3A包括背景控件对象、文本控件对象和表情控件对象。
获取第一图像的控件对象以及第二图像的控件对象的一种可选的方式为:首先识别图像中的控件对象类型,例如文本控件类型、动态图像控件类型、背景控件类型等等。然后根据识别出的控件对象类型获取各控件对象类型对应的控件对象。
图3A为本发明实施例提供的第一图像的一种示意图。
以图3A为例,图3A所示的第一图像中包括文本控件对象:时间框、“你好”、“你现在在哪儿”、“在西安”、“真巧,我也在西安”、“太好了,有时间聚聚”;表情控件对象;“*”型的背景控件对象。在获取控件对象时,首先识别第一图像中包括文本控件类型、表情控件类型以及背景控件类型。然后根据所识别的控件对象类型获取各控件对象类型对应的控件对象,如:文本控件类型对应的控件对象包括时间框、“你好”、“你现在在哪儿”、“在西安”、“真巧,我也在西安”、“太好了,有时间聚聚”;背景控件类型对应的控件对象为“*”型背景控件;表情控件类型对应的控件对象为笑脸表情控件。
图3B为本发明实施例提供的第二图像的一种示意图。
以如图3B为例,图3B所示的第二图中包括文本控件对象“太好了,有时间聚聚”、“好啊,那就今天吧”、“中午十二点不见不散”、“好的”;“*”型的背景控件对象。在获取控件对象时,首先识别第二图像中包括文本控件类型和背景控件类型,然后根据所识别的控件对象类型获取各控件对象类型对应的控件对象,如:文本控件类型对应的控件对象包括:“太好了,有时间聚聚”、“好啊,那就今天吧”、“中午十二点不见不散”、“好的”;背景控件类型对应的控件对象为“*”型背景控件。
如图3A和图3B所示,可以理解背景控件对象可以包括用户自定义的个性化设置信息,如:用户自定义图形、花朵或人物图像等为个性化的背景界面,示例性的,图3A和图3B中包含用户自定义的“*”型个性化背景控件对象。
本实施例中,至少可以通过以下两种实现方案识别图像中的控件对象类型:1)通过安卓平台提供的“辅助服务”工具识别图像中的控件对象类型。以图3A为例,通过安卓平台提供的“辅助服务”工具识别图3A包括文本控件类型、静态图像控件类型以及背景控件类型。2)通过图像识别的方法识别特征颜色判断控件对象,结合控件对象的命名确定控件对象类型。例如,即时通讯聊天对话框的特征颜色是绿色的,当通过图像识别的方法识别出绿色的特征颜色时,初步判断具有绿色特征颜色的对象为控件对象,进一步获取具有绿色特征颜色的控件对象的命名以确定控件对象的类型。例如:当获取控件对象的命名为TEXTVIEW,则通过控件对象的命名可以确定该控件为文本控件。若控件的命名为IMAGEVIW,则可以确定该控件为图像控件。
S102、识别第一图像的控件对象与第二图像的控件对象中的相同控件对象以及该相同控件对象的位置信息。
本实施例中,在获取第一图像的控件对象与第二图像的控件对象之后,可以将第一图像的控件对象与第二图像的控件对象进行比较,识别出第一图像的控件对象与第二图像的控件对象中的相同控件对象以及该相同控件对象的位置信息。其中,该相同控件对象既存在于第一图像中也存在于第二图像中。而且,该相同控件对象的位置信息包括第一位置信息和第二位置信息。第一位置信息指示该相同控件对象在第一图像中的位置;第二位置信息指示该相同控件对象在第二图像中的位置。此处相同控件对象是指:以两个控件对象均为文本控件对象为例,这两个文本控件对象中的文本内容相同以及文本框的颜色也相同。需要说明的是,由于个性化控件对象影响识别两张图像的相同控件对象的准确性,因此,在比较第一图像的控件对象与第二图像的控件对象的过程中,将用户自定义的个性化控件对象隔离。即:用户自定义的个性化控件对象不作为比较的对象。以图3A、图3B为例,背景控件对象为用户自定义的“*”型个性化控件对象。背景控件对象不用于识别第一图像与第二图像中的相同控件对象的过程。本实施例中位置信息可以是坐标信息。位置信息可以包括第一位置信息和第二位置信息。第一位置信息可以指示该相同控件对象在第一图像中的坐标信息。第二位置信息可以指示该相同控件对象在第二图像中的坐标信息。步骤S1021~步骤S1023将详细描述识别两张 图像的相同控件的实现方案。
如图3A所示的第一图像与图3B所示的第二图像,图3A中所示的“太好了,有时间聚聚”与图3B中所示的“太好了,有时间聚聚”为相同控件对象。若以第一图像的横向坐标为X轴,第一图像的纵向坐标为Y轴,第一图像的左下角为原点坐标,则“太好了,有时间聚聚”在第一图像中的坐标信息为X轴:4-14;Y轴:0-2;若以第二图像的横向坐标为X轴,第二图像的纵向坐标为Y轴,第二图像的左下角为原点坐标,则“太好了,有时间聚聚”在第二图像中的坐标信息为X轴:4-14,Y轴:17-19。
S103、根据所述相同控件对象的位置信息将第一图像与第二图像拼接为第三图像。
本实施例中,在确定相同控件对象的位置信息之后,根据该相同控件对象的位置信息,将第一图像和第二图像拼接为第三图像。所述位置信息可以为坐标信息。优选的,所述相同控件对象位于第一图像的底部,所述相同控件对象位于第二图像的顶部。根据该相同控件对象在第一图像中的位置信息,即第一位置信息,截取第一图像中第一位置信息以上的区域,获得第一待拼接图像。将第一待拼接图像与第二图像拼接形成第三图像。或者根据该相同控件对象在第二图像中的位置信息,即第二位置信息,截取第二图像中第二位置信息以下的区域,获得第二待拼接图像。将第一图像与第二待拼接图像拼接形成第三图像
图3C为本发明实施例提供的第三图像的一种示意图。
图3D为本发明实施例提供的第三图像的另一种示意图。
例如:以图3A、图3B为例,当识别“太好了,有时间聚聚”文本控件对象为第一图像与第二图像的相同控件对象后,识别该相同控件对象在图3A所示的第一图像中的坐标信息为X轴:4-14,Y轴:0-2。该相同控件对象在图3B所示的第二图像中的坐标信息为X轴:4-14,Y轴:17-19。将第一图像和第二图像拼接为第三图像的一种实现方式为:截取第一图像中Y轴坐标2以上的区域,获得第一待拼接图像,将第一待拼接图像与第二图像拼接形成第三图像(如图3C所示)。另一种实现方式为:截取第二图像中的Y轴坐标17以下的区域,获得第二待拼接图像,将第一图像与第二待拼接图像拼接形成第三图像(如图3D所示)。
本实施例提供的图像拼接方法,通过分别获取第一图像的控件对象与第二图像的控件对象,然后识别第一图像与第二图像中的相同控件对象及该相同控件对象的位置信息,从而可以准确识别出第一图像中的相同区域或内容,根据该相同区域或内容将第一图像与第二图像拼接为第三图像,获得的第三图像中不存在重复的内容,提高了图像拼接的准确性。
对S102的一种实现方式进行详细说明,具体实现过程如下所示。
S1021、获取第一图像中的控件对象在第一图像中的位置信息,获取第二图像中的控件对象在第二图像中的位置信息。
本实施例中,所述位置信息可以是坐标信息,坐标信息包括横坐标和纵坐标,例如:以第一图像的左下角为原点,可以获得第一图像中的控件对象相对于该原点的横坐标和纵坐标。
S1022、根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像,根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像。
本实施例中,在获取第一图像中的控件对象与控件对象在第一图像中的位置信息之后,根据第一图像中的控件对象在第一图像中的位置信息,将第一图像中的控件对象布局在纯色的中间背景图像中,获得第一中间图像。需要说明的是,为了解决背景图像等个性化信息对识别两张图像中相同控件对象的影响,第一中间背景图像中不包括第一图像中具有个性化信息的控件对象,如第一图像中的背景控件对象。且本实施例中的中间背景图像为纯色背景图像。第一图像的尺寸与第一中间图像的尺寸相同,此处所称的尺寸是指长度与宽度,即第一图像的长度与第一中间图像的长度相同,第一图像的宽度与第一中间图像的宽度相同。第一图像中的控件对象在第一图像中的位置信息与该控件对象在第一中间图像中的位置信息相同。可以理解的,第一图像与第一中间图像的区别在于第一中间图像在第一图像的基础上,去除了背景图像等个性化信息。
图4A为本发明实施例提供的第一中间图像的一种示意图。例如:以第一图像的左下角为原点,某控件对象在第一图像中坐标信息为:X轴:4-14,Y轴:0-2;则该控件对象在第一中间图像中坐标信息也为:X轴:4-14,Y轴:0-2。将图3A所示的第一图像中的控件对象布局在中间背景图像中获得 如图4A所示的第一中间图像。其中,第一中间图像的背景图像为纯色背景图像。
在获取第二图像中的控件对象与控件对象在第二图像中的位置信息之后,根据第二图像中的控件对象在第二图像中的位置信息,将第二图像中的控件对象布局在纯色的中间背景图像(与布局第一图像中的控件对象在第一中间背景图像相同)中,获得第二中间图像,需要说明的是,为了解决背景图像等个性化信息对识别两张图像中相同控件对象的影响,第二中间背景图像中不包括第二图像中具有个性化信息的控件对象,如第二图像中的背景控件对象。且本实施例中的中间背景图像为纯色背景图像。第二图像的尺寸与第二中间图像的尺寸相同,此处所称的尺寸大小是指长度与宽度,即第二图像的长度与第二中间图像的长度相同,第二图像的宽度与第二中间图像的宽度相同。第二图像中的控件对象在第二图像中的位置信息与该控件对象在第二中间图像中的位置信息相同。可以理解的,第二图像与第二中间图像的区别在于第二中间图像在第二图像的基础上,去除了背景图像等个性化信息。
图4B为本发明实施例提供的第二中间图像的一种示意图。例如:以第二图像的左下角为原点,某控件对象在第二图像中坐标信息为:X轴:4-14,Y轴:17-19;则该控件对象在第二中间图像中坐标信息也为:X轴:4-14,Y轴:17-19。将图3B所示的第二图像中的控件对象布局在中间背景图像中获得如图4B所示的第二中间图像。其中,第二中间图像的背景图像为纯色背景图像。
第一中间图像的背景图像与第二中间图像的背景图像相同。
S1023、比较第一中间图像与第二中间图像,确定第一中间图像与第二中间图像中的相同控件对象以及相同控件对象的位置信息。
本实施例中,在获得第一中间图像与第二中间图像之后,将第一中间图像与第二中间图像进行图像比对。例如:可以通过将第一中间图像与第二中间图像逐像素地进行比对,确定第一中间图像与第二中间图像中的相同控件对象。进而获取两张图像中相同控件对象的位置信息。示例性的,通过对图4A所示的第一中间图像与图4B所示的第二中间图像逐像素比对,可以确定“太好了,有时间聚聚”为第一中间图像与第二中间图像的相同控件对象。该相同控件对象在第一中间图像中的坐标为:X轴:4-14,Y轴:0-2,该相同 控件对象在第二中间图像中的坐标为:X轴:4-14,Y轴:17-19。
本实施例提供的图像拼接的方法,通过将两张图像的控件对象布局在相同的纯色背景图像中,避免了用户自定义的个性化背景图像影响相同控件对象的确定,使得拼接后的图像不存在重复的内容,提高了图像拼接的准确性。
在本发明方法实施例三中,本实施例在本发明方法实施例二的基础上,对S1022进行详细说明,本实施例以第一图像中的控件对象和第二图像中的控件对象中的任一控件对象为例进行说明,其它控件对象类似,具体过程如下所述。
图5A为本发明实施例提供的图3B中的控件对象布局在中间背景图像中的一种示意图。在第一种可行的实现方式中,若控件对象为文本控件,提取出该文本控件中的文本,将该文本控件中的文本布局在中间背景图像中。该文本在该中间背景图像中的坐标信息与该文本在所属的图像(第一图像或第二图像)中的坐标信息相同。如图3B所示的控件对象布局在中间背景图像中如图5A所示。
在第二种可行的实现方式中,若控件对象为文本控件,且该文本控件为不透底的文本控件,则将该文本控件布局在中间背景图像中。不透底的文本控件是指透过该文本控件不可见该文本控件所属图像的背景。该文本控件在该中间背景图像中的坐标信息与该文本控件在所属图像(第一图像或第二图像)中的坐标信息相同。如图3B所示的控件对象布局在中间背景图像中如图4B所示。
图5C为本发明实施例提供的将透底的文本控件布局在中间背景图像中的一种示意图。透底的文本控件是指透过文本控件可见该文本控件所属图像的背景。若控件对象为文本控件,且该文本控件为透底的文本控件,则提取出该文本控件中的文本将所提取的文本布局在中间背景图像中;该文本在该中间背景图像中的坐标信息与该文本在所属图像中的坐标信息相同;如图5B所示的控件对象布局在中间背景图像中如图5C所示。或者,
图5D为本发明实施例提供的将透底的文本控件布局在中间背景图像中的另一种示意图。若控件对象为文本控件,且该文本控件为透底的文本控件,则将该文本控件替换为色块图像,并将该色块图像布局在中间背景图像中;该色块图像与该文本控件的尺寸相同,即色块图像的长度与该文本控件 的长度相同,且色块图像的宽度与该文本控件的宽度相同;该色块图像在该中间背景图像中的坐标信息与该文本控件在所属图像中的坐标信息相同;如图4B所示的控件对象布局在中间背景图像中如图5D所示,图5D所示的黑色色块图像替换如图5B中的透底的文本控件。
在第三种可行的实现方式中,若控件对象为动态图像控件,例如动态表情或者视频等,则将所述动态图像控件替换为静态图像,并将所述静态图像布局在中间背景图像中;该静态图像与该动态图像控件的尺寸相同,即静态图像的长度与该动态图像控件的长度相同,且静态图像的宽度与该动态图像控件的宽度相同;该静态图像在该中间背景图像中的坐标信息与该动态图像控件在所属图像中的坐标信息相同。可选地,该静态图像也可以为色块图像。
图6为本发明实施例一提供的电子设备的结构示意图,如图6所示,本实施例的电子设备可以包括:获取单元11、识别单元12和拼接单元13;其中,获取单元11,用于获取第一图像的控件对象;获取第二图像的控件对象;识别单元12,用于识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息;位置信息包括第一位置信息和第二位置信息;第一位置信息指示相同控件对象在第一图像中的位置;第二位置信息指示相同控件对象在第二图像中的位置;拼接单元13,用于根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像。
可选地,识别单元12具体用于:获取第一图像中的控件对象在第一图像中的位置信息;根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像;获取第二图像中的控件对象在第二图像中的位置信息;根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像;比较第一中间图像与第二中间图像,确定第一中间图像与第二中间图像中的相同控件对象;确定相同控件对象在第一中间图像中的位置信息;确定相同控件对象在第二中间图像中的位置信息。
可选地,第一中间图像的背景是纯色的;第二中间图像的背景是纯色的;第一中间图像的背景和第二中间图像的背景相同。
可选地,第一中间图像与第一图像的尺寸相同;第二中间图像与第二图像的尺寸相同;第一图像中的控件对象的位置信息与第一中间图像中的控件 对象的位置信息相同;第二图像中的控件对象的位置信息与第二中间图像中的控件对象的位置信息相同。
可选地,识别单元12在根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像,或者,根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像时,具体用于:
若控件对象为文本控件,提取出文本控件中的文本,并根据控件对象在所属图像中的位置信息,将文本控件中的文本布局在中间背景图像中;或者,
若控件对象为不透底的文本控件,则根据控件对象在所属图像中的位置信息,将不透底的文本控件布局在中间背景图像中;或者,若控件对象为透底的文本控件,则提取出透底的文本控件中的文本,并根据控件对象在所属图像中的位置信息,将透底的文本控件中的文本布局在中间背景图像中,或者,则将透底的文本控件替换为色块图像,并根据文本控件在所属图像中的位置信息,将色块图像布局在中间背景图像中,色块图像的尺寸与不透底的文本控件的尺寸相同;或者,
若控件对象为动态图像控件,则将动态图像控件替换为静态图像,并根据动态图像控件在所属图像中的位置信息,将静态图像布局在中间背景图像中,静态图像的尺寸与动态图像控件的尺寸相同。
可选地,位置信息为坐标信息。
可选地,拼接单元13具体用于:根据第一位置信息获取第一待拼接图像,将第一待拼接图像与第二图像拼接为第三图像;或者,根据第二位置信息获取第二待拼接图像,将第一图像与第二待拼接图像拼接为第三图像。
本实施例的电子设备,可以用于执行本发明上述各方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图7为本发明实施例二提供的电子设备的结构示意图,如图7所示,本实施例的电子设备可以包括:存储器21和处理器22以及显示器23;其中,包括:存储器21,用于存储指令;处理器22,用于调用存储器21中存储的指令执行:获取第一图像的控件对象,以及获取第二图像的控件对象;识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息,位置信息包括第一位置信息和第二位置信息,第一位置信息指示相同控件对象在第 一图像中的位置,第二位置信息指示相同控件对象在第二图像中的位置;根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像。显示器23,用于显示第一图像、第二图像以及第三图像。
可选地,处理器22在识别第一图像与第二图像的相同控件对象以及相同控件对象的位置信息时,具体用于:获取第一图像中的控件对象在第一图像中的位置信息;根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像;获取第二图像中的控件对象在第二图像中的位置信息;根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像;比较第一中间图像与第二中间图像,确定第一中间图像与第二中间图像中的相同控件对象;确定相同控件对象在第一中间图像中的位置信息;确定相同控件对象在第二中间图像中的位置信息。
可选地,第一中间图像的背景是纯色的;第二中间图像的背景是纯色的;第一中间图像的背景和第二中间图像的背景相同。
可选地,第一中间图像与第一图像的尺寸相同;第二中间图像与第二图像的尺寸相同;第一图像中的控件对象的位置信息与第一中间图像中的控件对象的位置信息相同;第二图像中的控件对象的位置信息与第二中间图像中的控件对象的位置信息相同。
可选地,处理器22在根据所获取的第一图像中的控件对象和第一图像中的控件对象在第一图像中的位置信息获取第一中间图像,或者,根据所获取的第二图像中的控件对象和第二图像中的控件对象在第二图像中的位置信息获取第二中间图像时,具体用于:
若控件对象为文本控件,提取出文本控件中的文本,并根据控件对象在所属图像中的位置信息,将文本控件中的文本布局在中间背景图像中;或者,
若控件对象为不透底的文本控件,则根据控件对象在所属图像中的位置信息,将不透底的文本控件布局在中间背景图像中;或者,若控件对象为透底的文本控件,则提取出透底的文本控件中的文本,并根据控件对象在所属图像中的位置信息,将透底的文本控件中的文本布局在中间背景图像中,或者,将透底的文本控件替换为色块图像,并根据文本控件在所属图像中的位置信息,将色块图像布局在中间背景图像中,色块图像的尺寸与不透底的文 本控件的尺寸相同;或者,
若控件对象为动态图像控件,则将动态图像控件替换为静态图像,并根据动态图像控件在所属图像中的位置信息,将静态图像布局在中间背景图像中,静态图像的尺寸与动态图像控件的尺寸相同。
可选地,位置信息为坐标信息。
可选地,处理器22在根据相同控件对象的位置信息将第一图像与第二图像拼接为第三图像时,具体用于:根据第一位置信息获取第一待拼接图像,将第一待拼接图像与第二图像拼接为第三图像;或者,根据第二位置信息获取第二待拼接图像,将第一图像与第二待拼接图像拼接为第三图像。
本实施例的电子设备,可以用于执行本发明上述各方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一非易失性计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:只读内存(英文:Read-Only Memory,简称:ROM)、随机存取存储器(英文:Random Access Memory,简称:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (21)

  1. 一种图像拼接的方法,其特征在于,所述方法包括:
    获取第一图像的控件对象;
    获取第二图像的控件对象;
    识别所述第一图像与所述第二图像的相同控件对象以及所述相同控件对象的位置信息;
    所述位置信息包括第一位置信息和第二位置信息;
    所述第一位置信息指示所述相同控件对象在所述第一图像中的位置;
    所述第二位置信息指示所述相同控件对象在所述第二图像中的位置;
    根据所述相同控件对象的位置信息将所述第一图像与所述第二图像拼接为第三图像。
  2. 根据权利要求1所述的方法,其特征在于,所述识别所述第一图像与所述第二图像的相同控件对象以及所述相同控件对象的位置信息,包括:
    获取所述第一图像中的控件对象在所述第一图像中的位置信息;
    根据所获取的第一图像中的控件对象和所述第一图像中的控件对象在所述第一图像中的位置信息获取第一中间图像;
    获取所述第二图像中的控件对象在所述第二图像中的位置信息;
    根据所获取的第二图像中的控件对象和所述第二图像中的控件对象在所述第二图像中的位置信息获取第二中间图像;
    比较所述第一中间图像与所述第二中间图像,确定所述第一中间图像与所述第二中间图像中的相同控件对象;
    确定所述相同控件对象在所述第一中间图像中的位置信息;
    确定所述相同控件对象在所述第二中间图像中的位置信息。
  3. 根据权利要求2所述的方法,其特征在于,所述第一中间图像的背景是纯色的;所述第二中间图像的背景是纯色的;所述第一中间图像的背景和所述第二中间图像的背景相同。
  4. 根据权利要求2或3所述的方法,其特征在于,所述第一中间图像与所述第一图像的尺寸相同;所述第二中间图像与所述第二图像的尺寸相同;
    所述第一图像中的控件对象的位置信息与所述第一中间图像中的控件对象的位置信息相同;
    所述第二图像中的控件对象的位置信息与所述第二中间图像中的控件对象的位置信息相同。
  5. 根据权利要求2-4任意一项所述的方法,其特征在于,根据所获取的第一图像中的控件对象和所述第一图像中的控件对象在所述第一图像中的位置信息获取第一中间图像,或者,根据所获取的第二图像中的控件对象和所述第二图像中的控件对象在所述第二图像中的位置信息获取第二中间图像,包括:
    若所述控件对象为文本控件,提取出所述文本控件中的文本,并根据所述控件对象在所属图像中的位置信息,将所述文本控件中的文本布局在中间背景图像中;或者,
    若所述控件对象为不透底的文本控件,则根据所述控件对象在所属图像中的位置信息,将所述不透底的文本控件布局在中间背景图像中;或者,若所述控件对象为透底的文本控件,则提取出所述透底的文本控件中的文本,并根据所述控件对象在所属图像中的位置信息,将所述透底的文本控件中的文本布局在中间背景图像中;或者,将所述透底的文本控件替换为色块图像,并根据所述文本控件在所属图像中的位置信息,将所述色块图像布局在中间背景图像中,所述色块图像的尺寸与所述不透底的文本控件的尺寸相同;或者,
    若所述控件对象为动态图像控件,则将所述动态图像控件替换为静态图像,并根据所述动态图像控件在所属图像中的位置信息,将所述静态图像布局在中间背景图像中,所述静态图像的尺寸与所述动态图像控件的尺寸相同。
  6. 根据权利要求1-5任意一项所述的方法,其特征在于,所述位置信息为坐标信息。
  7. 根据权利要求1-6任意一项所述的方法,其特征在于,所述根据所述相同控件对象的位置信息将所述第一图像与所述第二图像拼接为第三图像,包括:
    根据第一位置信息获取第一待拼接图像,将所述第一待拼接图像与所述第二图像拼接为所述第三图像;或者,
    根据第二位置信息获取第二待拼接图像,将所述第一图像与所述第二待拼接图像拼接为所述第三图像。
  8. 一种电子设备,其特征在于,包括:
    获取单元,用于获取第一图像的控件对象;以及获取第二图像的控件对象;
    识别单元,用于识别所述第一图像与所述第二图像的相同控件对象以及所述相同控件对象的位置信息;所述位置信息包括第一位置信息和第二位置信息;所述第一位置信息指示所述相同控件对象在所述第一图像中的位置;所述第二位置信息指示所述相同控件对象在所述第二图像中的位置;
    拼接单元,用于根据所述相同控件对象的位置信息将所述第一图像与所述第二图像拼接为第三图像。
  9. 根据权利要求8所述的电子设备,其特征在于,所述识别单元具体用于:获取所述第一图像中的控件对象在所述第一图像中的位置信息;根据所获取的第一图像中的控件对象和所述第一图像中的控件对象在所述第一图像中的位置信息获取第一中间图像;获取所述第二图像中的控件对象在所述第二图像中的位置信息;根据所获取的第二图像中的控件对象和所述第二图像中的控件对象在所述第二图像中的位置信息获取第二中间图像;比较所述第一中间图像与所述第二中间图像,确定所述第一中间图像与所述第二中间图像中的相同控件对象;确定所述相同控件对象在所述第一中间图像中的位置信息;确定所述相同控件对象在所述第二中间图像中的位置信息。
  10. 根据权利要求9所述的电子设备,其特征在于,所述第一中间图像的背景是纯色的;所述第二中间图像的背景是纯色的;所述第一中间图像的背景和所述第二中间图像的背景相同。
  11. 根据权利要求9或10所述的电子设备,其特征在于,所述第一中间图像与所述第一图像的尺寸相同;所述第二中间图像与所述第二图像的尺寸相同;
    所述第一图像中的控件对象的位置信息与所述第一中间图像中的控件对象的位置信息相同;
    所述第二图像中的控件对象的位置信息与所述第二中间图像中的控件对象的位置信息相同。
  12. 根据权利要求9-11任意一项所述的电子设备,所述识别单元在根据所获取的第一图像中的控件对象和所述第一图像中的控件对象在所述第一图 像中的位置信息获取第一中间图像,或者,根据所获取的第二图像中的控件对象和所述第二图像中的控件对象在所述第二图像中的位置信息获取第二中间图像时,具体用于:
    若所述控件对象为文本控件,提取出所述文本控件中的文本,并根据所述控件对象在所属图像中的位置信息,将所述文本控件中的文本布局在中间背景图像中;或者,
    若所述控件对象为不透底的文本控件,则根据所述控件对象在所属图像中的位置信息,将所述不透底的文本控件布局在中间背景图像中;或者,若所述控件对象为透底的文本控件,则提取出所述透底的文本控件中的文本,并根据所述控件对象在所属图像中的位置信息,将所述透底的文本控件中的文本布局在中间背景图像中,或者,将所述透底的文本控件替换为色块图像,并根据所述文本控件在所属图像中的位置信息,将所述色块图像布局在中间背景图像中,所述色块图像的尺寸与所述不透底的文本控件的尺寸相同;或者,
    若所述控件对象为动态图像控件,则将所述动态图像控件替换为静态图像,并根据所述动态图像控件在所属图像中的位置信息,将所述静态图像布局在中间背景图像中,所述静态图像的尺寸与所述动态图像控件的尺寸相同。
  13. 根据权利要求8-12任意一项所述的电子设备,其特征在于,所述位置信息为坐标信息。
  14. 根据权利要求8-13任意一项所述的电子设备,其特征在于,所述拼接单元具体用于:根据第一位置信息获取第一待拼接图像,将所述第一待拼接图像与所述第二图像拼接为所述第三图像;或者,根据第二位置信息获取第二待拼接图像,将所述第一图像与所述第二待拼接图像拼接为所述第三图像。
  15. 一种电子设备,其特征在于,包括:
    存储器,用于存储指令;
    处理器,用于调用所述存储器中存储的所述指令执行:
    获取第一图像的控件对象;
    获取第二图像的控件对象;
    识别所述第一图像与所述第二图像的相同控件对象以及所述相同控件对 象的位置信息;
    所述位置信息包括第一位置信息和第二位置信息;
    所述第一位置信息指示所述相同控件对象在所述第一图像中的位置;
    所述第二位置信息指示所述相同控件对象在所述第二图像中的位置;
    根据所述相同控件对象的位置信息将所述第一图像与所述第二图像拼接为第三图像;
    显示器,用于显示所述第一图像、所述第二图像以及所述第三图像。
  16. 根据权利要求15所述的电子设备,其特征在于,所述处理器在识别所述第一图像与所述第二图像的相同控件对象以及所述相同控件对象的位置信息时,具体用于:
    获取所述第一图像中的控件对象在所述第一图像中的位置信息;
    根据所获取的第一图像中的控件对象和所述第一图像中的控件对象在所述第一图像中的位置信息获取第一中间图像;
    获取所述第二图像中的控件对象在所述第二图像中的位置信息;
    根据所获取的第二图像中的控件对象和所述第二图像中的控件对象在所述第二图像中的位置信息获取第二中间图像;
    比较所述第一中间图像与所述第二中间图像,确定所述第一中间图像与所述第二中间图像中的相同控件对象;
    确定所述相同控件对象在所述第一中间图像中的位置信息;
    确定所述相同控件对象在所述第二中间图像中的位置信息。
  17. 根据权利要求16所述的电子设备,其特征在于,所述第一中间图像的背景是纯色的;所述第二中间图像的背景是纯色的;所述第一中间图像的背景和所述第二中间图像的背景相同。
  18. 根据权利要求16或17所述的电子设备,其特征在于,所述第一中间图像与所述第一图像的尺寸相同;所述第二中间图像与所述第二图像的尺寸相同;
    所述第一图像中的控件对象的位置信息与所述第一中间图像中的控件对象的位置信息相同;
    所述第二图像中的控件对象的位置信息与所述第二中间图像中的控件对象的位置信息相同。
  19. 根据权利要求16-18任意一项所述的电子设备,所述处理器在根据所获取的第一图像中的控件对象和所述第一图像中的控件对象在所述第一图像中的位置信息获取第一中间图像,或者,根据所获取的第二图像中的控件对象和所述第二图像中的控件对象在所述第二图像中的位置信息获取第二中间图像时,具体用于:
    若所述控件对象为文本控件,提取出所述文本控件中的文本,并根据所述控件对象在所属图像中的位置信息,将所述文本控件中的文本布局在中间背景图像中;或者,
    若所述控件对象为不透底的文本控件,则根据所述控件对象在所属图像中的位置信息,将所述不透底的文本控件布局在中间背景图像中;或者,若所述控件对象为透底的文本控件,则提取出所述透底的文本控件中的文本,并根据所述控件对象在所属图像中的位置信息,将所述透底的文本控件中的文本布局在中间背景图像中;或者,将所述透底的文本控件替换为色块图像,并根据所述文本控件在所属图像中的位置信息,将所述色块图像布局在中间背景图像中,所述色块图像的尺寸与所述不透底的文本控件的尺寸相同;或者,
    若所述控件对象为动态图像控件,则将所述动态图像控件替换为静态图像,并根据所述动态图像控件在所属图像中的位置信息,将所述静态图像布局在中间背景图像中,所述静态图像的尺寸与所述动态图像控件的尺寸相同。
  20. 根据权利要求15-19任意一项所述的电子设备,其特征在于,所述位置信息为坐标信息。
  21. 根据权利要求15-20任意一项所述的电子设备,其特征在于,所述处理器在根据所述相同控件对象的位置信息将所述第一图像与所述第二图像拼接为第三图像时,具体用于:
    根据第一位置信息获取第一待拼接图像,将所述第一待拼接图像与所述第二图像拼接为所述第三图像;或者,
    根据第二位置信息获取第二待拼接图像,将所述第一图像与所述第二待拼接图像拼接为所述第三图像。
PCT/CN2015/093844 2015-11-05 2015-11-05 图像拼接的方法和电子设备 WO2017075779A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US15/773,563 US10719926B2 (en) 2015-11-05 2015-11-05 Image stitching method and electronic device
PCT/CN2015/093844 WO2017075779A1 (zh) 2015-11-05 2015-11-05 图像拼接的方法和电子设备
CN201580083380.2A CN108027967B (zh) 2015-11-05 2015-11-05 图像拼接的方法和电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/093844 WO2017075779A1 (zh) 2015-11-05 2015-11-05 图像拼接的方法和电子设备

Publications (1)

Publication Number Publication Date
WO2017075779A1 true WO2017075779A1 (zh) 2017-05-11

Family

ID=58661481

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/093844 WO2017075779A1 (zh) 2015-11-05 2015-11-05 图像拼接的方法和电子设备

Country Status (3)

Country Link
US (1) US10719926B2 (zh)
CN (1) CN108027967B (zh)
WO (1) WO2017075779A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109618224A (zh) * 2018-12-18 2019-04-12 腾讯科技(深圳)有限公司 视频数据处理方法、装置、计算机可读存储介质和设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108027967B (zh) * 2015-11-05 2020-09-29 华为技术有限公司 图像拼接的方法和电子设备
CN112667178B (zh) * 2020-12-18 2023-03-07 威创集团股份有限公司 一种文字显示方法、系统、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514581A (zh) * 2013-10-23 2014-01-15 小米科技有限责任公司 一种截取屏幕图片的方法、装置和终端设备
US20140214986A1 (en) * 2013-01-28 2014-07-31 Naver Corporation Apparatus, method and computer readable recording medium for sharing real time video through chatting window of messenger service
CN103984502A (zh) * 2014-05-30 2014-08-13 天津三星通信技术研究有限公司 一种截取屏幕内容的方法及便携式终端
CN104536658A (zh) * 2014-12-12 2015-04-22 天津三星通信技术研究有限公司 在终端中生成截屏图像的设备和方法

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6573945B1 (en) * 2000-01-12 2003-06-03 General Instrument Corporation Logo insertion on an HDTV encoder
US7111787B2 (en) * 2001-05-15 2006-09-26 Hand Held Products, Inc. Multimode image capturing and decoding optical reader
US8068693B2 (en) * 2007-07-18 2011-11-29 Samsung Electronics Co., Ltd. Method for constructing a composite image
CN101504761B (zh) * 2009-01-21 2012-07-18 无锡中星微电子有限公司 一种图像拼接的方法和装置
CN102467738A (zh) 2010-11-08 2012-05-23 北京大学 一种图像拼接方法及系统
CN102708558A (zh) * 2012-06-01 2012-10-03 惠州华阳通用电子有限公司 视频图像拼接装置、拼接方法以及视频监视系统
CN103020938B (zh) 2012-12-14 2015-10-07 北京经纬恒润科技有限公司 一种基于加权平均法的空域图像缝合方法和系统
CN104103051B (zh) 2013-04-03 2017-02-22 华为技术有限公司 一种图像拼接方法和设备
CN104346788B (zh) 2013-07-29 2017-05-24 展讯通信(上海)有限公司 一种拼接图像的方法和装置
US9185284B2 (en) * 2013-09-06 2015-11-10 Qualcomm Incorporated Interactive image composition
CN104427242B (zh) 2013-09-10 2018-08-31 联想(北京)有限公司 图像拼接方法、装置及电子设备
CN104680501B (zh) 2013-12-03 2018-12-07 华为技术有限公司 图像拼接的方法及装置
US20150256764A1 (en) * 2014-03-05 2015-09-10 Guy M. Besson Active-tracking based systems and methods for generating mirror image
CN104331872B (zh) * 2014-11-26 2017-06-30 中测新图(北京)遥感技术有限责任公司 图像拼接方法
CN104376531B (zh) 2014-12-11 2018-01-19 重庆地质仪器厂 一种图像拼接方法与系统
CN108027967B (zh) * 2015-11-05 2020-09-29 华为技术有限公司 图像拼接的方法和电子设备
KR102111501B1 (ko) * 2017-06-19 2020-05-15 주식회사 케이티 가상 현실 체험 서비스를 제공하는 서버, 사용자 단말 및 방법
US10140497B1 (en) * 2017-09-12 2018-11-27 Symbol Technologies, Llc Methods and system for reading barcodes captured on multiple images

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140214986A1 (en) * 2013-01-28 2014-07-31 Naver Corporation Apparatus, method and computer readable recording medium for sharing real time video through chatting window of messenger service
CN103514581A (zh) * 2013-10-23 2014-01-15 小米科技有限责任公司 一种截取屏幕图片的方法、装置和终端设备
CN103984502A (zh) * 2014-05-30 2014-08-13 天津三星通信技术研究有限公司 一种截取屏幕内容的方法及便携式终端
CN104536658A (zh) * 2014-12-12 2015-04-22 天津三星通信技术研究有限公司 在终端中生成截屏图像的设备和方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109618224A (zh) * 2018-12-18 2019-04-12 腾讯科技(深圳)有限公司 视频数据处理方法、装置、计算机可读存储介质和设备
CN109618224B (zh) * 2018-12-18 2021-03-09 腾讯科技(深圳)有限公司 视频数据处理方法、装置、计算机可读存储介质和设备

Also Published As

Publication number Publication date
CN108027967B (zh) 2020-09-29
US10719926B2 (en) 2020-07-21
CN108027967A (zh) 2018-05-11
US20180330483A1 (en) 2018-11-15

Similar Documents

Publication Publication Date Title
US20220244814A1 (en) Method for displaying multiple application windows by mobile terminal, and mobile terminal
US9697622B2 (en) Interface adjustment method, apparatus, and terminal
US11294533B2 (en) Method and terminal for displaying 2D application in VR device
US20170046040A1 (en) Terminal device and screen content enlarging method
CN110908554B (zh) 长截图的方法及终端设备
US10409404B2 (en) Method of processing touch events and electronic device adapted thereto
CN105653112B (zh) 一种显示浮层的方法及装置
CN107479799B (zh) 一种显示窗口的方法和装置
WO2017075779A1 (zh) 图像拼接的方法和电子设备
CN103399657A (zh) 鼠标指针的控制方法、装置及终端设备
US10635279B2 (en) Method for screenshot a special-shaped screen and related products
CN111026457B (zh) 一种硬件配置方法、装置、存储介质及终端设备
CN111045737B (zh) 设备标识获取方法、装置、终端设备和存储介质
WO2015124060A1 (en) Login interface displaying method and apparatus
US20180253225A1 (en) Display Operation Method and Apparatus, User Interface, and Storage Medium
WO2017035740A1 (zh) 一种选择文本的方法
US20200348839A1 (en) Man-Machine Interaction Method and Electronic Device
CN105988801B (zh) 一种显示注释信息的方法及装置
CN104866287B (zh) 一种生成功能栏的方法和装置
CN110618798A (zh) 多屏显示的方法、多屏装置、存储介质及终端设备
CN110109582B (zh) 移动终端的显示方法、装置及存储介质
CN111862874A (zh) 显示方法、装置、存储介质及移动终端
CN111008049A (zh) 通信控制方法、装置、存储介质及移动终端
WO2017035739A1 (zh) 一种选择文本的方法

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: 15907621

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15773563

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15907621

Country of ref document: EP

Kind code of ref document: A1