CN106296574A - 3-d photographs generates method and apparatus - Google Patents

3-d photographs generates method and apparatus Download PDF

Info

Publication number
CN106296574A
CN106296574A CN201610623819.2A CN201610623819A CN106296574A CN 106296574 A CN106296574 A CN 106296574A CN 201610623819 A CN201610623819 A CN 201610623819A CN 106296574 A CN106296574 A CN 106296574A
Authority
CN
China
Prior art keywords
original photo
target
photographs
pixel
photo
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN201610623819.2A
Other languages
Chinese (zh)
Inventor
王文峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LeTV Holding Beijing Co Ltd
LeTV Mobile Intelligent Information Technology Beijing Co Ltd
Original Assignee
LeTV Holding Beijing Co Ltd
LeTV Mobile Intelligent Information Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LeTV Holding Beijing Co Ltd, LeTV Mobile Intelligent Information Technology Beijing Co Ltd filed Critical LeTV Holding Beijing Co Ltd
Priority to CN201610623819.2A priority Critical patent/CN106296574A/en
Publication of CN106296574A publication Critical patent/CN106296574A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/06Topological mapping of higher dimensional structures onto lower dimensional surfaces

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention discloses a kind of 3-d photographs and generate method and apparatus, relate to image processing techniques.The method includes: according to the photographing instruction of user, obtain the original photo of user's shooting;According to the depth map corresponding with described original photo, identify that the target that described original photo includes processes object;Described target in described original photo is processed object and is processed as red blue 3-D effect, to generate the 3-d photographs corresponding with described original photo.The present embodiment is by using technique scheme, 3-d photographs can be automatically generated, the target carrying out three-dimensional process is needed to process object without artificially choosing, operating procedure required when generating 3-d photographs and time can be efficiently reduced, reduce artificial participation during generated 3-d photographs, improve the real-time generating 3-d photographs.

Description

3-d photographs generates method and apparatus
Technical field
The present embodiments relate to image processing techniques, particularly relate to a kind of 3-d photographs and generate method and apparatus.
Background technology
Along with the development taken pictures with camera work, the viewing effect of captured photo be it is also proposed the highest by people Requirement.
In recent years, 3-d photographs presents effect with the vision of its solid and has obtained the concern of increasing user.Existing The manufacture method of 3-d photographs, it usually needs use the equipment of specialty to carry out the making of 3-d photographs, if domestic consumer wants to make Generate 3-d photographs, then need to use two cameras with certain shooting angle difference that same object is shot, or make With same camera, same object is successively taken the photograph twice to obtain for same object with certain shooting angle beat Two photos, are then based on this object and carry out the photo of shooting certain subsequent treatment thus generate 3-d photographs.
In the research process carrying out the present invention, inventor finds: owing to cannot directly identify accurately in photo Existing object edge, some 3-d photographs synthetic technologys need first artificially to choose in shooting photo to need to carry out three-dimensional process Object, is processed by setting afterwards and generates the 3-D effect corresponding with this object, and the generation process of 3-d photographs is loaded down with trivial details, people Work participation is high, poor real.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of 3-d photographs to generate method and apparatus, to solve existing three-dimensional photograph Sheet generates method operating process participation loaded down with trivial details, artificial height, the technical problem of poor real.
First aspect, embodiments provides a kind of 3-d photographs and generates method, including:
According to the photographing instruction of user, obtain the original photo of user's shooting;
According to the depth map corresponding with described original photo, identify that the target that described original photo includes processes object;
Described target in described original photo is processed object and is processed as red blue 3-D effect, original with described to generate The 3-d photographs that photo is corresponding.
Further, at the photographing instruction according to user, before obtaining the original photo of user's shooting, also include: pass through Dual camera is carried out taking pictures preview, to obtain depth map, and presents, in preview interface of taking pictures, preview image of taking pictures;Wherein, institute It is corresponding with the preview image of taking pictures of display in preview interface of taking pictures to state depth map.
Further, at the photographing instruction according to user, while obtaining the original photo of user's shooting, also include: When the photographing instruction of user being detected, the current depth map obtained of storage is as the depth map corresponding with described original photo.
Further, according to the depth map corresponding with described original photo, the target that described original photo includes is identified Process object includes: obtain the depth of view information of each image slices vegetarian refreshments in the depth map corresponding with original photo, wherein, the described depth of field Information includes the range information between subject and the cam lens that image slices vegetarian refreshments associates;Between range information Difference meets the image slices vegetarian refreshments of setting threshold condition and collects in same group pixels;Image pixel in each group pixels is sat Mark continuous print pixel is identified as described target and processes object.
Further, the described target in described original photo is processed object and be processed as red blue 3-D effect, to generate The 3-d photographs corresponding with described original photo includes: process the image pixel coordinates scope of object according to described target, obtains The contour pixel coordinate that the contour of object of object is corresponding is processed with described target;Described original photo is sat with described contour pixel The target pixel points that mark is corresponding is replicated in synthesis copy, and each pixel in described synthesis copy retains dividing of GB passage Value;In described original photo, the target pixel points corresponding with described contour pixel coordinate is retained the component value of R passage; Described synthesis copy is merged with described original photo, so that described target process object is processed as red blue 3-D effect.
Further, described synthesis copy is merged with described original photo include: by described synthesis copy After the translation of each pixel sets offset distance, merge with described original photo.
Further, before described synthesis copy is merged with described original photo, also include: according to described The depth map that original photo is corresponding, determines that described target processes the relative distance between object and described cam lens;According to Described relative distance, determines described offset distance.
Further, the described target process object in described original photo is being processed as red blue 3-D effect, with life After becoming the 3-d photographs corresponding with described original photo, also include: according to setting coding rule, described 3-d photographs is carried out Video coding, to generate 3 D video.
Second aspect, the embodiment of the present invention additionally provides a kind of 3-d photographs generating means, including:
Original photo acquisition module, for the photographing instruction according to user, obtains the original photo of user's shooting;
Target processes object identification module, for according to the depth map corresponding with described original photo, identifying described original The target that photo includes processes object;
3-d photographs generation module, is processed as red blue three-dimensional for the described target in described original photo processes object Effect, to generate the 3-d photographs corresponding with described original photo.
Further, described 3-d photographs generating means also includes: depth map acquisition module, in the bat according to user According to instruction, before obtaining the original photo of user's shooting, carried out taking pictures preview by dual camera, to obtain depth map, and Preview interface of taking pictures presents preview image of taking pictures;Wherein, described depth map and the preview of taking pictures of display in preview interface of taking pictures Image is corresponding.
Further, described 3-d photographs generating means also includes: depth map memory module, in the bat according to user According to instruction, while obtaining the original photo of user's shooting, when the photographing instruction of user being detected, the current scape obtained of storage Deep figure is as the depth map corresponding with described original photo.
Further, described target processes object identification module and includes: depth of view information acquiring unit, for obtaining with original The depth of view information of each image slices vegetarian refreshments in the depth map that photo is corresponding, wherein, described depth of view information includes that image slices vegetarian refreshments closes Range information between subject and the cam lens of connection;Group pixels determines unit, for by between range information Difference meets the image slices vegetarian refreshments of setting threshold condition and collects in same group pixels;Target processes object identification unit, uses Object is processed in image pixel coordinates continuous print pixel in each group pixels being identified as described target.
Further, described 3-d photographs generation module includes: contour pixel coordinate acquiring unit, for according to described mesh Mark processes the image pixel coordinates scope of object, obtains the contour pixel corresponding with the contour of object of described target process object and sits Mark;First red blue channel separative element, for by target pixel points corresponding with described contour pixel coordinate for described original photo It is replicated in synthesis copy, and each pixel in described synthesis copy is retained the component value of GB passage;Second red blue channel Separative element, in described original photo, retains R passage by the target pixel points corresponding with described contour pixel coordinate Component value;3-d photographs signal generating unit, for merging described synthesis copy with described original photo, with by described target Process object and be processed as red blue 3-D effect.
Further, described 3-d photographs signal generating unit specifically for: by described synthesis copy each pixel translate After setting offset distance, merge with described original photo, so that described target process object is processed as red blue 3-D effect.
Further, described 3-d photographs generating means also includes:
Relative distance determines unit, is used for before being merged with described original photo by described synthesis copy, according to The depth map corresponding with described original photo, determine described target process between object and described cam lens relative away from From;Offset distance determines unit, for according to described relative distance, determines described offset distance.
Further, described 3-d photographs generating means also includes: 3 D video generation module, for by described original Described target in photo processes object and is processed as red blue 3-D effect, to generate the 3-d photographs corresponding with described original photo Afterwards, according to setting coding rule, described 3-d photographs is carried out Video coding, to generate 3 D video.
The 3-d photographs that the embodiment of the present invention provides generates scheme, obtains the former of user's shooting according to the photographing instruction of user Beginning photo, processes object according to the target comprised in this original photo of depth map identification corresponding with this original photo, by original Target in photo processes object and is processed as red blue 3-D effect, thus generates the 3-d photographs corresponding with this original photo.This Embodiment is by using technique scheme, it is possible to automatically generate 3-d photographs, it is not necessary to artificially choose and need to carry out three-dimensional process Target process object, required operating procedure and time when generating 3-d photographs can be efficiently reduced, reduce and generate three-dimensional Artificial participation during photo, improves the real-time of generated 3-d photographs.
Accompanying drawing explanation
By the detailed description that non-limiting example is made made with reference to the following drawings of reading, other of the present invention Feature, purpose and advantage will become more apparent upon:
Fig. 1 generates the schematic flow sheet of method for a kind of 3-d photographs that the embodiment of the present invention one provides;
Fig. 2 generates the schematic flow sheet of method for a kind of 3-d photographs that the embodiment of the present invention two provides;
Fig. 3 generates the schematic flow sheet of method for a kind of 3-d photographs that the embodiment of the present invention three provides;
The structured flowchart of a kind of 3-d photographs generating means that Fig. 4 provides for the embodiment of the present invention four.
Detailed description of the invention
The present invention is described in further detail with embodiment below in conjunction with the accompanying drawings.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that, in order to just Part related to the present invention is illustrate only rather than full content in description, accompanying drawing.
Embodiment one
The embodiment of the present invention one provides a kind of 3-d photographs to generate method.The method can be held by 3-d photographs generating means OK, wherein this device can be realized by software and/or hardware, typically can be integrated in photographing device, and wherein, described photographing device can To include digital camera, smart mobile phone and panel computer etc..Fig. 1 is that the 3-d photographs of the embodiment of the present invention one generates method Schematic flow sheet, includes as it is shown in figure 1, this 3-d photographs generates method:
S110, photographing instruction according to user, obtain the original photo of user's shooting.
In the present embodiment, the photographing instruction of user can be understood as user for wanting to be generated the original of 3-d photographs The acquisition order of photo, i.e. the photographing instruction of user both can be the call instruction of user's photo to having shot, it is possible to To be user's shooting instruction for present scene;User shooting original photo refer to user shooting without red blue three The 2-dimentional photo of dimension effect process, generally only includes the two-dimensional signal of scenery included in photo, and it both can be going through of user History shooting photo, it is also possible to be that user is for the present scene photo obtained by present scene captured in real-time.
The quantity of acquired original photo can be the concrete numerical value set or scope, this acquired original photograph The concrete numerical value of sheet or scope can be by user's sets itself as required, it is also possible to carried out default setting by developer, herein Do not limit.Wherein, when the quantity of acquired original photo is the concrete numerical value that one sets, then obtain and this tool every time The original photo of body numerical value equal amount;When the quantity of acquired original photo is the scope that sets, then each institute The quantity of the original photo obtained is in this set point.Such as, if the quantity of the original photo acquired in setting is as 1 , then need to obtain 1 original photo every time;If the quantity of the original photo acquired in setting is opened as 1-5, then acquired original The quantity of photo can be any value in 1-5.In view of user operation convenience and generate 3-d photographs time to end The requirement of end performance, optionally, can be a numerical range by the quantity set of acquired original photo, this numerical range Lower limit be chosen as 1, the upper limit of this numerical range is chosen as a certain suitably numerical value more than 1.
Accordingly, according to the photographing instruction of user, the process of the original photo obtaining user's shooting can be: according to user Photographing instruction, from user terminal photo storage position acquisition user choose one or more history shooting photo be original photograph Sheet;Or, generated by the camera etc. that terminal the carries third party that software or terminal install client of taking pictures of taking pictures according to user Photographing instruction by photographic head, present scene is shot, and will shooting present scene generate one or more photo make For original photo.
Exemplary, when the elected history shooting photo taking family is original photo, can be to user's displaying terminal internal memory All history shooting photo of storage is so that user therefrom chooses original photo;Preferentially can also show recommendation photo to user, when Recommend photo does not comprise whole user when wanting the original photo chosen, then show that all history shoots photo to user, its In, it is recommended that photo can be the photo that shooting date is nearer, or the photo etc. that photographed is more visible, easy to identify, the most not It is restricted.
When the photo obtaining user's current shooting is original photo, then can choose what user shot in Preset Time One or more photo is original photo, wherein, this Preset Time can be user trigger before photographing instruction for the last time pre- If the time, such as, can be that user triggers before photographing instruction in 10s or 30s for the last time, accordingly, now acquired original Photo can be one or more photo shot in 10s or 30s before user triggers photographing instruction for the last time, here, this use Before photographing instruction is triggered at family for the last time, interior one or more photo shot of 10s or 30s includes that user triggers bat for the last time Captured picture when taking instruction, acquired original photo can be shooting time is nearer in Preset Time one or more Photo, or, one or more photo that shooting is more visible in Preset Time, it is also possible to select to operate by user and determine In Preset Time, one or more photo of shooting, is not restricted.
The depth map that S120, basis are corresponding with described original photo, identifies that the target that described original photo includes processes Object.
In the present embodiment, the depth map corresponding with original photo can record the three-dimensional letter of scenery captured by original photo Breath, i.e. both included the two-dimensional signal of captured scenery in original photo in depth map, and included again in original photo captured Scenery positional information on the direction of the plane being perpendicular to corresponding to two-dimensional signal.Target processes object and is not limited solely in reality Same object, i.e. the target that identified processes object can be with the object one_to_one corresponding in reality, it is also possible to by reality In multiple objects merge into target and process object, or, be that multiple target processes by an object segmentation in reality Object.
Exemplary, can be by captured scenery in the original photo that comprises in the depth map corresponding with original photo Two-dimensional signal and this original photo of positional information identification on the direction of the plane being perpendicular to corresponding to two-dimensional signal thereof are wrapped The target contained processes object.For example, it is possible to by the positional information on the direction of the plane being perpendicular to corresponding to two-dimensional signal It is identified as same target in the pixel that same position information block and pixel color are close and processes object, or will be perpendicular to Positional information on the direction of the plane corresponding to two-dimensional signal is in same position information block and pixel coordinate continuous print picture Vegetarian refreshments is identified as same target and processes object;Can also be by the position on the direction of the plane being perpendicular to corresponding to two-dimensional signal Information difference meets and imposes a condition and pixel that pixel color refers to is identified as same target and processes object, or will be vertically Positional information difference on the direction of the plane corresponding to two-dimensional signal is satisfied to impose a condition and pixel coordinate continuous print pixel Point is identified as same target and processes object.
S130, the described target in described original photo is processed object it is processed as red blue 3-D effect, to generate and institute State the 3-d photographs that original photo is corresponding.
Exemplary, the target in original photo can be processed object and carry out red blue channel separation so that it presents red indigo plant 3-D effect.When the target identified being processed object and processing, can be simultaneously to the institute included in original photo There is target to process object to process, thus reduce the waiting time of user;The target identified can also be processed object Successively process at random or according to a certain setting order, thus reduce the computing load of terminal, reduce terminal operational performance Requirement.
The 3-d photographs that the embodiment of the present invention one provides generates method, obtains user's shooting according to the photographing instruction of user Original photo, processes object according to the target comprised in this original photo of depth map identification corresponding with this original photo, by former Target in beginning photo processes object and is processed as red blue 3-D effect, thus generates the 3-d photographs corresponding with this original photo. The present embodiment is by using technique scheme, it is possible to automatically generate 3-d photographs, it is not necessary to artificially choose needs and carry out at three-dimensional The target of reason processes object, can efficiently reduce operating procedure required when generating 3-d photographs and time, reduces generation three Artificial participation during dimension photo, improves the real-time of generated 3-d photographs.
Embodiment two
A kind of 3-d photographs that Fig. 2 position embodiment of the present invention two provides generates the schematic flow sheet of method.The present embodiment exists It is optimized on the basis of above-described embodiment, further, according to the depth map corresponding with described original photo, identifies described former The target that beginning photo includes processes object and includes: obtain the depth of field of each image slices vegetarian refreshments in the depth map corresponding with original photo Information, wherein, described depth of view information includes the distance letter between subject and the cam lens that image slices vegetarian refreshments associates Breath;The image slices vegetarian refreshments that difference between range information meets setting threshold condition collects in same group pixels;Will be each In group pixels, image pixel coordinates continuous print pixel is identified as described target and processes object.
Further, the described target in described original photo is processed object and be processed as red blue 3-D effect, to generate The 3-d photographs corresponding with described original photo includes: process the image pixel coordinates scope of object according to described target, obtains The contour pixel coordinate that the contour of object of object is corresponding is processed with described target;Described original photo is sat with described contour pixel The target pixel points that mark is corresponding is replicated in synthesis copy, and each pixel in described synthesis copy retains dividing of GB passage Value;In described original photo, the target pixel points corresponding with described contour pixel coordinate is retained the component value of R passage; Described synthesis copy is merged with described original photo, so that described target process object is processed as red blue 3-D effect.
Accordingly, as in figure 2 it is shown, the 3-d photographs generation method that the present embodiment provides may include that
S210, photographing instruction according to user, obtain the original photo of user's shooting.
S220, obtain the depth of view information of each image slices vegetarian refreshments in the depth map corresponding with original photo, wherein, the described depth of field Information includes the range information between subject and the cam lens that image slices vegetarian refreshments associates.
Exemplary, the depth of view information of each pixel included in depth map can store in the form of packets, Or determine its storage order according to the two-dimensional coordinate information of each pixel, and then it is associated to store it according to this storage order The depth of view information of subject;Depth of view information corresponding to each pixel can also be stored at random, do not limit System.Wherein, when the depth of view information of each pixel stores in the form of packets, this packet can be according to image slices vegetarian refreshments The packet that range information between subject and the photographic head of association is carried out, it is also possible to be the pixel according to each pixel The packet that coordinate information is carried out.
Depth map corresponding to original photo correspondence can be stored in same position with this original photo, it is also possible to stores respectively At different positions corresponding relation of the two storage position of record.Accordingly, the depth map corresponding with original photo is being obtained In the depth of view information of each image slices vegetarian refreshments time, this original photo or this original photo can be first passed through and store with its depth map The corresponding relation of position obtains the depth map corresponding with this original photo, then obtains each picture in original photo from this depth map The depth of view information of vegetarian refreshments.
S230, the difference between range information is met set the image slices vegetarian refreshments of threshold condition and collect and divide in same pixel In group.
In the present embodiment, the difference between range information can be to have ultimate range and have in same group pixels Difference between the range information of the pixel of small distance;Can also be that in same group pixels, a certain pixel is a certain with other Difference between the range information of individual pixel.Accordingly, when carrying out group pixels, range information can be divided with this pixel In group the range information difference of existing all pixels all meet set threshold condition pixel collect in this group pixels In;The range information difference of existing to range information and this group pixels some or several pixel can also be met and set The pixel of threshold condition collects in this group pixels.Exemplary, it is assumed that set threshold condition little as range information difference In 5cm, if the difference between range information refers to have ultimate range in same group pixels and the picture with minimum range Difference between the range information of vegetarian refreshments, then only when existing all pixels in pixel to be determined with this group pixels When distance difference is both less than 5cm, just this pixel to be determined can be collected in this group pixels;If the difference between range information Value refers to the difference in same group pixels between a certain pixel and the range information of some other pixel, if then The range information difference of one or several pixel in existing all pixels in pixel to be determined and this group pixels During less than 5cm, will collect in this group pixels by this pixel to be determined.
S240, image pixel coordinates continuous print pixel in each group pixels is identified as described target process object.
Here, image pixel coordinates is continuous, both can be continuous on first direction in image pixel coordinates system, it is also possible to It is continuous in second direction in image pixel coordinates system, i.e. if the boundary line that two image slices vegetarian refreshments have coincidence is i.e. thought Two image slices vegetarian refreshments are continuous.Optionally, image pixel coordinates is continuous, it is also possible to be each image slices vegetarian refreshments in image pixel coordinates system Diagonally adjacent is continuous, now, accordingly, if two image slices vegetarian refreshments have the summit of coincidence and i.e. think two image pixels Point is continuously.
Exemplary, when identifying that target processes object, can choose in a certain group pixels default pixel or Randomly selecting a certain pixel is current comparison other, and is that this current comparison other adds target process object identification;Then Obtain all and this comparison other continuous print picture in addition to there is the pixel of target process object identification in this group pixels Vegetarian refreshments is new current comparison other, cancels the current comparison other mark of the pixel that original work are current comparison other, and will The current comparison other of this acquisition is labeled as same target with the pixel of initial acquisition and processes object;Repeat the above steps, directly To this group pixels, each pixel in addition to having same target and processing object identification is not the most continuous with current comparison other; Finally the pixel in this group pixels with identical target process object identification is defined as same target and processes object.Can Choosing is, if this target processes object and do not comprises all pixels in this group pixels, then from this group pixels target processed material The pixel that body does not comprises chooses a pixel again as current comparison other, repeat the above steps, until this pixel In packet, each pixel has all possessed respective target process object identification.
S250, process the image pixel coordinates scope of object according to described target, obtain and process object with described target The contour pixel coordinate that contour of object is corresponding.
Exemplary, can be by obtaining the target process when first direction coordinate takes different value in image pixel coordinates system Object the span of continuous value of second direction coordinate corresponding respectively determine that this target processes the object wheel of object Contour pixel coordinate corresponding to exterior feature;Can also first obtain in image pixel coordinates system when first direction coordinate takes different value Target processes the pixel of end points of the one or more contiguous pixels sections in object institute correspondence second direction respectively to determine this Target processes the contour of object of object, then determines that this target processes the contour of object correspondence of object according to the contour of object obtained Contour pixel coordinate.
S260, the target pixel points that described original photo is corresponding with described contour pixel coordinate is replicated in synthesis copy In, and each pixel in described synthesis copy is retained the component value of GB passage.
Take turns here, target pixel points corresponding with contour pixel coordinate in original photo refers to be in this in original photo All pixels in the range of wide pixel coordinate, it had both included each pixel that in original photo, coordinate is identical with contour pixel coordinate Point, each pixel comprised in also including this surrounded region of each pixel identical with contour pixel coordinate.Synthesis copy can To be memory area that is identical with the storage position of original photo contour pixel coordinate or that differ, target pixel points is being replicated With time in synthesis copy, optional, target pixel points coordinate information in pixel coordinate system is stored in synthesis copy simultaneously In.Exemplary, can be by the information deletion of each pixel R passage in synthesis copy, to realize retaining each target pixel points The component value of GB passage.
S270, in described original photo, the target pixel points corresponding with described contour pixel coordinate is retained R passage Component value.
Exemplary, can be logical to realize each target pixel points R of reservation by the information deletion of the GB passage of target pixel points The component value in road.
Here, it is pointed out that carry out synthesizing in copy with mesh corresponding with contour pixel coordinate in original photo When the mark each channel components of pixel is worth setting, it is also possible to each pixel in synthesis copy is retained the component value of R passage, will Target pixel points corresponding with contour pixel coordinate in original photo retains the component value of GB passage, and concrete setting content can root Arrange flexibly according to needs.
S280, described synthesis copy is merged with described original photo, so that described target process object is processed as Red blue 3-D effect.
Optionally, described synthesis copy is merged with described original photo include: each by described synthesis copy After pixel translation sets offset distance, merge with described original photo.
Exemplary, can first each pixel in synthesis copy be incorporated in original according to the pixel coordinate of its original In photo, translated the offset distance set the most again, be processed as red blue 3-D effect target being processed object;Can also First each pixel after translating is calculated according to initial pixel coordinate and the setting offset distance of each pixel in synthesis copy Pixel coordinate, then according to each pixel in synthesis copy is incorporated in original photograph by the pixel coordinate of each pixel after this translation In sheet, it is processed as red blue 3-D effect target being processed object.
The embodiment of the present invention two provide technical scheme, obtain user shooting original photo and with this original photo pair The depth of view information of each pixel in the depth map answered;According to subject corresponding to each pixel comprised in depth of view information with Range information and the pixel coordinate information identification target of each pixel between cam lens process object, and determine target Process the contour pixel coordinate of object;Target corresponding with contour pixel coordinate in original photo processes object replicate and synthesis In copy, and retain the component value of GB passage;Target corresponding with contour pixel coordinate in original photo is processed object and retains R The component value of passage;According to offset distance, synthesis copy is merged with original photo, this target to be processed object process For red blue 3-D effect.Thus generate the 3-d photographs corresponding with this original photo.The present embodiment is by using above-mentioned technical side Case, it is possible to automatically generate 3-d photographs, it is not necessary to artificially choose and need the target carrying out three-dimensional process to process object, can be effectively Reduce operating procedure required when generating 3-d photographs and time, reduce artificial participation when generating 3-d photographs, improve institute Generate the real-time of 3-d photographs.
On the basis of above-described embodiment, before described synthesis copy is merged with described original photo, also wrap Include: according to the depth map corresponding with described original photo, determine that described target processes between object and described cam lens Relative distance;According to described relative distance, determine described offset distance.Exemplary, acquired relative distance can be with Target processes each pixel one group of relative distance one to one that object is comprised, it is also possible to be that target process object is comprised The meansigma methods of relative distance of each pixel, be not restricted.Optionally, can be true according to offset distance set in advance Set pattern then determines the relation between relative distance and offset distance, and this offset distance determines that rule can be difference set in advance Relative distance value and offset distance between corresponding relation, it is also possible to be set in advance with relative distance as independent variable Offset distance computation rule.That is, in the case of the relative distance that known target processes between object and cam lens, permissible Value according to relative distance is directly inquired about and is obtained the offset distance distance values corresponding with this relative distance, it is also possible to this relative distance be Independent variable is calculated the value of the offset distance under this relative distance value.
Embodiment three
Fig. 3 generates the schematic flow sheet of method for a kind of 3-d photographs that the embodiment of the present invention three provides.The present embodiment exists It is optimized on the basis of above-described embodiment, further, at the photographing instruction according to user, obtain the original of user's shooting Before photo, also include: carried out taking pictures preview by dual camera, to obtain depth map, and present in preview interface of taking pictures Take pictures preview image;Wherein, described depth map is corresponding with the preview image of taking pictures of display in preview interface of taking pictures.
Further, while obtaining the original photo of user's shooting, also include: the photographing instruction of user detected Time, the current depth map obtained of storage is as the depth map corresponding with described original photo.
Further, it is processed as red blue 3-D effect, with life the described target in described original photo being processed object After becoming the 3-d photographs corresponding with described original photo, also include: according to setting coding rule, described 3-d photographs is carried out Video coding, to generate 3 D video.
Accordingly, as it is shown on figure 3, the 3-d photographs generation method that the embodiment of the present invention three provides may include that
S310, carry out taking pictures preview by dual camera, to obtain depth map, and presents in preview interface of taking pictures and takes pictures Preview image, wherein, described depth map is corresponding with the preview image of taking pictures of display in preview interface of taking pictures.
In the present embodiment, the preview image of taking pictures presented in preview interface of taking pictures can be to be clapped by some photographic head The preview image taken the photograph, it is also possible to be that the preview image presented in two photographic head is synthesized the preview image obtained.Consider Accuracy and the clarity of preview image of taking pictures is presented in preview interface of taking pictures, optionally, can be in preview interface of taking pictures What middle displaying obtained after synthesizing the preview image that two photographic head are presented take pictures preview image.Exemplary, obtaining During the corresponding depth map of the preview image of taking pictures that takes and present in preview interface of taking pictures, can be by dual camera to same scape Thing picture is carried out taking pictures preview, according to the angle changing value of the same scenery presented in two photographic head and two photographic head it Between distance obtain the range information of this scenery and cam lens, thus obtain and the taking pictures of display in this preview interface of taking pictures The depth map that preview image is corresponding.
S320, when the photographing instruction of user being detected, according to the photographing instruction of user, obtain the original photograph of user's shooting Sheet, and store the current depth map obtained as the depth map corresponding with described original photo.
In the present embodiment, depth map can be stored in the position identical or different with original photo, is not restricted.Show Example, when depth map is stored in identical position with original photo, can be corresponding with this original image by original image Depth map one_to_one corresponding storage;When depth map is stored in different positions from original photo, can store at the two Time, corresponding relation of the two storage position of foundation, or set up the corresponding relation of depth map and original photo, so that it is guaranteed that according to The storage position of original photo or original photo can get soon the depth map corresponding with this original photo or with this The storage position of the depth map that original photo is corresponding.
The depth map that S330, basis are corresponding with described original photo, identifies that the target that described original photo includes processes Object.
S340, the described target in described original photo is processed object it is processed as red blue 3-D effect, to generate and institute State the 3-d photographs that original photo is corresponding.
S350, according to set coding rule, described 3-d photographs is carried out Video coding, to generate 3 D video.
In the present embodiment, coding rule can set the most flexibly, is not restricted.Exemplary, to three When dimension photo carries out Video coding, can encode according to the shooting order of the original photo corresponding with this 3-d photographs, or Person, it is also possible to according to the coding of each frame by the two-dimensional video formed that the original photo corresponding with this 3-d photographs is frame of video Order encodes.
The 3-d photographs that the embodiment of the present invention three provides generates method, is clapped same scenery picture by dual camera Take the photograph, with the depth map that the preview image of taking pictures that obtains with present in preview interface of taking pictures is corresponding, deposit according to the photographing instruction of user The storage preview image of taking pictures presented in preview interface of currently taking pictures is Original Photo photo, and store the current depth map obtained as with The depth map that this original photo is corresponding, automatically processes original photo as tool with depth map according to this most corresponding original photo There is the 3-d photographs of red blue 3-D effect, if captured original photo is a certain frame in video, then according to the coding set Rule carries out Video coding to generate 3 D video to each 3-d photographs.The present embodiment is by using technique scheme, once The i.e. available depth map corresponding with shooting photo of shooting, it is possible to automatically generate 3-d photographs/3 D video, it is not necessary to artificially choose Need the target carrying out three-dimensional process to process object, behaviour required during generation 3-d photographs/3 D video can be efficiently reduced Make step and time, reduce artificial participation when generating 3-d photographs/3 D video, improve generated 3-d photographs/three-dimensional The real-time of video.
Embodiment four
The structured flowchart of a kind of 3-d photographs generating means that Fig. 4 provides for the embodiment of the present invention four.This device can be by soft Part and/or hardware realize, and typically can be integrated in photographing device, and wherein, described photographing device can include digital camera, intelligence Energy mobile phone and panel computer etc., can generate 3-d photographs by performing 3-d photographs generation method.As shown in Figure 4, this dress Put and include:
Original photo acquisition module 410, for the photographing instruction according to user, obtains the original photo of user's shooting;
Target processes object identification module 420, for according to the depth map corresponding with described original photo, identifying described former The target that beginning photo includes processes object;
3-d photographs generation module 430, is processed as red indigo plant for the described target in described original photo is processed object 3-D effect, to generate the 3-d photographs corresponding with described original photo.
The 3-d photographs generating means that the embodiment of the present invention provides, by original photo acquisition module taking pictures according to user Instruction obtains the original photo of user's shooting, processes object identification module according to the depth of field corresponding with this original photo by target Figure identifies that the target comprised in this original photo processes object, by 3-d photographs generation module by the target in original photo Reason object is processed as red blue 3-D effect, thus generates the 3-d photographs corresponding with this original photo.The present embodiment is by using Technique scheme, it is possible to automatically generate 3-d photographs, it is not necessary to artificially choose and need the target carrying out three-dimensional process to process object, Operating procedure required when generating 3-d photographs and time can be efficiently reduced, reduce artificial ginseng during generated 3-d photographs With degree, improve the real-time of generated 3-d photographs.
Further, described 3-d photographs generating means also includes: depth map acquisition module, in the bat according to user According to instruction, before obtaining the original photo of user's shooting, carried out taking pictures preview by dual camera, to obtain depth map, and Preview interface of taking pictures presents preview image of taking pictures;Wherein, described depth map and the preview of taking pictures of display in preview interface of taking pictures Image is corresponding.
Further, described 3-d photographs generating means also includes: depth map memory module, in the bat according to user According to instruction, while obtaining the original photo of user's shooting, when the photographing instruction of user being detected, the current scape obtained of storage Deep figure is as the depth map corresponding with described original photo.
Further, described target process object identification module 420 include: depth of view information acquiring unit, for obtain with The depth of view information of each image slices vegetarian refreshments in the depth map that original photo is corresponding, wherein, described depth of view information includes image pixel Range information between subject and the cam lens of some association;Group pixels determines unit, for by range information it Between difference meet set threshold condition image slices vegetarian refreshments collect in same group pixels;Target processes object identification list Unit, processes object for image pixel coordinates continuous print pixel in each group pixels is identified as described target.
Further, described 3-d photographs generation module 430 includes: contour pixel coordinate acquiring unit, for according to institute State target and process the image pixel coordinates scope of object, obtain the wire-frame image corresponding with the contour of object of described target process object Element coordinate;First red blue channel separative element, for by target picture corresponding with described contour pixel coordinate for described original photo Vegetarian refreshments is replicated in synthesis copy, and each pixel in described synthesis copy retains the component value of GB passage;Second red indigo plant Channel separation unit, in described original photo, retains R by the target pixel points corresponding with described contour pixel coordinate and leads to The component value in road;3-d photographs signal generating unit, for merging described synthesis copy with described original photo, with by described Target processes object and is processed as red blue 3-D effect.
Further, described 3-d photographs signal generating unit specifically for: by described synthesis copy each pixel translate After setting offset distance, merge with described original photo, so that described target process object is processed as red blue 3-D effect.
Further, described 3-d photographs generating means also includes:
Relative distance determines unit, is used for before being merged with described original photo by described synthesis copy, according to The depth map corresponding with described original photo, determine described target process between object and described cam lens relative away from From;Offset distance determines unit, for according to described relative distance, determines described offset distance.
Further, described 3-d photographs generating means also includes: 3 D video generation module, for by described original Described target in photo processes object and is processed as red blue 3-D effect, to generate the 3-d photographs corresponding with described original photo Afterwards, according to setting coding rule, described 3-d photographs is carried out Video coding, to generate 3 D video.
The said goods can perform the method that any embodiment of the present invention is provided, and possesses the corresponding functional module of execution method And beneficial effect.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious change, Readjust and substitute without departing from protection scope of the present invention.Therefore, although by above example, the present invention is carried out It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also Other Equivalent embodiments more can be included, and the scope of the present invention is determined by scope of the appended claims.

Claims (16)

1. a 3-d photographs generates method, it is characterised in that including:
According to the photographing instruction of user, obtain the original photo of user's shooting;
According to the depth map corresponding with described original photo, identify that the target that described original photo includes processes object;
Described target in described original photo is processed object and is processed as red blue 3-D effect, to generate and described original photo Corresponding 3-d photographs.
Method the most according to claim 1, it is characterised in that at the photographing instruction according to user, obtain user's shooting Before original photo, also include:
Carried out taking pictures preview by dual camera, to obtain depth map, and present, in preview interface of taking pictures, preview image of taking pictures;
Wherein, described depth map is corresponding with the preview image of taking pictures of display in preview interface of taking pictures.
Method the most according to claim 2, it is characterised in that at the photographing instruction according to user, obtain user's shooting While original photo, also include:
When the photographing instruction of user being detected, the current depth map obtained of storage is as the depth of field corresponding with described original photo Figure.
Method the most according to claim 1, it is characterised in that according to the depth map corresponding with described original photo, identifies The target that described original photo includes processes object and includes:
Obtain the depth of view information of each image slices vegetarian refreshments in the depth map corresponding with original photo, wherein, described depth of view information is wrapped Include the range information between subject and the cam lens of image slices vegetarian refreshments association;
The image slices vegetarian refreshments that difference between range information meets setting threshold condition collects in same group pixels;
Image pixel coordinates continuous print pixel in each group pixels is identified as described target and processes object.
Method the most according to claim 4, it is characterised in that the described target in described original photo is processed at object Reason is red blue 3-D effect, includes with the generation 3-d photographs corresponding with described original photo:
Process the image pixel coordinates scope of object according to described target, obtain and the contour of object pair of described target process object The contour pixel coordinate answered;
The target pixel points that described original photo is corresponding with described contour pixel coordinate is replicated in synthesis copy, and by described Each pixel in synthesis copy retains the component value of GB passage;
In described original photo, the target pixel points corresponding with described contour pixel coordinate is retained the component value of R passage;
Described synthesis copy is merged with described original photo, described target process object to be processed as red blue three-dimensional effect Really.
Method the most according to claim 5, it is characterised in that described synthesis copy is merged with described original photo Including:
Each pixel in described synthesis copy is translated after setting offset distance, merge with described original photo.
Method the most according to claim 6, it is characterised in that described synthesis copy is being closed with described original photo And before, also include:
According to the depth map corresponding with described original photo, determine that described target processes between object and described cam lens Relative distance;
According to described relative distance, determine described offset distance.
Method the most according to claim 1, it is characterised in that the described target in described original photo is being processed object It is processed as red blue 3-D effect, after generating the 3-d photographs corresponding with described original photo, also includes:
According to setting coding rule, described 3-d photographs is carried out Video coding, to generate 3 D video.
9. a 3-d photographs generating means, it is characterised in that including:
Original photo acquisition module, for the photographing instruction according to user, obtains the original photo of user's shooting;
Target processes object identification module, for according to the depth map corresponding with described original photo, identifying described original photo The target included processes object;
3-d photographs generation module, is processed as red blue three-dimensional effect for the described target in described original photo processes object Really, to generate the 3-d photographs corresponding with described original photo.
Device the most according to claim 9, it is characterised in that also include:
Depth map acquisition module, at the photographing instruction according to user, before obtaining the original photo of user's shooting, by double Photographic head is carried out taking pictures preview, to obtain depth map, and presents, in preview interface of taking pictures, preview image of taking pictures;
Wherein, described depth map is corresponding with the preview image of taking pictures of display in preview interface of taking pictures.
11. devices according to claim 10, it is characterised in that also include:
Depth map memory module, at the photographing instruction according to user, while obtaining the original photo of user's shooting, in inspection When measuring the photographing instruction of user, the current depth map obtained of storage is as the depth map corresponding with described original photo.
12. devices according to claim 9, it is characterised in that described target processes object identification module and includes:
Depth of view information acquiring unit, for obtaining the depth of view information of each image slices vegetarian refreshments in the depth map corresponding with original photo, Wherein, described depth of view information includes the range information between subject and the cam lens that image slices vegetarian refreshments associates;
Group pixels determines unit, collects for the difference between range information meets the image slices vegetarian refreshments setting threshold condition In same group pixels;
Target processes object identification unit, described for being identified as by image pixel coordinates continuous print pixel in each group pixels Target processes object.
13. devices according to claim 12, it is characterised in that described 3-d photographs generation module includes:
Contour pixel coordinate acquiring unit, for processing the image pixel coordinates scope of object according to described target, obtains and institute State the contour pixel coordinate that the contour of object of target process object is corresponding;
First red blue channel separative element, for by target pixel points corresponding with described contour pixel coordinate for described original photo It is replicated in synthesis copy, and each pixel in described synthesis copy is retained the component value of GB passage;
Second red blue channel separative element, in described original photo, by the target corresponding with described contour pixel coordinate Pixel retains the component value of R passage;
3-d photographs signal generating unit, for merging described synthesis copy with described original photo, with by described target Reason object is processed as red blue 3-D effect.
14. devices according to claim 13, it is characterised in that described 3-d photographs signal generating unit specifically for:
Each pixel in described synthesis copy is translated after setting offset distance, merge with described original photo, to incite somebody to action Described target processes object and is processed as red blue 3-D effect.
15. devices according to claim 14, it is characterised in that also include:
Relative distance determines unit, for before described synthesis copy and described original photo are merged, according to institute State the depth map that original photo is corresponding, determine that described target processes the relative distance between object and described cam lens;
Offset distance determines unit, for according to described relative distance, determines described offset distance.
16. devices according to claim 9, it is characterised in that also include:
3 D video generation module, for being processed as red blue three-dimensional effect by the described target process object in described original photo Really, after generating the 3-d photographs corresponding with described original photo, according to setting coding rule, described 3-d photographs is carried out Video coding, to generate 3 D video.
CN201610623819.2A 2016-08-02 2016-08-02 3-d photographs generates method and apparatus Withdrawn CN106296574A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610623819.2A CN106296574A (en) 2016-08-02 2016-08-02 3-d photographs generates method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610623819.2A CN106296574A (en) 2016-08-02 2016-08-02 3-d photographs generates method and apparatus

Publications (1)

Publication Number Publication Date
CN106296574A true CN106296574A (en) 2017-01-04

Family

ID=57664147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610623819.2A Withdrawn CN106296574A (en) 2016-08-02 2016-08-02 3-d photographs generates method and apparatus

Country Status (1)

Country Link
CN (1) CN106296574A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108495032A (en) * 2018-03-26 2018-09-04 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN109068063A (en) * 2018-09-20 2018-12-21 维沃移动通信有限公司 A kind of processing of 3 d image data, display methods, device and mobile terminal
WO2019084780A1 (en) * 2017-10-31 2019-05-09 深圳市柔宇科技有限公司 Method and apparatus for capturing 3d image, photography terminal, and computer readable storage medium
CN110068933A (en) * 2019-04-19 2019-07-30 陈少康 A kind of production method of the red indigo plant 3D stereotome shown based on grating
WO2019161717A1 (en) * 2018-02-23 2019-08-29 中兴通讯股份有限公司 Method and device for generating raster image, and storage medium
CN110288522A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Picture processing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1945625A (en) * 2006-10-23 2007-04-11 华为技术有限公司 Realizing method for forming three dimension image and terminal device
CN103501433A (en) * 2013-09-26 2014-01-08 深圳市掌网立体时代视讯技术有限公司 Method and device for displaying 3D (Three-Dimensional) painting and calligraphy
CN104503199A (en) * 2014-11-11 2015-04-08 张伟华 Technique for photographing and fabricating children's 3D picture book
CN204904359U (en) * 2015-08-25 2015-12-23 上海集成电路研发中心有限公司 Three -dimensional depth of field recognition device based on two cameras
CN105306921A (en) * 2014-06-18 2016-02-03 中兴通讯股份有限公司 Three-dimensional photo shooting method based on mobile terminal and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1945625A (en) * 2006-10-23 2007-04-11 华为技术有限公司 Realizing method for forming three dimension image and terminal device
CN103501433A (en) * 2013-09-26 2014-01-08 深圳市掌网立体时代视讯技术有限公司 Method and device for displaying 3D (Three-Dimensional) painting and calligraphy
CN105306921A (en) * 2014-06-18 2016-02-03 中兴通讯股份有限公司 Three-dimensional photo shooting method based on mobile terminal and mobile terminal
CN104503199A (en) * 2014-11-11 2015-04-08 张伟华 Technique for photographing and fabricating children's 3D picture book
CN204904359U (en) * 2015-08-25 2015-12-23 上海集成电路研发中心有限公司 Three -dimensional depth of field recognition device based on two cameras

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
梦寻: "摄影中的二次对焦魔法", 《电脑爱好者》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019084780A1 (en) * 2017-10-31 2019-05-09 深圳市柔宇科技有限公司 Method and apparatus for capturing 3d image, photography terminal, and computer readable storage medium
WO2019161717A1 (en) * 2018-02-23 2019-08-29 中兴通讯股份有限公司 Method and device for generating raster image, and storage medium
CN108495032A (en) * 2018-03-26 2018-09-04 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN108495032B (en) * 2018-03-26 2020-08-04 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN109068063A (en) * 2018-09-20 2018-12-21 维沃移动通信有限公司 A kind of processing of 3 d image data, display methods, device and mobile terminal
CN110068933A (en) * 2019-04-19 2019-07-30 陈少康 A kind of production method of the red indigo plant 3D stereotome shown based on grating
CN110068933B (en) * 2019-04-19 2021-06-01 陈少康 Manufacturing method of red and blue 3D (three-dimensional) picture based on grating display
CN110288522A (en) * 2019-06-28 2019-09-27 北京金山安全软件有限公司 Picture processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107087107B (en) Image processing apparatus and method based on dual camera
US10540806B2 (en) Systems and methods for depth-assisted perspective distortion correction
CN106296574A (en) 3-d photographs generates method and apparatus
EP3457683B1 (en) Dynamic generation of image of a scene based on removal of undesired object present in the scene
US10410397B2 (en) Picture presentation method and apparatus
US10269130B2 (en) Methods and apparatus for control of light field capture object distance adjustment range via adjusting bending degree of sensor imaging zone
WO2018047687A1 (en) Three-dimensional model generating device and three-dimensional model generating method
JP2011166264A (en) Image processing apparatus, imaging device and image processing method, and program
JP6257285B2 (en) Compound eye imaging device
CN108024058B (en) Image blurs processing method, device, mobile terminal and storage medium
CN110276831B (en) Method and device for constructing three-dimensional model, equipment and computer-readable storage medium
JP2015156054A (en) Image processor and control method thereof
CN112261292B (en) Image acquisition method, terminal, chip and storage medium
CN106887043A (en) The method of the method, device and three-dimensional modeling of the removal of three-dimensional modeling exterior point
CN110278366B (en) Panoramic image blurring method, terminal and computer readable storage medium
CN110443228B (en) Pedestrian matching method and device, electronic equipment and storage medium
CN111105370A (en) Image processing method, image processing apparatus, electronic device, and readable storage medium
EP3496042A1 (en) System and method for generating training images
CN110288707B (en) Three-dimensional dynamic modeling method and system
CN116456191A (en) Image generation method, device, equipment and computer readable storage medium
CN116051736A (en) Three-dimensional reconstruction method, device, edge equipment and storage medium
CN109360176A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN109582811B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP7458723B2 (en) Image processing device, imaging device, control method, and program
JP5713256B2 (en) Image processing apparatus, imaging apparatus, and image processing program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20170104