WO2018112764A1 - 图像处理方法与装置、控制方法与装置、成像与电子装置 - Google Patents

图像处理方法与装置、控制方法与装置、成像与电子装置 Download PDF

Info

Publication number
WO2018112764A1
WO2018112764A1 PCT/CN2016/111149 CN2016111149W WO2018112764A1 WO 2018112764 A1 WO2018112764 A1 WO 2018112764A1 CN 2016111149 W CN2016111149 W CN 2016111149W WO 2018112764 A1 WO2018112764 A1 WO 2018112764A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
focus
overexposed
focus image
image processing
Prior art date
Application number
PCT/CN2016/111149
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 PCT/CN2016/111149 priority Critical patent/WO2018112764A1/zh
Priority to TW106139390A priority patent/TWI626620B/zh
Priority to US15/814,791 priority patent/US10692199B2/en
Priority to EP17208506.0A priority patent/EP3340608B1/en
Priority to ES17208506T priority patent/ES2761593T3/es
Priority to PCT/CN2017/117289 priority patent/WO2018113685A1/en
Priority to KR1020197018549A priority patent/KR102171625B1/ko
Priority to JP2019533587A priority patent/JP6803473B2/ja
Priority to AU2017379019A priority patent/AU2017379019B2/en
Publication of WO2018112764A1 publication Critical patent/WO2018112764A1/zh
Priority to ZA2019/04191A priority patent/ZA201904191B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • 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/20004Adaptive image processing
    • G06T2207/20012Locally adaptive
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Definitions

  • the present invention relates to image processing technology, and in particular, to an image processing method, a control method, an image processing device, a control device, an imaging device, and an electronic device.
  • the fuzzy algorithm is an average algorithm that averages the pixel brightness values of the light source when blurring the light source in the photo. The light source in the photo appears dim and the effect is not good.
  • Embodiments of the present invention aim to solve at least one of the technical problems existing in the prior art. To this end, embodiments of the present invention are required to provide an image processing method, a control method, an image processing device, a control device, an imaging device, and an electronic device.
  • the invention provides an image processing method, the image processing method comprising the following steps:
  • a blurred overexposed portion corresponding to the overexposed portion of the blurred focus image is replaced with the material portion to obtain a merged image.
  • the in-focus image is in a panoramic deep focus state.
  • the step of identifying whether there is an overexposed portion in the in-focus state in the in-focus image comprises:
  • the step of identifying whether there is an overexposed portion in the in-focus state in the in-focus image comprises:
  • the adjacent overexposed pixels When the adjacent overexposed pixels are present, it is determined that the adjacent overexposed pixels belong to the overexposed portion.
  • the predetermined pixel value is an upper limit of a range of pixel values of the expansive image.
  • the step of blurring the in-focus image to obtain a blurred focus image is implemented using a Gaussian blur algorithm.
  • the degree of blur of the material portion is substantially the same as the degree of blur of the blur exposed portion.
  • the image processing method comprises:
  • the blurred focus image is output when the overexposed portion is absent.
  • the present invention provides a control method for controlling an imaging device, the control method comprising the following steps:
  • the in-focus image and the virtual focus image are processed by the image processing method according to any of the above embodiments.
  • the step of controlling the imaging device to output a focused image and a virtual focus image of the same scene comprises the steps of:
  • the cached image having the same degree of blur as the blurred focus image is saved as the virtual focus image.
  • the present invention provides an image processing apparatus, the image processing apparatus comprising the following steps:
  • An identification module configured to identify whether an overexposed portion in an in-focus state exists in the in-focus image
  • a blurring module configured to blur the in-focus image to obtain a blurred focus image
  • a processing module configured to process a virtual focus image identical to the focused image scene to obtain a material portion corresponding to the overexposed portion when the overexposed portion is present;
  • a merging module configured to replace the imaginary overexposed portion corresponding to the overexposed portion in the blurred focus image with the material portion to obtain a merged image.
  • the in-focus image is in a panoramic deep focus state.
  • the identification module comprises:
  • a first determining sub-module configured to determine, according to a histogram of the in-focus image, whether the over-exposed pixel in the in-focus image is greater than or equal to a first predetermined number, and the pixel value of the over-exposed pixel is greater than or equal to a predetermined pixel value;
  • the first determining submodule is configured to determine that the overexposed portion exists when the overexposed pixel is more than or equal to the first predetermined number.
  • the identification module further includes:
  • a second determining sub-module configured to determine, in the presence of the over-exposed portion, whether there is an adjacent over-exposed pixel in the in-focus image, the number of the adjacent over-exposed pixels being more than or equal to the second The predetermined number;
  • a second determining submodule configured to determine that the adjacent overexposed pixels belong to the overexposed portion when the adjacent overexposed pixels are present.
  • the predetermined pixel value is an upper limit of a range of pixel values of the expansive image.
  • the blurring module is configured to use a Gaussian blurring algorithm to blur the in-focus image to obtain a blurred focus image.
  • the degree of blur of the material portion is substantially the same as the degree of blur of the blur exposed portion.
  • the image processing apparatus comprises:
  • a first output module configured to output the merged image when the overexposed portion is present
  • a second output module configured to output the blurred focus image when the overexposed portion is absent.
  • the present invention provides a control device for controlling an imaging device, the control device comprising:
  • An image processing apparatus as described in any of the above embodiments and electrically connected to the control module.
  • control module comprises:
  • a focusing sub-module configured to control the imaging device to focus to obtain the in-focus image
  • a focusing sub-module for refocusing and processing a cached image output by the imaging device in different focusing states to obtain a corresponding degree of blur
  • a saving submodule configured to save the cached image having a degree of blurring substantially the same as the blurred focus image as the virtual focus image.
  • the invention provides an imaging device, the imaging device comprising:
  • control module electrically connected to the camera, configured to control the camera to output a focused image and a virtual focus image of the same scene
  • An image processing apparatus as described in any of the above embodiments and electrically connected to the control module.
  • control module comprises:
  • a focusing sub-module configured to control the imaging device to focus to obtain the in-focus image
  • a focusing sub-module for refocusing and processing a cached image output by the imaging device in different focusing states to obtain a corresponding degree of blur
  • a saving submodule configured to save the cached image having a degree of blurring substantially the same as the blurred focus image as the virtual focus image.
  • the present invention provides an electronic device comprising the imaging device according to any of the above embodiments.
  • the electronic device includes any one of a mobile phone, a tablet computer, a notebook computer, a smart watch, a smart bracelet, a smart helmet, and smart glasses.
  • the imaging device comprises a front camera or/and a rear camera.
  • the present invention provides an electronic device including a housing, a processor, a memory, a circuit board, and a power supply circuit.
  • the circuit board is disposed inside a space enclosed by the casing, and the processor and the memory are disposed on the circuit board.
  • the power circuit for supplying power to respective circuits or devices of the electronic device; the memory for storing executable program code; the processor running by reading executable program code stored in the memory
  • the program corresponding to the executable program code is used to execute the image processing method according to any of the above embodiments or to execute the control method described in any of the above embodiments.
  • the present invention provides a computer readable storage medium having instructions stored therein, when the processor of the electronic device executes the instructions, the electronic device executes the image processing method according to any one of the above embodiments or performs the above-described A control method according to an embodiment.
  • the image processing method, the image processing device, the control method, the control device, the imaging device and the electronic device provided by the invention take two images, one focused image, one virtual focus image, and the virtual focus image and the focused image are taken
  • the material part corresponding to the exposed part is combined into the blurred focus image to form a combined image with a real spot effect, and the spot effect is good.
  • FIG. 1 is a flow chart showing an image processing method according to a first embodiment of the present invention.
  • FIG. 2 is a functional block diagram of an image processing apparatus according to a first embodiment of the present invention.
  • FIG. 3 is a flow chart showing a control method of the first embodiment of the present invention.
  • FIG. 4 is a schematic diagram of functional blocks of a control device according to a first embodiment of the present invention.
  • Fig. 5 is a schematic diagram showing the functional blocks of the image forming apparatus of the first embodiment of the present invention.
  • FIG. 6 is a schematic diagram of functional blocks of an electronic device according to a first embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a physical object of the electronic device of FIG. 6.
  • FIG. 7 is a schematic diagram of a physical object of the electronic device of FIG. 6.
  • Figure 8 is a schematic view showing the operation of the electronic device of the present invention.
  • FIG. 9 is a flow chart showing an image processing method according to a second embodiment of the present invention.
  • Fig. 10 is a functional block diagram of an image processing apparatus according to a second embodiment of the present invention.
  • Figure 11 is a histogram of a focused image of the present invention.
  • Fig. 12 is a flow chart showing the control method of the second embodiment of the present invention.
  • Fig. 13 is a schematic diagram showing the functional blocks of the control device according to the second embodiment of the present invention.
  • Fig. 14 is a schematic diagram showing the functional blocks of an image forming apparatus according to a second embodiment of the present invention.
  • 15 is a schematic diagram of functional blocks of an electronic device according to a second embodiment of the present invention.
  • Fig. 16 is a flow chart showing an image processing method according to a third embodiment of the present invention.
  • Figure 17 is a diagram showing the functional blocks of an image processing apparatus according to a third embodiment of the present invention.
  • Fig. 18 is a flow chart showing the control method of the third embodiment of the present invention.
  • Fig. 19 is a schematic diagram showing the functional blocks of the control device according to the third embodiment of the present invention.
  • FIG. 20 is a schematic diagram of functional blocks of an image forming apparatus according to a third embodiment of the present invention.
  • 21 is a schematic diagram of functional blocks of an electronic device according to a third embodiment of the present invention.
  • Fig. 22 is a flow chart showing an image processing method according to a fourth embodiment of the present invention.
  • Figure 23 is a diagram showing the functional blocks of an image processing apparatus according to a fourth embodiment of the present invention.
  • Fig. 24 is a flow chart showing the control method of the fourth embodiment of the present invention.
  • Figure 25 is a diagram showing the functional blocks of a control device according to a fourth embodiment of the present invention.
  • Fig. 26 is a schematic diagram showing the functional blocks of an image forming apparatus according to a fourth embodiment of the present invention.
  • Figure 27 is a diagram showing the functional blocks of an electronic device according to a fourth embodiment of the present invention.
  • FIG. 28 is a flow diagram of controlling an imaging device to output a focused image and a virtual focus image of the same scene, in accordance with some embodiments of the present invention.
  • 29 is a functional block diagram of a control module of some embodiments of the present invention.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include one or more of the described features either explicitly or implicitly.
  • the meaning of "a plurality" is two or more unless specifically and specifically defined otherwise.
  • connection In the description of the present invention, it should be noted that the terms “installation”, “connected”, and “connected” are to be understood broadly, and may be fixed or detachable, for example, unless otherwise explicitly defined and defined. Connected, or connected in one piece; Therefore, they may be mechanically connected, or may be electrically connected or may communicate with each other; they may be directly connected or indirectly connected through an intermediate medium, and may be internal communication of two elements or an interaction relationship of two elements.
  • the specific meanings of the above terms in the present invention can be understood on a case-by-case basis.
  • the present invention provides an image processing method according to a plurality of embodiments, a control method of a plurality of embodiments, an image processing apparatus according to a plurality of embodiments, a control apparatus of a plurality of embodiments, an imaging apparatus of a plurality of embodiments, and a plurality of embodiments Electronic device.
  • the image processing methods of the plurality of embodiments are sequentially numbered
  • the control methods of the plurality of embodiments are sequentially numbered
  • the image processing apparatuses of the plurality of embodiments are sequentially numbered
  • the control apparatuses of the plurality of embodiments are described.
  • the sequential numbering will be described, the imaging devices of the plurality of embodiments will be sequentially numbered, and the electronic devices of the plurality of embodiments will be sequentially numbered.
  • the image processing method of each embodiment may correspond to a control method of one embodiment, an image processing device corresponding to one embodiment, a control device corresponding to one embodiment, an imaging device corresponding to one embodiment, and a corresponding embodiment.
  • Electronic device for example, the image processing method of the first embodiment may correspond to the control method of the first embodiment, the image processing device that can correspond to the first embodiment, the control device that can correspond to the first embodiment, and the imaging device that can correspond to the first embodiment.
  • the image processing method according to the second embodiment can correspond to the control method of the second embodiment, the image processing device according to the second embodiment, and the control device according to the second embodiment.
  • the imaging device according to the first embodiment and the electronic device according to the second embodiment can be used.
  • an image processing method includes the following steps:
  • the step of blurring the in-focus image to obtain the blurred focus image may be implemented by using a Gaussian blur algorithm.
  • the focus image is in panoramic deep focus.
  • the degree of blurring of the material part is basically the same as the degree of blurring of the blur exposed portion.
  • the image processing method of the first embodiment described above can be realized by the image processing apparatus 111 of the first embodiment of the present invention.
  • the image processing apparatus 111 of the first embodiment of the present invention includes an identification module 1111, a blurring module 1112, a processing module 1113, and a merging module 1114, which can be used to execute S1 to S4, respectively. That is, the identification module 1111 is configured to recognize whether there is an overexposed portion in the in-focus state in the in-focus image.
  • the blurring module 1112 is configured to blur the in-focus image to obtain a blurred focus image.
  • the processing module 1113 is configured to process the same virtual focus image as the focused image scene when there is an overexposed portion to obtain a material portion corresponding to the overexposed portion.
  • the merging module 1114 is configured to replace the imaginary overexposed portion corresponding to the overexposed portion in the blurred focus image with the material portion to obtain a merged image.
  • the blurring module 1112 uses a Gaussian blur algorithm to blur the in-focus image to obtain a blurred focus image.
  • the focus image is in panoramic deep focus.
  • the degree of blurring of the material part is basically the same as the degree of blurring of the blur exposed portion.
  • control method of the first embodiment of the present invention is used to control the imaging device 10.
  • the control method includes the following steps:
  • the step of blurring the in-focus image to obtain the blurred focus image may be implemented by using a Gaussian blur algorithm.
  • the focus image is in panoramic deep focus.
  • the degree of blurring of the material part is basically the same as the degree of blurring of the blur exposed portion.
  • the control method of the above-described first embodiment can be realized by the control device 11 of the first embodiment of the present invention.
  • the control device 11 includes the image processing device 111 in the first embodiment and a control module 112 electrically connected to the image processing device 111.
  • the image processing device 111 is configured to perform steps S1 to S4, and the control module 112 is configured to perform step S6.
  • the structure of the image processing apparatus 111 is as described in the first embodiment, and will not be described herein.
  • the control module 112 is for controlling the imaging device 10 (shown in FIGS. 5-7) to output a focused image and a virtual focus image of the same scene.
  • an image forming apparatus 10 includes a control device 11 of the first embodiment and a camera 12 electrically connected to the control device 11 of the first embodiment.
  • the imaging device 10 of the present embodiment includes the image processing device 111 of the first embodiment, the control module 112, and the camera 12.
  • Control module 112 is electrically connected to both the camera 12 and the image processing device 111.
  • an electronic device 100 includes the imaging device 10 of the first embodiment.
  • the electronic device 100 may be any one of a mobile phone, a tablet computer, a notebook computer, a smart watch, a smart wristband, a smart helmet, smart glasses, other virtual reality wearable devices, and other augmented reality wearable devices.
  • the imaging device 10 may be a front camera or a rear camera.
  • the two imaging devices 10 may be a front camera and a rear camera, respectively; or both imaging devices 10 are front cameras; or both imaging devices 10 are rear cameras .
  • the imaging device 10 may be a camera disposed at any position, and may be a top camera, a bottom camera, a side wall camera, or the like in addition to the front camera and the rear camera.
  • the camera 12 captures a focused image (shown in the upper left panel of FIG. 8) and a virtual focus image (shown in the upper right panel of FIG. 8) for the same scene.
  • the in-focus image is in the panoramic focus state.
  • the virtual focus image is processed to obtain a material portion (long strip light tube) corresponding to the overexposed portion.
  • the blurred overexposed portion corresponding to the overexposed portion in the blurred focus image is replaced with the material portion to obtain a merged image (shown in the lower right panel of FIG. 8).
  • the image processing method, the image processing device 111, the control method, the control device 11, the imaging device 10, and the electronic device 100 in the first embodiment of the present invention take two images, one focused image, one virtual focus image, and the virtual image is taken out.
  • the material part corresponding to the overexposed part in the focus image in the focus image is combined into the blurred focus image to synthesize a combined image with a real spot effect, and the spot effect is good.
  • the image processing method of the second embodiment of the present invention is substantially the same as the image processing method of the first embodiment. Further, the step of identifying whether there is an overexposed portion in the in-focus state in the focused image includes the following steps. :
  • S11 Determine, according to a histogram of the in-focus image, whether the overexposed pixel in the in-focus image is greater than or equal to a first predetermined number, and the pixel value of the overexposed pixel is greater than or equal to a predetermined pixel value, where the predetermined pixel value is an upper limit of a range of pixel values of the in-focus image. , for example, a predetermined pixel value of 255;
  • the image processing method of the second embodiment described above can be realized by the image processing apparatus 111 of the second embodiment of the present invention.
  • the image processing device 111 of the second embodiment of the present invention has substantially the same structure as the image processing device 111 of the first embodiment, except that the identification module 1111 of the image processing device 111 of the second embodiment includes the first determination sub-module 11111.
  • the first determining sub-module 11112 can be used to perform steps S11 and S12, respectively. That is, the first judging sub-module 11111 is configured to judge according to the histogram of the in-focus image.
  • the pixel value of the overexposed pixel is greater than or equal to a predetermined pixel value
  • the predetermined pixel value is an upper limit of a range of pixel values of the in-focus image, for example, a predetermined pixel value is 255.
  • the first determining sub-module 11112 is configured to determine that there is an overexposed portion when the overexposed pixel is more than or equal to the first predetermined number.
  • the horizontal axis of the histogram of the in-focus image represents the increment of the pixel value (gray value) from left to right, and the pixel of the pixel value (gray value) from the bottom to the top of the vertical axis.
  • the number is increasing.
  • the pixel value (gray value) ranges from 0 to 255, that is, from black to white, and the higher the peak at a certain point, the more pixels are indicated at the pixel value (gray value).
  • the first predetermined number should be the number of pixels in the histogram near the right border, that is, the number of overexposed pixels, and the first predetermined number can be set to be one third of the total pixels. It should be noted that one third is only It is a schematic illustration and is not a limitation of the invention.
  • control method of the second embodiment of the present invention is substantially the same as the control method of the first embodiment.
  • step of identifying whether there is an overexposed portion in the in-focus state in the focused image includes the following steps:
  • S11 Determine, according to a histogram of the in-focus image, whether the overexposed pixel in the in-focus image is greater than or equal to a first predetermined number, and the pixel value of the overexposed pixel is greater than or equal to a predetermined pixel value, where the predetermined pixel value is an upper limit of a range of pixel values of the in-focus image. , for example, a predetermined pixel value of 255;
  • control method of the second embodiment described above can be realized by the control device 11 of the second embodiment of the present invention.
  • the control device 11 of the second embodiment of the present invention has substantially the same structure as the control device 11 of the first embodiment, except that the identification module 1111 of the control device 11 of the second embodiment includes a first determination sub-module 11111 and a first The determining sub-module 11112 can be used to perform steps S11 and S12, respectively.
  • the first determining sub-module 11111 is configured to determine, according to the histogram of the focused image, whether the overexposed pixel in the focused image is more than or equal to a first predetermined number, and the pixel value of the overexposed pixel is greater than or equal to a predetermined pixel value, the predetermined pixel
  • the value is the upper limit of the range of pixel values of the in-focus image, for example, the predetermined pixel value is 255.
  • the first determining sub-module 11112 is configured to determine that there is an overexposed portion when the overexposed pixel is more than or equal to the first predetermined number.
  • the horizontal axis of the histogram of the in-focus image represents the increment of the pixel value (gradation value) from left to right
  • the vertical axis represents the pixel at a certain pixel value (gray value) from bottom to top.
  • the number is increasing.
  • the pixel value (gray value) ranges from 0 to 255, that is, from black to white, and the higher the peak at a certain point, the more pixels are indicated at the pixel value (gray value).
  • the first predetermined number should be the number of pixels in the histogram near the right border, that is, the number of overexposed pixels, and the first predetermined number can be set to be one third of the total pixels. It should be noted that one third is only It is a schematic illustration and is not a limitation of the invention.
  • an image forming apparatus 10 includes a control device 11 of the second embodiment and a camera 12 electrically connected to the control device 11 of the second embodiment.
  • the imaging device 10 of the present embodiment includes the image processing device 111, the control module 112, and the camera 12 of the second embodiment.
  • the control module 112 is electrically connected to both the camera 12 and the image processing device 111.
  • an electronic device 100 includes the imaging device 10 of the second embodiment.
  • the electronic device 100 may be any one of a mobile phone, a tablet computer, a notebook computer, a smart watch, a smart wristband, a smart helmet, smart glasses, other virtual reality wearable devices, and other augmented reality wearable devices.
  • the imaging device 10 may be a front camera or a rear camera.
  • the two imaging devices 10 may be a front camera and a rear camera, respectively; or both imaging devices 10 are front cameras; or both imaging devices 10 are rear cameras .
  • the imaging device 10 may be a camera disposed at any position, and may be a top camera, a bottom camera, a side wall camera, or the like in addition to the front camera and the rear camera.
  • the image processing method, the image processing device 111, the control method, the control device 11, the imaging device 10, and the electronic device 100 in the second embodiment of the present invention take two images, one focused image, one virtual focus image, and the virtual image is taken out.
  • the material part corresponding to the overexposed part in the focus image in the focus image is combined into the blurred focus image to synthesize a combined image with a real spot effect, and the spot effect is good.
  • the image processing method according to the third embodiment of the present invention is substantially the same as the image processing method of the first embodiment. Further, the step of identifying whether there is an overexposed portion in the in-focus state in the focused image includes the following steps. :
  • S11 Determine, according to a histogram of the in-focus image, whether the overexposed pixel in the in-focus image is greater than or equal to a first predetermined number, and the pixel value of the overexposed pixel is greater than or equal to a predetermined pixel value, where the predetermined pixel value is an upper limit of a range of pixel values of the in-focus image. , for example, the predetermined pixel value is 255;
  • the image processing method of the third embodiment described above can be realized by the image processing apparatus 111 of the third embodiment of the present invention.
  • the image processing device 111 of the third embodiment of the present invention has substantially the same structure as the image processing device 111 of the first embodiment, except that the recognition module 1111 of the image processing device 111 of the third embodiment includes the first determination sub-module 11111.
  • the first determining sub-module 11112, the second determining sub-module 11113, and the second determining sub-module 11114 are respectively configured to perform steps S11, S12, S13, and S14.
  • the first determining sub-module 11111 is configured to determine, according to the histogram of the focused image, that the overexposed pixel in the focused image is No more than or equal to the first predetermined number, the pixel value of the overexposed pixel is greater than or equal to a predetermined pixel value, and the predetermined pixel value is an upper limit of a range of pixel values of the in-focus image, for example, the predetermined pixel value is 255.
  • the first determining sub-module 11112 is configured to determine that there is an overexposed portion when the overexposed pixel is more than or equal to the first predetermined number.
  • the second judging sub-module 11113 is configured to determine whether there is an adjacent over-exposed pixel in the in-focus image when there is an over-exposed portion, and the number of adjacent over-exposed pixels is greater than or equal to a second predetermined number.
  • the second determining sub-module 11114 is configured to determine that the adjacent over-exposed pixels belong to the over-exposed portion when there is an adjacent over-exposed pixel.
  • the second predetermined number should be smaller than the first predetermined number, because the first predetermined number may include noise, and even the in-focus image may include a plurality of adjacent overexposed pixels, for example, there are a plurality of discrete light sources, and the light sources are combined Overexposed part.
  • the horizontal axis of the histogram of the in-focus image represents the increment of the pixel value (gradation value) from left to right
  • the vertical axis represents the pixel at a certain pixel value (gray value) from bottom to top.
  • the number is increasing.
  • the pixel value (gray value) ranges from 0 to 255, that is, from black to white, and the higher the peak at a certain point, the more pixels are indicated at the pixel value (gray value).
  • the first predetermined number and the second predetermined number should be the number of pixels in the histogram near the right boundary, that is, the number of overexposed pixels, and the first predetermined number may be set to be one third of the total pixels, and the second predetermined number may be It is set to account for a quarter of the total pixels. It should be noted that one-third and one-quarter are only illustrative and are not intended to limit the invention.
  • control method of the third embodiment of the present invention is substantially the same as the control method of the first embodiment.
  • step of identifying whether there is an overexposed portion in the in-focus state in the focused image includes the following steps:
  • S11 Determine, according to a histogram of the in-focus image, whether the overexposed pixel in the in-focus image is greater than or equal to a first predetermined number, and the pixel value of the overexposed pixel is greater than or equal to a predetermined pixel value, where the predetermined pixel value is an upper limit of a range of pixel values of the in-focus image. , for example, the predetermined pixel value is 255;
  • control device 11 of the third embodiment of the present invention has substantially the same structure as the control device 11 of the first embodiment, except that the identification module 1111 of the control device 11 of the third embodiment includes a first determination sub-module 11111, and a first The determining sub-module 11112, the second determining sub-module 11113, and the second determining sub-module 11114 are respectively configured to perform steps S11, S12, S13, and S14.
  • the first judgment sub-module 11111 And a method for determining whether the overexposed pixel in the in-focus image is greater than or equal to a first predetermined number according to a histogram of the in-focus image, wherein the pixel value of the overexposed pixel is greater than or equal to a predetermined pixel value, and the predetermined pixel value is an upper limit of a pixel value range of the in-focus image.
  • the predetermined pixel value is 255.
  • the first determining sub-module 11112 is configured to determine that there is an overexposed portion when the overexposed pixel is more than or equal to the first predetermined number.
  • the second judging sub-module 11113 is configured to determine whether there is an adjacent over-exposed pixel in the in-focus image when there is an over-exposed portion, and the number of adjacent over-exposed pixels is greater than or equal to a second predetermined number.
  • the second determining sub-module 11114 is configured to determine that the adjacent over-exposed pixels belong to the over-exposed portion when there is an adjacent over-exposed pixel.
  • the second predetermined number should be smaller than the first predetermined number, because the first predetermined number may include noise, and even the in-focus image may include a plurality of adjacent overexposed pixels, for example, there are a plurality of discrete light sources, and the light sources are combined Overexposed part.
  • the horizontal axis of the histogram of the in-focus image represents the increment of the pixel value (gradation value) from left to right
  • the vertical axis represents the pixel at a certain pixel value (gray value) from bottom to top.
  • the number is increasing.
  • the pixel value (gray value) ranges from 0 to 255, that is, from black to white, and the higher the peak at a certain point, the more pixels are indicated at the pixel value (gray value).
  • the first predetermined number and the second predetermined number should be the number of pixels in the histogram near the right boundary, that is, the number of overexposed pixels, and the first predetermined number may be set to be one third of the total pixels, and the second predetermined number may be It is set to account for a quarter of the total pixels. It should be noted that one-third and one-quarter are only illustrative and are not intended to limit the invention.
  • an electronic device 100 includes the imaging device 10 of the third embodiment.
  • the electronic device 100 may be any one of a mobile phone, a tablet computer, a notebook computer, a smart watch, a smart wristband, a smart helmet, smart glasses, other virtual reality wearable devices, and other augmented reality wearable devices.
  • the imaging device 10 may be a front camera or a rear camera.
  • the two imaging devices 10 may be a front camera and a rear camera, respectively; or both imaging devices 10 are front cameras; or both imaging devices 10 are rear cameras .
  • the imaging device 10 may be a camera disposed at any position, and may be a top camera, a bottom camera, a side wall camera, or the like in addition to the front camera and the rear camera.
  • the image processing method, the image processing device 111, the control method, the control device 11, the imaging device 10, and the electronic device 100 in the third embodiment of the present invention capture two images, one focused image, and one virtual focus image.
  • the material part corresponding to the overexposed part of the in-focus image in the virtual focus image is taken out, and is merged into the blurred focus image to synthesize a combined image with a real spot effect, and the spot effect is good.
  • the image processing method of the fourth embodiment of the present invention is substantially the same as the image processing method of the first embodiment. Further, the image processing method of the fourth embodiment further includes the following steps:
  • the image processing method of the fourth embodiment described above can be realized by the image processing apparatus 111 of the fourth embodiment of the present invention.
  • the image processing device 111 of the fourth embodiment of the present invention has substantially the same structure as the image processing device 111 of the first embodiment, except that the image processing device 111 of the fourth embodiment further includes a first output module 1117 and a second output.
  • Module 1118 can be used to perform steps S7 and S8, respectively. That is, the first output module 1117 is configured to output a merged image when there is an overexposed portion.
  • the second output module 1118 is configured to output a blurred focus image when there is no overexposed portion.
  • control method of the fourth embodiment of the present invention is substantially the same as the control method of the first embodiment.
  • the control method of the fourth embodiment further includes the following steps:
  • the control device 11 of the fourth embodiment of the present invention has basically the same configuration as the control device 11 of the first embodiment, except that the image processing device 111 of the control device 11 of the fourth embodiment further includes a first output module 1117 and a The two output modules 1118 can be used to perform steps S7 and S8, respectively. That is, the first output module 1117 is configured to output a merged image when there is an overexposed portion. The second output module 1118 is configured to output a blurred focus image when there is no overexposed portion.
  • an image forming apparatus 10 includes a control device 11 of a fourth embodiment and a camera 12 electrically connected to the control device 11 of the fourth embodiment.
  • the imaging device 10 of the present embodiment includes the image processing device 111, the control module 112, and the camera 12 of the fourth embodiment.
  • the control module 112 is electrically connected to both the camera 12 and the image processing device 111.
  • an electronic device 100 includes the imaging device 10 of the fourth embodiment.
  • the electronic device 100 may be any one of a mobile phone, a tablet computer, a notebook computer, a smart watch, a smart wristband, a smart helmet, smart glasses, other virtual reality wearable devices, and other augmented reality wearable devices.
  • the imaging device 10 may be a front camera or a rear camera.
  • the two imaging devices 10 may be a front camera and a rear camera, respectively; or both imaging devices 10 are front cameras; or both imaging devices 10 are rear cameras .
  • the imaging device 10 may be a camera disposed at any position, and may be a top camera, a bottom camera, a side wall camera, or the like in addition to the front camera and the rear camera.
  • the image processing method, the image processing device 111, the control method, the control device 11, the imaging device 10, and the electronic device 100 in the fourth embodiment of the present invention take two images, one focused image, one virtual focus image, and the virtual image is taken out.
  • the material part corresponding to the overexposed part in the focus image in the focus image is combined into the blurred focus image to synthesize a combined image with a real spot effect, and the spot effect is good.
  • steps S7 and S8 can also be applied to the image processing method of the second embodiment and the control method of the second embodiment.
  • the first output module 1117 and the second output module 1118 can also be applied to the second embodiment.
  • Steps S7 and S8 can also be applied to the image processing method of the third embodiment and the control method of the third embodiment.
  • the first output module 1117 and the second output module 1118 can also be applied to the image processing of the third embodiment.
  • step S6 may include the following steps:
  • the control module 112 in the control device 11 of the first to fourth embodiments includes a focus sub-module 1121, a focus sub-module 1122, and a save sub-module 1123, which can be used to perform step S61, respectively.
  • S62 and S63 the focusing sub-module 1121 is for controlling the imaging device to focus to obtain a focused image.
  • the focus sub-module 1122 is used to refocus and process the cached image output by the imaging device in different focus states to obtain a corresponding degree of blur.
  • the saving sub-module 1123 is configured to store a cache image having substantially the same degree of blur as the blurred focus image as a virtual focus image.
  • the imaging device 10 of the first to fourth embodiments and the control module 112 of the electronic device 100 may also include a focusing sub-module 1121, a focusing sub-module 1122, and a saving sub-module 1123.
  • the specific structure and function are the same as before. It will not be expanded in detail here.
  • Certain embodiments of the present invention also provide an electronic device including a housing, a processor, a memory, a circuit board, and a power supply circuit.
  • the circuit board is disposed inside a space enclosed by the casing, and the processor and the memory are disposed on the circuit board.
  • the power circuit for powering various circuits or devices of the electronic device; the memory for storing executable program code; the processor reading the memory by reading
  • the stored executable program code runs a program corresponding to the executable program code for executing the image processing method of any of the above embodiments or the control method of any of the above embodiments.
  • the electronic device may be any one of a mobile phone, a tablet computer, a notebook computer, a smart watch, a smart bracelet, a smart helmet, and smart glasses.
  • a "computer-readable medium” can be any apparatus that can contain, store, communicate, propagate, or transport a program for use in an instruction execution system, apparatus, or device, or in conjunction with the instruction execution system, apparatus, or device.
  • computer readable media include the following: electrical connections (electronic devices) having one or more wires, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read only memory (ROM), erasable editable read only memory (EPROM or flash memory), fiber optic devices, and portable compact disk read only memory (CDROM).
  • the computer readable medium may even be a paper or other suitable medium on which the program can be printed, as it may be optically scanned, for example by paper or other medium, followed by editing, interpretation or, if appropriate, other suitable The method is processed to obtain the program electronically and then stored in computer memory.
  • each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

本发明公开了一种图像处理方法,包括:(S1)识别对焦图像中是否存在处于对焦状态的过曝部分;(S2)虚化对焦图像以得到虚化对焦图像;(S3)在存在过曝部分时,处理与对焦图像场景相同的虚焦图像以得到与过曝部分对应的素材部分;(S4)将虚化对焦图像中与过曝部分对应的虚化过曝部分替换为素材部分以得到合并图像。本发明还公开了一种图像处理装置(111)、控制方法、控制装置(11)、成像装置(10)和电子装置(100)。

Description

图像处理方法与装置、控制方法与装置、成像与电子装置 技术领域
本发明涉及图像处理技术,特别涉及一种图像处理方法、一种控制方法、一种图像处理装置、一种控制装置、一种成像装置和一种电子装置。
背景技术
现有的虚化算法,比如人像照片的背景虚化,其软件虚化算法一般使用模糊算法,模糊算法是一种平均算法,在虚化照片中的光源时,会将光源的像素亮度值平均化,使照片中的光源显得暗淡,效果不好。
发明内容
本发明的实施方式旨在至少解决现有技术中存在的技术问题之一。为此,本发明的实施方式需要提供一种图像处理方法、一种控制方法、一种图像处理装置、一种控制装置、一种成像装置和一种电子装置。
本发明提供一种图像处理方法,所述图像处理方法包括以下步骤:
识别对焦图像中是否存在处于对焦状态的过曝部分;
虚化所述对焦图像以得到虚化对焦图像;
在存在所述过曝部分时,处理与所述对焦图像场景相同的虚焦图像以得到与所述过曝部分对应的素材部分;和
将所述虚化对焦图像中与所述过曝部分对应的虚化过曝部分替换为所述素材部分以得到合并图像。
在某些实施方式中,所述对焦图像处于全景深对焦状态。
在某些实施方式中,所述识别对焦图像中是否存在处于对焦状态的过曝部分的步骤包括:
根据所述对焦图像的直方图判断所述对焦图像中过曝像素是否多于或等于第一预定数目,所述过曝像素的像素值大于或等于预定像素值;和
在所述过曝像素多于或等于第一预定数目时确定存在所述过曝部分。
在某些实施方式中,所述识别对焦图像中是否存在处于对焦状态的过曝部分的步骤包括:
在存在所述过曝部分时,判断所述对焦图像中是否存在相邻接的过曝像素,所述相邻接的过曝像素的数目多于或等于第二预定数目;和
在存在所述相邻接的过曝像素时,确定所述相邻接的过曝像素属于所述过曝部分。
在某些实施方式中,所述预定像素值为所述适曝图像的像素值范围的上限。
在某些实施方式中,所述虚化所述对焦图像以得到虚化对焦图像的步骤是采用高斯模糊算法实现的。
在某些实施方式中,所述素材部分的虚化程度与所述虚化过曝部分的虚化程度基本相同。
在某些实施方式中,所述图像处理方法包括:
在存在所述过曝部分时,输出所述合并图像;和
在不存在所述过曝部分时,输出所述虚化对焦图像。
本发明提供一种控制方法,用于控制成像装置,所述控制方法包括以下步骤:
控制所述成像装置输出相同场景的对焦图像和虚焦图像;和
采用如上任意一实施方式所述的图像处理方法处理所述对焦图像和所述虚焦图像。
在某些实施方式中,所述控制所述成像装置输出相同场景的对焦图像和虚焦图像的步骤包括以下步骤:
控制所述成像装置对焦以得到所述对焦图像;
重新调焦并处理不同调焦状态下所述成像装置输出的缓存图像以得到对应的虚化程度;和
保存虚化程度与所述虚化对焦图像基本相同的所述缓存图像作为所述虚焦图像。
本发明提供一种图像处理装置,所述图像处理装置包括以下步骤:
识别模块,用于识别对焦图像中是否存在处于对焦状态的过曝部分;
虚化模块,用于虚化所述对焦图像以得到虚化对焦图像;
处理模块,用于在存在所述过曝部分时,处理与所述对焦图像场景相同的虚焦图像以得到与所述过曝部分对应的素材部分;和
合并模块,用于将所述虚化对焦图像中与所述过曝部分对应的虚化过曝部分替换为所述素材部分以得到合并图像。
在某些实施方式中,所述对焦图像处于全景深对焦状态。
在某些实施方式中,所述识别模块包括:
第一判断子模块,用于根据所述对焦图像的直方图判断所述对焦图像中过曝像素是否多于或等于第一预定数目,所述过曝像素的像素值大于或等于预定像素值;和
第一确定子模块,用于在所述过曝像素多于或等于第一预定数目时确定存在所述过曝部分。
在某些实施方式中,所述识别模块还包括:
第二判断子模块,用于在存在所述过曝部分时,判断所述对焦图像中是否存在相邻接的过曝像素,所述相邻接的过曝像素的数目多于或等于第二预定数目;和
第二确定子模块,用于在存在所述相邻接的过曝像素时,确定所述相邻接的过曝像素属于所述过曝部分。
在某些实施方式中,所述预定像素值为所述适曝图像的像素值范围的上限。
在某些实施方式中,所述虚化模块用于是采用高斯模糊算法来虚化对焦图像以得到虚化对焦图像。
在某些实施方式中,所述素材部分的虚化程度与所述虚化过曝部分的虚化程度基本相同。
在某些实施方式中,所述图像处理装置包括:
第一输出模块,用于在存在所述过曝部分时,输出所述合并图像;和
第二输出模块,用于在不存在所述过曝部分时,输出所述虚化对焦图像。
本发明提供一种控制装置,用于控制成像装置,所述控制装置包括:
控制模块,用于控制所述成像装置输出相同场景的对焦图像和虚焦图像;和
如上任意一实施方式所述并与所述控制模块电连接的图像处理装置。
在某些实施方式中,所述控制模块包括:
对焦子模块,用于控制所述成像装置对焦以得到所述对焦图像;
调焦子模块,用于重新调焦并处理不同调焦状态下所述成像装置输出的缓存图像以得到对应的虚化程度;和
保存子模块,用于保存虚化程度与所述虚化对焦图像基本相同的所述缓存图像作为所述虚焦图像。
本发明提供一种成像装置,所述成像装置包括:
摄像头;
与所述摄像头电连接的控制模块,用于控制所述摄像头输出相同场景的对焦图像和虚焦图像;和
如上任意一实施方式所述并与所述控制模块电连接的图像处理装置。
在某些实施方式中,所述控制模块包括:
对焦子模块,用于控制所述成像装置对焦以得到所述对焦图像;
调焦子模块,用于重新调焦并处理不同调焦状态下所述成像装置输出的缓存图像以得到对应的虚化程度;和
保存子模块,用于保存虚化程度与所述虚化对焦图像基本相同的所述缓存图像作为所述虚焦图像。
本发明提供一种电子装置,所述电子装置包括如上任意一实施方式所述的成像装置。
在某些实施方式中,所述电子装置包括手机、平板电脑、笔记本电脑、智能手表、智能手环、智能头盔、智能眼镜中的任意一种。
在某些实施方式中,所述成像装置包括前置相机或/和后置相机。
本发明提供一种电子装置,该电子装置包括壳体、处理器、存储器、电路板和电源电路。所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上。所述电源电路,用于为所述电子装置的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行上述任一实施方式所述的图像处理方法或执行上述任一实施方式所述的控制方法。
本发明提供一种计算机可读存储介质,具有存储于其中的指令,当电子装置的处理器执行所述指令时,所述电子装置执行如上任意一实施方式所述的图像处理方法或执行上述任一实施方式所述的控制方法。
本发明提供的图像处理方法、图像处理装置、控制方法、控制装置、成像装置及电子装置通过拍摄两张图像,一张对焦图像,一张虚焦图像,取出虚焦图像中与对焦图像中过曝部分对应的素材部分,合入虚化后的对焦图像中,合成一张带有真实光斑效果的合并图像,光斑效果好。
本发明的实施方式的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实施方式的实践了解到。
附图说明
本发明的上述和/或附加的方面和优点从结合下面附图对实施方式的描述中将变得明显和容易理解,其中:
图1是本发明第一实施方式的图像处理方法的流程示意图。
图2是本发明第一实施方式的图像处理装置的功能模块示意图。
图3是本发明第一实施方式的控制方法的流程示意图。
图4是本发明第一实施方式的控制装置的功能模块示意图。
图5是本发明第一实施方式的成像装置的功能模块示意图。
图6是本发明第一实施方式的电子装置的功能模块示意图。
图7是图6中电子装置的实物示意图。
图8是本发明电子装置的工作示意图。
图9是本发明第二实施方式的图像处理方法的流程示意图。
图10是本发明第二实施方式的图像处理装置的功能模块示意图。
图11是本发明对焦图像的直方图。
图12是本发明第二实施方式的控制方法的流程示意图。
图13是本发明第二实施方式的控制装置的功能模块示意图。
图14是本发明第二实施方式的成像装置的功能模块示意图。
图15是本发明第二实施方式的电子装置的功能模块示意图。
图16是本发明第三实施方式的图像处理方法的流程示意图。
图17是本发明第三实施方式的图像处理装置的功能模块示意图。
图18是本发明第三实施方式的控制方法的流程示意图。
图19是本发明第三实施方式的控制装置的功能模块示意图。
图20是本发明第三实施方式的成像装置的功能模块示意图。
图21是本发明第三实施方式的电子装置的功能模块示意图。
图22是本发明第四实施方式的图像处理方法的流程示意图。
图23是本发明第四实施方式的图像处理装置的功能模块示意图。
图24是本发明第四实施方式的控制方法的流程示意图。
图25是本发明第四实施方式的控制装置的功能模块示意图。
图26是本发明第四实施方式的成像装置的功能模块示意图。
图27是本发明第四实施方式的电子装置的功能模块示意图。
图28是本发明某些实施方式控制成像装置输出相同场景的对焦图像和虚焦图像的流程示意图。
图29是本发明某些实施方式的控制模块的功能模块示意图。
具体实施方式
下面详细描述本发明的实施方式,所述实施方式的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施方式是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。
在本发明的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个所述特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可 以是机械连接,也可以是电连接或可以相互通信;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。
下文的公开提供了许多不同的实施方式或例子用来实现本发明的不同结构。为了简化本发明的公开,下文中对特定例子的部件和设置进行描述。当然,它们仅仅为示例,并且目的不在于限制本发明。此外,本发明可以在不同例子中重复参考数字和/或参考字母,这种重复是为了简化和清楚的目的,其本身不指示所讨论各种实施方式和/或设置之间的关系。此外,本发明提供了的各种特定的工艺和材料的例子,但是本领域普通技术人员可以意识到其他工艺的应用和/或其他材料的使用。
本发明提供多个实施方式的图像处理方法、多个实施方式的控制方法、多个实施方式的图像处理装置、多个实施方式的控制装置、多个实施方式的成像装置、和多个实施方式的电子装置。下面将多个实施方式的图像处理方法顺序编号来说明、将多个实施方式的控制方法顺序编号来说明、将多个实施方式的图像处理装置顺序编号来说明、将多个实施方式的控制装置顺序编号来说明、将多个实施方式的成像装置顺序编号来说明、及将多个实施方式的电子装置顺序编号来说明。其中,每个实施方式的图像处理方法可对应一个实施方式的控制方法、对应一个实施方式的图像处理装置、对应一个实施方式的控制装置、对应一个实施方式的成像装置、及对应一个实施方式的电子装置。例如,第一实施方式的图像处理方法可对应第一实施方式的控制方法、可对应第一实施方式的图像处理装置、可对应第一实施方式的控制装置、可对应第一实施方式的成像装置、及可对应第一实施方式的电子装置;第二实施方式的图像处理方法可对应第二实施方式的控制方法、可对应第二实施方式的图像处理装置、可对应第二实施方式的控制装置、可对应第一实施方式的成像装置、及可对应第二实施方式的电子装置。
请参阅图1,本发明第一实施方式的图像处理方法包括以下步骤:
S1,识别对焦图像中是否存在处于对焦状态的过曝部分;
S2,虚化对焦图像以得到虚化对焦图像;
S3,在存在过曝部分时,处理与对焦图像场景相同的虚焦图像以得到与过曝部分对应的素材部分;和
S4,将虚化对焦图像中与过曝部分对应的虚化过曝部分替换为素材部分以得到合并图像。
其中,虚化对焦图像以得到虚化对焦图像的步骤可以是采用高斯模糊算法实现的。对焦图像处于全景深对焦状态。素材部分的虚化程度与虚化过曝部分的虚化程度基本相同。
请参阅图2,上述第一实施方式的图像处理方法可以由本发明第一实施方式的图像处理装置111实现。具体地,本发明第一实施方式的图像处理装置111包括识别模块1111、虚化模块1112、处理模块1113及合并模块1114,可分别用于执行S1至S4。也就是说,识别模块1111用于识别对焦图像中是否存在处于对焦状态的过曝部分。虚化模块1112用于虚化对焦图像以得到虚化对焦图像。处理模块1113用于在存在过曝部分时,处理与对焦图像场景相同的虚焦图像以得到与过曝部分对应的素材部分。合并模块1114用于将虚化对焦图像中与过曝部分对应的虚化过曝部分替换为素材部分以得到合并图像。
其中,虚化模块1112是采用高斯模糊算法来虚化对焦图像以得到虚化对焦图像。对焦图像处于全景深对焦状态。素材部分的虚化程度与虚化过曝部分的虚化程度基本相同。
请参阅图3及图5-7,本发明第一实施方式的控制方法,用于控制成像装置10,所述控制方法包括以下步骤:
S6,控制成像装置10输出相同场景的对焦图像和虚焦图像;
S1,识别对焦图像中是否存在处于对焦状态的过曝部分;
S2,虚化对焦图像以得到虚化对焦图像;
S3,在存在过曝部分时,处理与对焦图像场景相同的虚焦图像以得到与过曝部分对应的素材部分;和
S4,将虚化对焦图像中与过曝部分对应的虚化过曝部分替换为素材部分以得到合并图像。
其中,虚化对焦图像以得到虚化对焦图像的步骤可以是采用高斯模糊算法实现的。对焦图像处于全景深对焦状态。素材部分的虚化程度与虚化过曝部分的虚化程度基本相同。
请参阅图4,上述第一实施方式的控制方法可以由本发明第一实施方式的控制装置11实现。具体地,在本发明第一实施方式的控制装置11中,控制装置11包括第一实施方式中的图像处理装置111及与图像处理装置111电连接的控制模块112。图像处理装置111用于执行步骤S1至S4,控制模块112用于执行步骤S6。图像处理装置111的结构如上第一实施方式所述,在此不再赘述。控制模块112用于控制成像装置10(图5-7所示)输出相同场景的对焦图像和虚焦图像。
请参阅图5,本发明第一实施方式的成像装置10包括第一实施方式的控制装置11及与第一实施方式的控制装置11电连接的摄像头12。换句话说,本实施方式的成像装置10包括第一实施方式的图像处理装置111、控制模块112、及摄像头12。控制模块 112与摄像头12及图像处理装置111均电连接。
请参阅图6及7,本发明第一实施方式的电子装置100包括第一实施方式的成像装置10。电子装置100可以是手机、平板电脑、笔记本电脑、智能手表、智能手环、智能头盔、智能眼镜、其他虚拟现实穿戴设备、其他增强现实穿戴设备等具有拍摄功能的终端中的任意一种。当成像装置10的数量为一个时,成像装置10可以是前置相机或后置相机。当成像装置10的数量为两个时,两个成像装置10可以分别是前置相机及后置相机;或两个成像装置10都是前置相机;或两个成像装置10都是后置相机。当然,成像装置10的数量大于等于两个时,成像装置10可以是设置在任意位置的相机,除了前置相机、后置相机,还可以是顶部相机、底部相机、侧壁相机等。
举例来说,请结合图8,摄像头12针对相同场景拍摄对焦图像(图8左上幅所示)和虚焦图像(图8右上幅所示)。其中,对焦图像是处于全景对焦状态。经识别后,可以判断对焦图像中有过曝部分,即上方的长条形灯管。虚化对焦图像以得到虚化对焦图像(图8左下幅所示),其中,虚化对焦图像中的过曝部分(长条形灯管)被虚化得到虚化过曝部分(长条形灯管)。在存在过曝部分时,处理虚焦图像以得到与过曝部分对应的素材部分(长条形灯管)。将虚化对焦图像中与过曝部分对应的虚化过曝部分替换为素材部分以得到合并图像(图8右下幅所示)。
本发明第一实施方式中的图像处理方法、图像处理装置111、控制方法、控制装置11、成像装置10及电子装置100通过拍摄两张图像,一张对焦图像,一张虚焦图像,取出虚焦图像中与对焦图像中过曝部分对应的素材部分,合入虚化后的对焦图像中,合成一张带有真实光斑效果的合并图像,光斑效果好。
请参阅图9,本发明第二实施方式的图像处理方法与第一实施方式的图像处理方法基本相同,进一步地,所述识别对焦图像中是否存在处于对焦状态的过曝部分的步骤包括以下步骤:
S11,根据对焦图像的直方图判断对焦图像中过曝像素是否多于或等于第一预定数目,过曝像素的像素值大于或等于预定像素值,预定像素值为对焦图像的像素值范围的上限,例如预定像素值为255;和
S12,在过曝像素多于或等于第一预定数目时确定存在过曝部分。
请参见图10,上述第二实施方式的图像处理方法可以由本发明第二实施方式的图像处理装置111实现。本发明第二实施方式的图像处理装置111与第一实施方式的图像处理装置111结构基本相同,不同之处在于:第二实施方式的图像处理装置111的识别模块1111包括第一判断子模块11111及第一确定子模块11112,可分别用于执行步骤S11及S12。也就是说,第一判断子模块11111用于根据对焦图像的直方图判断 对焦图像中过曝像素是否多于或等于第一预定数目,过曝像素的像素值大于或等于预定像素值,预定像素值为对焦图像的像素值范围的上限,例如预定像素值为255。第一确定子模块11112用于在过曝像素多于或等于第一预定数目时确定存在过曝部分。
请参阅图11,一般地,对焦图像的直方图的横轴从左至右表示像素值(灰度值)的递增,纵轴从下到上表示在某一像素值(灰度值)的像素数量的递增。像素值(灰度值)的范围为0-255,也即是表示由黑到白,在某一点的峰值越高,表示在该像素值(灰度值)下的像素越多。
第一预定数目应当是直方图中靠近右侧边界的像素也即是过曝像素的数量,第一预定数目可以设置为占总像素的三分之一,需要说明的是,三分之一仅是示意性说明,并非对发明的限制。
请参阅图12,本发明第二实施方式的控制方法与第一实施方式的控制方法基本相同,进一步地,所述识别对焦图像中是否存在处于对焦状态的过曝部分的步骤包括以下步骤:
S11,根据对焦图像的直方图判断对焦图像中过曝像素是否多于或等于第一预定数目,过曝像素的像素值大于或等于预定像素值,预定像素值为对焦图像的像素值范围的上限,例如预定像素值为255;和
S12,在过曝像素多于或等于第一预定数目时确定存在过曝部分。
请参见图13,上述第二实施方式的控制方法可以由本发明第二实施方式的控制装置11实现。本发明第二实施方式的控制装置11与第一实施方式的控制装置11结构基本相同,不同之处在于:第二实施方式的控制装置11的识别模块1111包括第一判断子模块11111及第一确定子模块11112,可分别用于执行步骤S11及S12。也就是说,第一判断子模块11111用于根据对焦图像的直方图判断对焦图像中过曝像素是否多于或等于第一预定数目,过曝像素的像素值大于或等于预定像素值,预定像素值为对焦图像的像素值范围的上限,例如预定像素值为255。第一确定子模块11112用于在过曝像素多于或等于第一预定数目时确定存在过曝部分。
请结合图11,一般地,对焦图像的直方图的横轴从左至右表示像素值(灰度值)的递增,纵轴从下到上表示在某一像素值(灰度值)的像素数量的递增。像素值(灰度值)的范围为0-255,也即是表示由黑到白,在某一点的峰值越高,表示在该像素值(灰度值)下的像素越多。
第一预定数目应当是直方图中靠近右侧边界的像素也即是过曝像素的数量,第一预定数目可以设置为占总像素的三分之一,需要说明的是,三分之一仅是示意性说明,并非对发明的限制。
请参阅图14,本发明第二实施方式的成像装置10包括第二实施方式的控制装置11及与第二实施方式的控制装置11电连接的摄像头12。换句话说,本实施方式的成像装置10包括第二实施方式的图像处理装置111、控制模块112、及摄像头12。控制模块112与摄像头12及图像处理装置111均电连接。
请参阅图15,本发明第二实施方式的电子装置100包括第二实施方式的成像装置10。电子装置100可以是手机、平板电脑、笔记本电脑、智能手表、智能手环、智能头盔、智能眼镜、其他虚拟现实穿戴设备、其他增强现实穿戴设备等具有拍摄功能的终端中的任意一种。当成像装置10的数量为一个时,成像装置10可以是前置相机或后置相机。当成像装置10的数量为两个时,两个成像装置10可以分别是前置相机及后置相机;或两个成像装置10都是前置相机;或两个成像装置10都是后置相机。当然,成像装置10的数量大于等于两个时,成像装置10可以是设置在任意位置的相机,除了前置相机、后置相机,还可以是顶部相机、底部相机、侧壁相机等。
本发明第二实施方式中的图像处理方法、图像处理装置111、控制方法、控制装置11、成像装置10及电子装置100通过拍摄两张图像,一张对焦图像,一张虚焦图像,取出虚焦图像中与对焦图像中过曝部分对应的素材部分,合入虚化后的对焦图像中,合成一张带有真实光斑效果的合并图像,光斑效果好。
请参阅图16,本发明第三实施方式的图像处理方法与第一实施方式的图像处理方法基本相同,进一步地,所述识别对焦图像中是否存在处于对焦状态的过曝部分的步骤包括以下步骤:
S11,根据对焦图像的直方图判断对焦图像中过曝像素是否多于或等于第一预定数目,过曝像素的像素值大于或等于预定像素值,预定像素值为对焦图像的像素值范围的上限,例如预定像素值为255;
S12,在过曝像素多于或等于第一预定数目时确定存在过曝部分;
S13,在存在过曝部分时,判断对焦图像中是否存在相邻接的过曝像素,相邻接的过曝像素的数目多于或等于第二预定数目;和
S14,在存在相邻接的过曝像素时,确定相邻接的过曝像素属于过曝部分。
请参见图17,上述第三实施方式的图像处理方法可以由本发明第三实施方式的图像处理装置111实现。本发明第三实施方式的图像处理装置111与第一实施方式的图像处理装置111结构基本相同,不同之处在于:第三实施方式的图像处理装置111的识别模块1111包括第一判断子模块11111、第一确定子模块11112、第二判断子模块11113、及第二确定子模块11114,可分别用于执行步骤S11、S12、S13及S14。也就是说,第一判断子模块11111用于根据对焦图像的直方图判断对焦图像中过曝像素是 否多于或等于第一预定数目,过曝像素的像素值大于或等于预定像素值,预定像素值为对焦图像的像素值范围的上限,例如预定像素值为255。第一确定子模块11112用于在过曝像素多于或等于第一预定数目时确定存在过曝部分。第二判断子模块11113用于在存在过曝部分时,判断对焦图像中是否存在相邻接的过曝像素,相邻接的过曝像素的数目多于或等于第二预定数目。第二确定子模块11114用于在存在相邻接的过曝像素时,确定相邻接的过曝像素属于过曝部分。
其中,第二预定数目应该小于第一预定数目,因为第一预定数目可能包括了噪点,甚至对焦图像可能包括多个相邻接的过曝像素,例如存在多个离散的光源,这些光源共同构成过曝部分。
请结合图11,一般地,对焦图像的直方图的横轴从左至右表示像素值(灰度值)的递增,纵轴从下到上表示在某一像素值(灰度值)的像素数量的递增。像素值(灰度值)的范围为0-255,也即是表示由黑到白,在某一点的峰值越高,表示在该像素值(灰度值)下的像素越多。
第一预定数目与第二预定数目应当是直方图中靠近右侧边界的像素也即是过曝像素的数量,第一预定数目可以设置为占总像素的三分之一,第二预定数目可以设置为占总像素的四分之一,需要说明的是,三分之一与四分之一仅是示意性说明,并非对发明的限制。
请参阅图18,本发明第三实施方式的控制方法与第一实施方式的控制方法基本相同,进一步地,所述识别对焦图像中是否存在处于对焦状态的过曝部分的步骤包括以下步骤:
S11,根据对焦图像的直方图判断对焦图像中过曝像素是否多于或等于第一预定数目,过曝像素的像素值大于或等于预定像素值,预定像素值为对焦图像的像素值范围的上限,例如预定像素值为255;
S12,在过曝像素多于或等于第一预定数目时确定存在过曝部分;
S13,在存在过曝部分时,判断对焦图像中是否存在相邻接的过曝像素,相邻接的过曝像素的数目多于或等于第二预定数目;和
S14,在存在相邻接的过曝像素时,确定相邻接的过曝像素属于过曝部分。
请参见图19,上述第三实施方式的控制方法可以由本发明第三实施方式的控制装置11实现。本发明第三实施方式的控制装置11与第一实施方式的控制装置11结构基本相同,不同之处在于:第三实施方式的控制装置11的识别模块1111包括第一判断子模块11111、第一确定子模块11112、第二判断子模块11113、及第二确定子模块11114,可分别用于执行步骤S11、S12、S13及S14。也就是说,第一判断子模块11111 用于根据对焦图像的直方图判断对焦图像中过曝像素是否多于或等于第一预定数目,过曝像素的像素值大于或等于预定像素值,预定像素值为对焦图像的像素值范围的上限,例如预定像素值为255。第一确定子模块11112用于在过曝像素多于或等于第一预定数目时确定存在过曝部分。第二判断子模块11113用于在存在过曝部分时,判断对焦图像中是否存在相邻接的过曝像素,相邻接的过曝像素的数目多于或等于第二预定数目。第二确定子模块11114用于在存在相邻接的过曝像素时,确定相邻接的过曝像素属于过曝部分。
其中,第二预定数目应该小于第一预定数目,因为第一预定数目可能包括了噪点,甚至对焦图像可能包括多个相邻接的过曝像素,例如存在多个离散的光源,这些光源共同构成过曝部分。
请结合图11,一般地,对焦图像的直方图的横轴从左至右表示像素值(灰度值)的递增,纵轴从下到上表示在某一像素值(灰度值)的像素数量的递增。像素值(灰度值)的范围为0-255,也即是表示由黑到白,在某一点的峰值越高,表示在该像素值(灰度值)下的像素越多。
第一预定数目与第二预定数目应当是直方图中靠近右侧边界的像素也即是过曝像素的数量,第一预定数目可以设置为占总像素的三分之一,第二预定数目可以设置为占总像素的四分之一,需要说明的是,三分之一与四分之一仅是示意性说明,并非对发明的限制。
请参阅图20,本发明第三实施方式的成像装置10包括第三实施方式的控制装置11及与第三实施方式的控制装置11电连接的摄像头12。换句话说,本实施方式的成像装置10包括第三实施方式的图像处理装置111、控制模块112、及摄像头12。控制模块112与摄像头12及图像处理装置111均电连接。
请参阅图21,本发明第三实施方式的电子装置100包括第三实施方式的成像装置10。电子装置100可以是手机、平板电脑、笔记本电脑、智能手表、智能手环、智能头盔、智能眼镜、其他虚拟现实穿戴设备、其他增强现实穿戴设备等具有拍摄功能的终端中的任意一种。当成像装置10的数量为一个时,成像装置10可以是前置相机或后置相机。当成像装置10的数量为两个时,两个成像装置10可以分别是前置相机及后置相机;或两个成像装置10都是前置相机;或两个成像装置10都是后置相机。当然,成像装置10的数量大于等于两个时,成像装置10可以是设置在任意位置的相机,除了前置相机、后置相机,还可以是顶部相机、底部相机、侧壁相机等。
本发明第三实施方式中的图像处理方法、图像处理装置111、控制方法、控制装置11、成像装置10及电子装置100通过拍摄两张图像,一张对焦图像,一张虚焦图像, 取出虚焦图像中与对焦图像中过曝部分对应的素材部分,合入虚化后的对焦图像中,合成一张带有真实光斑效果的合并图像,光斑效果好。
请参阅图22,本发明第四实施方式的图像处理方法与第一实施方式的图像处理方法基本相同,进一步地,第四实施方式的图像处理方法还包括以下步骤:
S7,在存在过曝部分时,输出合并图像;和
S8,在不存在过曝部分时,输出虚化对焦图像。
请参见图23,上述第四实施方式的图像处理方法可以由本发明第四实施方式的图像处理装置111实现。本发明第四实施方式的图像处理装置111与第一实施方式的图像处理装置111结构基本相同,不同之处在于:第四实施方式的图像处理装置111还包括第一输出模块1117及第二输出模块1118,可分别用于执行步骤S7及S8。也就是说,第一输出模块1117用于在存在过曝部分时,输出合并图像。第二输出模块1118用于在不存在过曝部分时,输出虚化对焦图像。
请参阅图24,本发明第四实施方式的控制方法与第一实施方式的控制方法基本相同,第四实施方式的控制方法还包括以下步骤:
S7,在存在过曝部分时,输出合并图像;和
S8,在不存在过曝部分时,输出虚化对焦图像。
请参见图25,上述第四实施方式的控制方法可以由本发明第四实施方式的控制装置11实现。本发明第四实施方式的控制装置11与第一实施方式的控制装置11结构基本相同,不同之处在于:第四实施方式的控制装置11的图像处理装置111还包括第一输出模块1117及第二输出模块1118,可分别用于执行步骤S7及S8。也就是说,第一输出模块1117用于在存在过曝部分时,输出合并图像。第二输出模块1118用于在不存在过曝部分时,输出虚化对焦图像。
请参阅图26,本发明第四实施方式的成像装置10包括第四实施方式的控制装置11及与第四实施方式的控制装置11电连接的摄像头12。换句话说,本实施方式的成像装置10包括第四实施方式的图像处理装置111、控制模块112、及摄像头12。控制模块112与摄像头12及图像处理装置111均电连接。
请参阅图27,本发明第四实施方式的电子装置100包括第四实施方式的成像装置10。电子装置100可以是手机、平板电脑、笔记本电脑、智能手表、智能手环、智能头盔、智能眼镜、其他虚拟现实穿戴设备、其他增强现实穿戴设备等具有拍摄功能的终端中的任意一种。当成像装置10的数量为一个时,成像装置10可以是前置相机或后置相机。当成像装置10的数量为两个时,两个成像装置10可以分别是前置相机及后置相机;或两个成像装置10都是前置相机;或两个成像装置10都是后置相机。当 然,成像装置10的数量大于等于两个时,成像装置10可以是设置在任意位置的相机,除了前置相机、后置相机,还可以是顶部相机、底部相机、侧壁相机等。
本发明第四实施方式中的图像处理方法、图像处理装置111、控制方法、控制装置11、成像装置10及电子装置100通过拍摄两张图像,一张对焦图像,一张虚焦图像,取出虚焦图像中与对焦图像中过曝部分对应的素材部分,合入虚化后的对焦图像中,合成一张带有真实光斑效果的合并图像,光斑效果好。
可以理解,步骤S7及S8还可以应用于第二实施方式的图像处理方法、第二实施方式的控制方法;对应地,第一输出模块1117及第二输出模块1118还可以应用于第二实施方式的图像处理装置、第二实施方式的控制装置、第二实施方式的成像装置与第二实施方式的电子装置中。步骤S7及S8还可以应用于第三实施方式的图像处理方法、第三实施方式的控制方法;对应地,第一输出模块1117及第二输出模块1118还可以应用于第三实施方式的图像处理装置、第三实施方式的控制装置、第三实施方式的成像装置与第三实施方式的电子装置中。
请参阅图28,前述第一至第四实施方式的控制方法中,进一步地,所述控制成像装10输出相同场景的对焦图像和虚焦图像的步骤(步骤S6)可包括以下步骤:
S61,控制成像装置对焦以得到对焦图像;
S62,重新调焦并处理不同调焦状态下成像装置输出的缓存图像以得到对应的虚化程度;和
S63,保存虚化程度与虚化对焦图像基本相同的缓存图像作为虚焦图像。
对应地,请参阅图29,第一至第四实施方式的控制装置11中的控制模块112包括对焦子模块1121、调焦子模块1122、及保存子模块1123,可以用于分别执行步骤S61、S62及S63。也就是说,对焦子模块1121用于控制成像装置对焦以得到对焦图像。调焦子模块1122用于重新调焦并处理不同调焦状态下成像装置输出的缓存图像以得到对应的虚化程度。及保存子模块1123用于保存虚化程度与虚化对焦图像基本相同的缓存图像作为虚焦图像。
对应地,第一至第四实施方式的成像装置10与电子装置100中的控制模块112也可包括对焦子模块1121、调焦子模块1122、及保存子模块1123,具体结构与功能同前,在此不再详细展开。
本发明某些实施方式还提供一种电子装置,该电子装置包括壳体、处理器、存储器、电路板和电源电路。所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上。所述电源电路,用于为所述电子装置的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过读取所述存储器中 存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行上述任一实施方式所述的图像处理方法或执行上述任一实施方式所述的控制方法。其中,电子装置可以是手机、平板电脑、笔记本电脑、智能手表、智能手环、智能头盔、智能眼镜中的任意一种。
本发明实施方式还提供一种计算机可读存储介质,具有存储于其中的指令,当电子装置的处理器执行所述指令时,所述电子装置执行如上任意一实施方式所述的图像处理方法或执行上述任一实施方式所述的控制方法。
在本说明书的描述中,参考术语“某些实施方式”、“一实施方式”、“一个实施方式”、“一些实施方式”、“示意性实施方式”、“示例”、“具体示例”、或“一些示例”等的描述意指结合所述实施方式或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施方式或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施方式或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施方式或示例中以合适的方式结合。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行***、装置或设备(如基于计算机的***、包括处理器的***或其他可以从指令执行***、装置或设备取指令并执行指令的***)使用,或结合这些指令执行***、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行***、装置或设备或结合这些指令执行***、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行***执行的软件或 固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (27)

  1. 一种图像处理方法,其特征在于,所述图像处理方法包括以下步骤:
    识别对焦图像中是否存在处于对焦状态的过曝部分;
    虚化所述对焦图像以得到虚化对焦图像;
    在存在所述过曝部分时,处理与所述对焦图像场景相同的虚焦图像以得到与所述过曝部分对应的素材部分;和
    将所述虚化对焦图像中与所述过曝部分对应的虚化过曝部分替换为所述素材部分以得到合并图像。
  2. 如权利要求1所述的图像处理方法,其特征在于,所述对焦图像处于全景深对焦状态。
  3. 如权利要求1所述的图像处理方法,其特征在于,所述识别对焦图像中是否存在处于对焦状态的过曝部分的步骤包括:
    根据所述对焦图像的直方图判断所述对焦图像中过曝像素是否多于或等于第一预定数目,所述过曝像素的像素值大于或等于预定像素值;和
    在所述过曝像素多于或等于第一预定数目时确定存在所述过曝部分。
  4. 如权利要求3所述的图像处理方法,其特征在于,所述识别对焦图像中是否存在处于对焦状态的过曝部分的步骤包括:
    在存在所述过曝部分时,判断所述对焦图像中是否存在相邻接的过曝像素,所述相邻接的过曝像素的数目多于或等于第二预定数目;和
    在存在所述相邻接的过曝像素时,确定所述相邻接的过曝像素属于所述过曝部分。
  5. 如权利要求3或4所述的图像处理方法,其特征在于,所述预定像素值为所述适曝图像的像素值范围的上限。
  6. 如权利要求1所述的图像处理方法,其特征在于,所述虚化所述对焦图像以得到虚化对焦图像的步骤是采用高斯模糊算法实现的。
  7. 如权利要求1所述的图像处理方法,其特征在于,所述素材部分的虚化程度与所述虚化过曝部分的虚化程度基本相同。
  8. 如权利要求1所述的图像处理方法,其特征在于,所述图像处理方法包括:
    在存在所述过曝部分时,输出所述合并图像;和
    在不存在所述过曝部分时,输出所述虚化对焦图像。
  9. 一种控制方法,用于控制成像装置,其特征在于,所述控制方法包括以下步骤:
    控制所述成像装置输出相同场景的对焦图像和虚焦图像;和
    采用如权利要求1-8任意一项所述的图像处理方法处理所述对焦图像和所述虚焦图像。
  10. 如权利要求9所述的控制方法,其特征在于,所述控制所述成像装置输出相同场景的对焦图像和虚焦图像的步骤包括以下步骤:
    控制所述成像装置对焦以得到所述对焦图像;
    重新调焦并处理不同调焦状态下所述成像装置输出的缓存图像以得到对应的虚化程度;和
    保存虚化程度与所述虚化对焦图像基本相同的所述缓存图像作为所述虚焦图像。
  11. 一种图像处理装置,其特征在于,所述图像处理装置包括:
    识别模块,用于识别对焦图像中是否存在处于对焦状态的过曝部分;
    虚化模块,用于虚化所述对焦图像以得到虚化对焦图像;
    处理模块,用于在存在所述过曝部分时,处理与所述对焦图像场景相同的虚焦图像以得到与所述过曝部分对应的素材部分;和
    合并模块,用于将所述虚化对焦图像中与所述过曝部分对应的虚化过曝部分替换为所述素材部分以得到合并图像。
  12. 如权利要求11所述的图像处理装置,其特征在于,所述对焦图像处于全景深对焦状态。
  13. 如权利要求11所述的图像处理装置,其特征在于,所述识别模块包括:
    第一判断子模块,用于根据所述对焦图像的直方图判断所述对焦图像中过曝像素是否多于或等于第一预定数目,所述过曝像素的像素值大于或等于预定像素值;和
    第一确定子模块,用于在所述过曝像素多于或等于第一预定数目时确定存在所述过曝部分。
  14. 如权利要求13所述的图像处理装置,其特征在于,所述识别模块还包括:
    第二判断子模块,用于在存在所述过曝部分时,判断所述对焦图像中是否存在相邻接的过曝像素,所述相邻接的过曝像素的数目多于或等于第二预定数目;和
    第二确定子模块,用于在存在所述相邻接的过曝像素时,确定所述相邻接的过曝像素属于所述过曝部分。
  15. 如权利要求13或14所述的图像处理装置,其特征在于,所述预定像素值为所述适曝图像的像素值范围的上限。
  16. 如权利要求11所述的图像处理装置,其特征在于,所述虚化模块用于是采用高斯模糊算法来虚化对焦图像以得到虚化对焦图像。
  17. 如权利要求11所述的图像处理装置,其特征在于,所述素材部分的虚化程度与所述虚化过曝部分的虚化程度基本相同。
  18. 如权利要求11所述的图像处理装置,其特征在于,所述图像处理装置包括:
    第一输出模块,用于在存在所述过曝部分时,输出所述合并图像;和
    第二输出模块,用于在不存在所述过曝部分时,输出所述虚化对焦图像。
  19. 一种控制装置,用于控制成像装置,其特征在于,所述控制装置包括:
    控制模块,用于控制所述成像装置输出相同场景的对焦图像和虚焦图像;和
    如权利要求11-18任意一项所述并与所述控制模块电连接的图像处理装置。
  20. 如权利要求19所述的控制装置,其特征在于,所述控制模块包括:
    对焦子模块,用于控制所述成像装置对焦以得到所述对焦图像;
    调焦子模块,用于重新调焦并处理不同调焦状态下所述成像装置输出的缓存图像以得到对应的虚化程度;和
    保存子模块,用于保存虚化程度与所述虚化对焦图像基本相同的所述缓存图像作为所述虚焦图像。
  21. 一种成像装置,其特征在于,所述成像装置包括:
    摄像头;
    与所述摄像头电连接的控制模块,用于控制所述摄像头输出相同场景的对焦图像和虚焦图像;和
    如权利要求11-18任意一项所述并与所述控制模块电连接的图像处理装置。
  22. 如权利要求21所述的成像装置,其特征在于,所述控制模块包括:
    对焦子模块,用于控制所述成像装置对焦以得到所述对焦图像;
    调焦子模块,用于重新调焦并处理不同调焦状态下所述成像装置输出的缓存图像以得到对应的虚化程度;和
    保存子模块,用于保存虚化程度与所述虚化对焦图像基本相同的所述缓存图像作为所述虚焦图像。
  23. 一种电子装置,其特征在于,所述电子装置包括如权利要求21-22任意一项所述的成像装置。
  24. 如权利要求23所述的电子装置,其特征在于,所述电子装置包括手机、平板电脑、笔记本电脑、智能手表、智能手环、智能头盔、智能眼镜中的任意一种。
  25. 如权利要求23所述的电子装置,其特征在于,所述成像装置包括前置相机或/和后置相机。
  26. 一种电子装置,包括壳体、处理器、存储器、电路板和电源电路,其特征在于,所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上;所述电源电路,用于为所述电子装置的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行如权利要求1至8中任一项所述的图像处理方法或执行如权利要求9至10中任一项所述的控制方法。
  27. 一种计算机可读存储介质,具有存储于其中的指令,当电子装置的处理器执行所述指令时,所述电子装置执行如权利要求1至8中任一项所述的图像处理方法或执行如权利要求9至10中任一项所述的控制方法。
PCT/CN2016/111149 2016-12-20 2016-12-20 图像处理方法与装置、控制方法与装置、成像与电子装置 WO2018112764A1 (zh)

Priority Applications (10)

Application Number Priority Date Filing Date Title
PCT/CN2016/111149 WO2018112764A1 (zh) 2016-12-20 2016-12-20 图像处理方法与装置、控制方法与装置、成像与电子装置
TW106139390A TWI626620B (zh) 2016-12-20 2017-11-14 圖像處理方法與裝置、電子裝置及計算機可讀儲存介質
US15/814,791 US10692199B2 (en) 2016-12-20 2017-11-16 Image processing method and device, and non-transitory computer-readable storage medium
EP17208506.0A EP3340608B1 (en) 2016-12-20 2017-12-19 Image processing method and device, and non-transitory computer-readable storage medium
ES17208506T ES2761593T3 (es) 2016-12-20 2017-12-19 Procedimiento de procesamiento de imágenes y dispositivo, y medio de almacenamiento legible por ordenador no transitorio
PCT/CN2017/117289 WO2018113685A1 (en) 2016-12-20 2017-12-19 Image processing method and device, and non-transitory computer-readable storage medium
KR1020197018549A KR102171625B1 (ko) 2016-12-20 2017-12-19 이미지 프로세싱 방법 및 디바이스, 및 비-일시적 컴퓨터-판독가능 저장 매체(image processing method and device, and non-transitory computer-readable storage medium)
JP2019533587A JP6803473B2 (ja) 2016-12-20 2017-12-19 画像処理方法および装置、ならびに非一時的コンピュータ可読記憶媒体
AU2017379019A AU2017379019B2 (en) 2016-12-20 2017-12-19 Image processing method and device, and non-transitory computer-readable storage medium
ZA2019/04191A ZA201904191B (en) 2016-12-20 2019-06-26 Image processing method and device, and non-transitory computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/111149 WO2018112764A1 (zh) 2016-12-20 2016-12-20 图像处理方法与装置、控制方法与装置、成像与电子装置

Publications (1)

Publication Number Publication Date
WO2018112764A1 true WO2018112764A1 (zh) 2018-06-28

Family

ID=62624083

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/111149 WO2018112764A1 (zh) 2016-12-20 2016-12-20 图像处理方法与装置、控制方法与装置、成像与电子装置

Country Status (1)

Country Link
WO (1) WO2018112764A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101587586A (zh) * 2008-05-20 2009-11-25 株式会社理光 一种图像处理装置及图像处理方法
US20120320238A1 (en) * 2011-06-14 2012-12-20 AmTRAN TECHNOLOGY Co. Ltd Image processing system, camera system and image capture and synthesis method thereof
CN104660900A (zh) * 2013-10-30 2015-05-27 株式会社摩如富 图像处理装置及图像处理方法
CN105227847A (zh) * 2015-10-30 2016-01-06 上海斐讯数据通信技术有限公司 一种手机的相机拍照方法和***
CN106060406A (zh) * 2016-07-27 2016-10-26 维沃移动通信有限公司 一种拍照方法及移动终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101587586A (zh) * 2008-05-20 2009-11-25 株式会社理光 一种图像处理装置及图像处理方法
US20120320238A1 (en) * 2011-06-14 2012-12-20 AmTRAN TECHNOLOGY Co. Ltd Image processing system, camera system and image capture and synthesis method thereof
CN104660900A (zh) * 2013-10-30 2015-05-27 株式会社摩如富 图像处理装置及图像处理方法
CN105227847A (zh) * 2015-10-30 2016-01-06 上海斐讯数据通信技术有限公司 一种手机的相机拍照方法和***
CN106060406A (zh) * 2016-07-27 2016-10-26 维沃移动通信有限公司 一种拍照方法及移动终端

Similar Documents

Publication Publication Date Title
CN111028189B (zh) 图像处理方法、装置、存储介质及电子设备
US11044410B2 (en) Imaging control method and apparatus, electronic device, and computer readable storage medium
JP7059284B2 (ja) カメラアセンブリおよびモバイル電子装置
US10757312B2 (en) Method for image-processing and mobile terminal using dual cameras
CN108322646B (zh) 图像处理方法、装置、存储介质及电子设备
KR102565513B1 (ko) 다중 기술 심도 맵 취득 및 융합을 위한 방법 및 장치
JP6911192B2 (ja) 画像処理方法、装置および機器
WO2019105154A1 (en) Image processing method, apparatus and device
CN107613199A (zh) 虚化照片生成方法、装置和移动终端
KR20200017072A (ko) 이미지 분석에 기반하여, 디스플레이를 통해 표시된 영상과 메모리에 저장된 영상과 관련하여 알림을 제공하는 전자 장치 및 방법
WO2019072190A1 (zh) 图像处理方法、电子装置和计算机可读存储介质
CN107358593B (zh) 成像方法和装置
US10382734B2 (en) Electronic device and color temperature adjusting method
CN109618102B (zh) 对焦处理方法、装置、电子设备及存储介质
CN105187728B (zh) 拍照方法和装置
CN110717871A (zh) 图像处理方法、装置、存储介质及电子设备
US10692199B2 (en) Image processing method and device, and non-transitory computer-readable storage medium
CN105611156B (zh) 全画面对焦方法及照相机
CN106851090B (zh) 图像处理方法与装置、控制方法与装置、成像与电子装置
KR102645054B1 (ko) 차량 상태 관리 장치 및 방법
WO2018112764A1 (zh) 图像处理方法与装置、控制方法与装置、成像与电子装置
CN105791689A (zh) 一种图像处理方法和装置
WO2019011182A1 (en) MOBILE TERMINAL AND ITS ADJUSTMENT METHOD, AND COMPUTER-READABLE STORAGE MEDIUM
JP7397640B2 (ja) 画像処理装置および画像処理方法
WO2018112763A1 (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: 16924563

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16924563

Country of ref document: EP

Kind code of ref document: A1