Image Processing Method And Electronic Apparatus With Image Processing Mechanism
An image processing method comprising: (a) acquiring a first depth value for a first object in a first image; and (b) altering image effect for the first object according the first depth value when the first object is pasted onto a second image.
CROSS REFERENCE TO RELATED PATENT APPLICATION(S)
The present disclosure is part of a continuation application of U.S. patent application Ser. No. 14/791,273, filed on 3 Jul. 2015, which is incorporated by reference in its entirety.
TECHNICAL FIELDThe present disclosure relates to an image processing method and an electronic apparatus with an image processing mechanism, and particularly relates to an image processing method and an electronic apparatus which can automatically process an image according to depth values.
BACKGROUNDSometimes, a user may desire to alter an image after the image is captured. For example, the user wants to paste his image to an image for a place he has never been. Alternatively, the user may want to paste an image for a furniture to an image of a room to see if the furniture matches that room.
However, many altering steps are needed to complete this altering process. Firstly, the user must copy his image and paste his image to the image he wants. Secondly, the user must alter the location and the size for his image manually. However, the user may forget the real distance and the real size for the objects in the image he wants. Accordingly, the image after altering may be weird.
Take
One objective of the present disclosure is to provide an image processing method to automatically alter the object to be pasted.
One objective of the present disclosure is to provide an electronic apparatus to automatically alter the object to be pasted.
One implementation of the present disclosure discloses an image processing method comprising: (a) acquiring a first depth value for a first object in a first image; and (b)altering image effect for the first object according the first depth value when the first object is pasted onto a second image.
Another implementation of the present disclosure discloses an electronic apparatus with an image processing mechanism comprising: a depth detecting device, configured to acquire a first depth value for a first object in a first image; and an image processing device, configured to alter image effect for the first object according the first depth value when the first object is pasted onto a second image.
In view of above-mentioned implementations, the image effect of the object to be pasted can be automatically altered based on the depth value of the object to be pasted. Accordingly, the images can be merged with less disharmony. Also, optimized location and size for the object can be acquired.
These and other objectives of the present disclosure will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred implementation that is illustrated in the various figures and drawings.
The z is a real size of the target T, and x, y are distances between the camera lens L and the target T while T is at different locations. Further, w is the distance between the image sensor and the camera lens L. Besides, y1 and y2 are image sizes for the target T (i.e. the objects in following description) while the target T is at different locations. Based on above-mentioned equations, if x, y are acquired, the ratio between y1 and y2 can be acquired as well. The following implementations depicted in
Please refer to
However, in one implementation of the present disclosure, the depth values (ex. depth map) for the first image I1 and the second image I2 are acquired, and the size and the location for the first object O1 are altered according to the depth value of the first object O1 Take
Please note, the first object O1 in the altered third image I3′ of
In one implementation, after the steps for automatically altering the size and location of the first object O1 according to the depth value thereof, the user can further move the first object to another location. In such implementation, the first object O1 is enlarged when the first object O1 is moved from the location in the altered third image I3′ of
The steps for the implementations of
In another implementation, the maximum depth value of the second image I2 is smaller than the first object O1. In such implementation, the first object O1 is enlarged according to a relation between the depth value of the first object O1 and the maximum depth value of the second image I2. Please refer to
In another similar implementation, the maximum depth value of the second image I2 is also smaller than the first object O1. In such implementation, a target second object in the second image is shrunk, according to a relation between a depth value of the target second object and the depth value of the first object O1. Please refer to
In one implementation, a lock mode and a unlock mode are provided and can be switched via a trigger operation. In the lock mode, the relation between the first object O1 and the second image I2 is fixed, thus the first object O1 is resized according to the relation between the first object O1 and the second image l2 (or an object in the second image I2). For example, the first object O1 is resized according to the depth value thereof and the depth value of the second object O2 in
Step 901
Start.
Step 903
Select images having depth values. For example, the first image I1 and the second image I2 in
Step 905
Paste an object. For example, as depicted in
Step 907
Alter the location of the first object O1 automatically according to the depth value of the first object O1 after the first object O1 is pasted to the second image I2.
Step 909
Alter the size of the first object O1 automatically according to the depth value of the first object O1 after the first object O1 is pasted to the second image I2.
Step 911
Move the first object O1 to a desired location. As stated above, the first object O1 is enlarged when the first object O1 is moved to a location with a smaller depth value. Also, the first object is shrunk when the first object is moved to a location with a larger depth value.
Please note, the step 911 can be omitted in another implementation.
Step 913
Save the altered image. For example, save the altered third image I3′ in
As above-mentioned description, an unlock mode is provided in another implementation, as depicted in
Step 1201
Start.
Step 1203
Acquire an image with disparity values. For example, the first image I1 in
Step 1205
Acquire another image. For example, the second image I2 in
Step 1207
Paste the first object to another image. For example, paste the first object O11 to the second image I2.
Step 1209
Automatically alter the first object O11 to a location determined by the disparity information.
Step 1211
Automatically alter a size of the first object according to the depth value in the original image (ex. the first image I1 ) and the altered image (ex. the altered third image I3′).
Step 1213
Move the first object O11 to a desired location. As stated above, the first object O11 is enlarged when the first object O1 is moved from the location stated in the step 1209 to a second location with a depth value smaller than the first depth value. Also, the first object is shrunk when the first object is moved from the location stated in the step 1209 to a third location with a depth value larger than the first depth value.
Please note, the step 1213 can be omitted in another implementation.
Step 1215
Save the altered image. For example, save the altered third image I3′ in
The image processing method provided by the present disclosure can further comprise altering other image effects besides “altering the position and size of the object”.
Based on the implementation of
In view of above-mentioned implementations, the image effect of the object to be pasted can be automatically altered based on the depth value of the object to be pasted. Accordingly, the images can be merged with less disharmony. Also, optimized location and size for the object can be acquired.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Claims
1. An image processing method, comprising:
- altering, by an image processing device of an electronic apparatus, an image effect for a first object according to a first depth value of the first object in a first image when the first object is pasted onto a second image to generate an altered third image; and
- saving, by the image processing device, the altered third image in a memory device.
2. The image processing method of claim 1, further comprising:
- merging, by the image processing device, the first depth value for the first object into the second image.
3. The image processing method of claim 1, wherein the altering of the image effect for the first object comprises:
- acquiring, by the image processing device, a location with the first depth value in the second image; and
- locating, by the image processing device, the first object at the location in the second image.
4. The image processing method of claim 3, further comprising:
- resizing, by the image processing device, the first object according to the first depth value.
5. The image processing method of claim 3, further comprising:
- enlarging, by the image processing device, the first object when the first object is moved from the location to a second location with a depth value smaller than the first depth value; and
- shrinking, by the image processing device, the first object when the first object is moved from the location to a third location with a depth value larger than the first depth value.
6. The image processing method of claim 1, wherein the altering of the image effect for the first object comprises:
- covering, by the image processing device, partially the first object by a second object with a second depth value smaller than the first depth value in the second image.
7. The image processing method of claim 1, further comprising:
- acquiring, by a depth detecting device of the electronic apparatus, the first depth value for the first image;
- acquiring, by the depth detecting device, a second depth value for the second image; and
- enlarging, by the image processing device, a size of the first object according to a relation between the first depth value of the first object and a maximum depth of the second image in an event that the maximum depth value of the second image is smaller than the first depth value of the first object.
8. The image processing method of claim 1, further comprising:
- acquiring, by a depth detecting device of the electronic apparatus, the first depth value for the first image;
- acquiring, by the depth detecting device, a second depth value for the second image; and
- shrinking, by the image processing device, a size for a target second object in the second image, according to a relation between a depth value of the target second object and the first depth value of the first object, in an event that a maximum depth value of the second image is smaller than the first depth value of the first object.
9. The image processing method of claim 1, wherein the altering comprises altering, by the image processing device, the image effect for the first object according to a disparity value between the first object and another object in the first image when the first object is pasted onto the second image.
10. The image processing method of claim 1, wherein the image effect comprises one or more of a defocus level, a brightness, a sharpness, and a color.
11. An electronic apparatus with an image processing mechanism, comprising:
- a memory device; and
- an image processing device capable of altering an image effect for a first object according to a first depth value of the first object in a first image when the first object is pasted onto a second image to generate an altered third image, the image processing device further capable of saving the altered third image in the memory device.
12. The electronic apparatus of claim 11, wherein the image processing device is further capable of merging the first depth value for the first object into the second image.
13. The electronic apparatus of claim 11, further comprising:
- a depth detecting device capable of acquiring the first depth value for the first object in the first image, the depth detecting device further capable of acquiring a second depth value for the second object in the second image,
- wherein the image processing device is further capable of altering the image effect for the first object by performing operations comprising: acquiring a location with the first depth value in the second image; and locating the first object at the location in the second image.
14. The electronic apparatus of claim 13, wherein the image processing device is further capable of resizing the first object according to the first depth value when the first object is pasted onto the second image.
15. The electronic apparatus of claim 13, wherein, when the first object is pasted onto the second image, the image processing device is further capable of performing operations comprising:
- enlarging the first object when the first object is moved from the location to a second location with a depth value smaller than the first depth value; and
- shrinking the first object when the first object is moved from the location to a third location with a depth value larger than the first depth value.
16. The electronic apparatus of claim 11, wherein the image processing device is further capable of covering partially the first object by a second object with a second depth value smaller than the first depth value in the second image when the first object is pasted onto the second image.
17. The electronic apparatus of claim 11, further comprising:
- a depth detecting device capable of acquiring the first depth value for the first object in the first image, the depth detecting device further capable of acquiring a second depth value for the second object in the second image,
- wherein the image processing device is further capable of enlarging the size of the first object, according to a relation between the first depth value of the first object and a maximum depth value of the second image, in an even that the maximum depth value of the second image is smaller than the first depth value of the first object.
18. The electronic apparatus of claim 11, further comprising:
- a depth detecting device capable of acquiring the first depth value for the first object in the first image, the depth detecting device further capable of acquiring a second depth value for the second object in the second image,
- wherein the image processing device is further capable of shrinking a size for a target second object in the second image, according to a relation between a depth value of the target second object and the first depth value of the first object, in an event that a maximum depth value of the second image is smaller than the first depth value of the first object.
19. The electronic apparatus of claim 11, wherein the image processing device is further capable of altering the image effect for the first object according to a disparity value between the first object and another object in the first image when the first object is pasted onto the second image.
20. The electronic apparatus of claim 11, wherein the image effect comprises one or more of a defocus level, a brightness, a sharpness, and a color.
Type: Application
Filed: Dec 19, 2016
Publication Date: Apr 13, 2017
Inventors: Cheng-Che Chan (Hsinchu County), Cheng-Che Chen (New Taipei City), Ding-Yun Chen (Taipei City)
Application Number: 15/384,310