CN107820071A - Mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium - Google Patents

Mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium Download PDF

Info

Publication number
CN107820071A
CN107820071A CN201711195602.7A CN201711195602A CN107820071A CN 107820071 A CN107820071 A CN 107820071A CN 201711195602 A CN201711195602 A CN 201711195602A CN 107820071 A CN107820071 A CN 107820071A
Authority
CN
China
Prior art keywords
width
horizontal parallax
mobile terminal
pixel
image
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.)
Pending
Application number
CN201711195602.7A
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.)
SuperD Co Ltd
Shenzhen Super Technology Co Ltd
Original Assignee
Shenzhen Super Technology 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 Shenzhen Super Technology Co Ltd filed Critical Shenzhen Super Technology Co Ltd
Priority to CN201711195602.7A priority Critical patent/CN107820071A/en
Publication of CN107820071A publication Critical patent/CN107820071A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images

Abstract

The invention discloses a kind of mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium, the described method comprises the following steps:The image sets gathered by dual camera are obtained, image sets include two width original images;Determine whether two width original images have horizontal parallax;When two width original images do not have horizontal parallax, the two width anaglyphs with horizontal parallax are obtained according to two width original images;The two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture.So as to so that mobile terminal can also shoot stereo-picture under nonspecific posture, extend shooting posture during mobile terminal shooting stereo-picture, enrich the angle coverage of stereo-picture, improve the shooting experience of user.

Description

Mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium
Technical field
The present invention relates to stereo display technique field, more particularly, to a kind of mobile terminal and its stereoscopic imaging method, dress Put and computer-readable recording medium.
Background technology
With the popularization of the mobile terminals such as mobile phone, flat board, the work and life of people is more and more convenient.Mobile terminal is not only It can be used for making a phone call, surfing the Net, seeing a film, can also be used to shoot photo, be convenient for people to record life whenever and wherever possible Drop.In order to lift shooting experience, shooting stereo images function is introduced on some mobile terminals at present, i.e., on mobile terminals Two cameras (i.e. binocular camera, abbreviation dual camera) are installed, two width original images are shot by two cameras, and will The splicing of two width original images synthesizes stereo-picture.Mobile terminal can be directly based upon the stereo-picture on its stereoscopic display screen Stereoscopic display is carried out, stereo-picture can also be sent to the stereoscopic display screen of exterior of terminal and carry out stereoscopic display.
It is, in principle, that shooting stereo-picture when carrying out stereoscopic display, it is necessary to splice two width original images of synthesis With horizontal parallax, preferable stereoeffect can be just showed, otherwise stereoeffect will be very poor even without stereoeffect.This Just needing dual camera, the line of centres of two cameras must be parallel with horizontal line, shoots arranged side by side in shooting Two width original images, such two width original image just have horizontal parallax.
However, the arrangement position of two cameras on mobile terminals is fixed, this allows for mobile terminal must be Shot under particular pose, can just shoot stereo-picture so that mobile terminal shoot stereo-picture when shooting posture by To limitation, and cause the angle coverage of stereo-picture single, have a strong impact on the shooting experience of user.
The content of the invention
The main purpose of the embodiment of the present invention is to provide a kind of mobile terminal and its stereoscopic imaging method, device and calculating Machine readable storage medium storing program for executing, it is intended to solve the technical problem that mobile terminal must can just shoot stereo-picture under particular pose.
To achieve these objectives, the embodiment of the present invention proposes a kind of stereoscopic imaging method for mobile terminal, the movement Dual camera is provided with terminal, the described method comprises the following steps:
The image sets gathered by the dual camera are obtained, described image group includes two width original images;
Determine whether the two width original image has horizontal parallax;
When the two width original image does not have horizontal parallax, obtained according to the two width original image and regarded with level Two width anaglyphs of difference;
The two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture.
Alternatively, it is described to determine whether the two width original image includes with horizontal parallax:
Determine the IMAQ posture of the mobile terminal;
Posture is gathered according to described image, determines whether the two width original image has horizontal parallax;
Or
Obtain at least one pair of same place in the two width original image;
According to positional information of at least one pair of the described same place in the two width original image, determine described two it is original Whether image has horizontal parallax;
Or
Determine the arrangement mode of the two width original image;
According to the arrangement mode, determine whether the two width original image has horizontal parallax.
Alternatively, the two width anaglyphs with horizontal parallax that obtained according to the two width original image include:
Two width original image described in rotating Vortex, so that the two images obtained after rotation have first level parallax;
According to the two images obtained after rotation, depth map corresponding with the two images obtained after rotation is generated;
Piece image is selected from the two width original image as reference chart, according to the reference chart and the depth map Generation has the virtual graph of horizontal parallax with the reference chart;
It is described the two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture to include:
The reference chart and virtual graph splicing are synthesized into a width stereo-picture.
Alternatively, it is described according to the two images obtained after rotation, generate corresponding with the two images obtained after rotation Depth map includes:
Registration process is carried out to the two images obtained after rotation;
Stereo matching is carried out to the two images after registration process, obtains the depth map.
Alternatively, the two images obtained after described pair of rotation, which carry out registration process, to be included:
Obtain the acquisition parameters of the dual camera;
According to the acquisition parameters, the two images obtained after rotation are carried out with distortion correction, and to distortion correction after Two images carry out alignment and cut.
Alternatively, also include after described the step of obtaining the depth map:The depth map is carried out at edge-smoothing Reason.
Alternatively, the void with the reference chart according to the reference chart and depth map generation with horizontal parallax Plan figure includes:
The depth map is traveled through, obtains the depth bounds of the depth map;
According to the depth bounds of the depth map and default horizontal parallax adjusting range, depth value and horizontal parallax are established The corresponding relation of adjusted value;
A width virtual graph is built, according to the corresponding relation of the depth value and horizontal parallax adjusted value by the reference chart Each pixel-map into the virtual graph.
Alternatively, the corresponding relation according to the depth value and horizontal parallax adjusted value will be every in the reference chart One pixel-map includes to the virtual graph:
The depth of the pixel is found in the depth map according to the position coordinates of each pixel in the reference chart Value;
According to calculating the corresponding relation of the depth value of the pixel and the depth value and horizontal parallax adjusted value The horizontal parallax adjusted value of pixel;
Obtained newly in the abscissa for the position coordinates that the horizontal parallax adjusted value of the pixel is added into the pixel Position coordinates;
The pixel is added to the position corresponding to position coordinates new described in the virtual graph.
Alternatively, the void with the reference chart according to the reference chart and depth map generation with horizontal parallax Also include after the step of plan figure:
The reference chart and the virtual graph are carried out cutting processing;
It is described that the reference chart and virtual graph splicing are synthesized a width stereo-picture and included:
The reference chart after handling will be cut and virtual graph splicing synthesizes a width stereo-picture.
Alternatively, it is described the reference chart and the virtual graph are carried out cutting processing include:
By region corresponding with the Non-overlapping Domain in the two width original image in the reference chart and the virtual graph Cut.
Alternatively, the described the step of two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture it Also include afterwards:Bore hole stereoscopic display is carried out based on the stereo-picture.
The embodiment of the present invention proposes a kind of stereoscopic imaging apparatus for mobile terminal simultaneously, and described device includes:
First acquisition module, for obtaining the image sets gathered by the dual camera, described image group includes two width Original image;
Parallax determining module, for determining whether the two width original image has horizontal parallax;
Second acquisition module, it is original according to described two for when the two width original image does not have horizontal parallax Image obtains the two width anaglyphs with horizontal parallax;
Image synthesis unit, for the two width anaglyphs with horizontal parallax to be synthesized into a width stereo-picture.
Alternatively, the parallax determining module is used for:
Determine the IMAQ posture of the mobile terminal;According to described image gather posture, determine described two it is original Whether image has horizontal parallax;Or
Obtain at least one pair of same place in the two width original image;According at least one pair of described same place described two Positional information in width original image, determines whether the two width original image has horizontal parallax;Or
Determine the arrangement mode of the two width original image;According to the arrangement mode, the two width original image is determined Whether there is horizontal parallax.
Alternatively, second acquisition module includes:
Image rotation unit, for two width original image described in rotating Vortex, so that the two images tool obtained after rotation There is first level parallax;
Depth map generating unit, for according to the two images obtained after rotation, generation and the two width figures obtained after rotation The depth map as corresponding to;
Virtual graph generation unit, for selecting piece image from the two width original image as reference chart, according to institute Stating reference chart and depth map generation has the virtual graph of horizontal parallax with the reference chart;
Described image synthesis module is used for:The reference chart and virtual graph splicing are synthesized into a width stereo-picture.
Alternatively, the depth map generating unit includes:
Registration process unit, for carrying out registration process to the two images obtained after rotation;
Stereo matching unit, for carrying out Stereo matching to the two images after registration process, obtain the depth map.
Alternatively, the registration process unit is used for:
Obtain the acquisition parameters of the dual camera;According to the acquisition parameters, the two images obtained after rotation are entered Line distortion corrects, and carries out alignment to the two images after distortion correction and cut.
Alternatively, second acquisition module also includes depth map optimization unit, and it is used for:Side is carried out to the depth map Edge smoothing processing.
Alternatively, the virtual graph generation unit includes:
Depth acquiring unit, for traveling through the depth map, obtain the depth bounds of the depth map;
Relation establishes unit, is established for the depth bounds according to the depth map and default horizontal parallax adjusting range The corresponding relation of depth value and horizontal parallax adjusted value;
Pixel-map unit, it is corresponding with horizontal parallax adjusted value according to the depth value for building a width virtual graph Relation is by each pixel-map in the reference chart into the virtual graph.
Alternatively, the pixel-map unit includes:
Depth value searches subelement, for the position coordinates according to each pixel in the reference chart in the depth map In find the depth value of the pixel;
Adjustment calculation subelement, for the depth value according to the pixel and the depth value and horizontal parallax adjusted value Corresponding relation calculate the horizontal parallax adjusted value of the pixel;
New coordinate obtains subelement, and the position for the horizontal parallax adjusted value of the pixel to be added to the pixel is sat New position coordinates is obtained in target abscissa;
Pixel adds subelement, for the pixel to be added to corresponding to position coordinates new described in the virtual graph Position.
Alternatively, second acquisition module also includes cutting processing unit, and the processing unit that cuts is used for:To described Reference chart and the virtual graph carry out cutting processing;
Described image synthesis module is used for:The reference chart after handling will be cut and virtual graph splicing synthesizes one Width stereo-picture.
Alternatively, the processing unit that cuts is used for:
By region corresponding with the Non-overlapping Domain in the two width original image in the reference chart and the virtual graph Cut.
Alternatively, described device also includes stereo display module, and the stereo display module is used for:Based on the stereogram As carrying out bore hole stereoscopic display.
The embodiment of the present invention proposes a kind of mobile terminal simultaneously, and the mobile terminal includes dual camera, memory, processing Device and at least one it be stored in the memory and be configured as by the application program of the computing device, the application Program is configurable for performing the stereoscopic imaging method of aforementioned mobile terminal.
The embodiment of the present invention also proposes a kind of computer-readable recording medium, is stored on the computer-readable recording medium There is three-dimensional imaging program, when the three-dimensional imaging program is executed by processor, realize the stereoscopic imaging method of aforementioned mobile terminal The step of.
Mobile terminal and its stereoscopic imaging method, device and the computer-readable storage medium that the embodiment of the present invention is provided Matter, by determining whether the two width original images that dual camera gathers have horizontal parallax, then root when without horizontal parallax The two width anaglyphs with horizontal parallax are obtained according to two width original images, and the two width anaglyphs with horizontal parallax are closed As a width stereo-picture, so that mobile terminal can also shoot stereo-picture under nonspecific posture, extend Mobile terminal shoots shooting posture during stereo-picture, enriches the angle coverage of stereo-picture, improves the shooting body of user Test.
Brief description of the drawings
Fig. 1 is the flow chart of the embodiment of stereoscopic imaging method one for mobile terminal of the present invention;
Fig. 2 a are that mobile terminal is shot using rear camera using longitudinal direction shooting posture in the embodiment of the present invention Schematic diagram;
Fig. 2 b are that mobile terminal is shot using rear camera using laterally shooting posture in the embodiment of the present invention Schematic diagram;
Fig. 3 a are that mobile terminal is shot using front camera using longitudinal direction shooting posture in the embodiment of the present invention Schematic diagram;
Fig. 3 b are that mobile terminal is shot using front camera using laterally shooting posture in the embodiment of the present invention Schematic diagram;
Fig. 4 is the schematic diagram of two width original image laid out in parallel in image sets in the embodiment of the present invention;
Fig. 5 is the schematic diagram arranged side by side of two width original images in the embodiment of the present invention in image sets;
Fig. 6 is the particular flow sheet of step S14 in Fig. 1;
Fig. 7 is will be every in reference chart according to the corresponding relation of depth value and horizontal parallax adjusted value in the embodiment of the present invention Particular flow sheet of one pixel-map to the step in virtual graph;
Fig. 8 is the module diagram of the embodiment of stereoscopic imaging apparatus one for mobile terminal of the present invention;
Fig. 9 is the module diagram of the parallax determining module in Fig. 8;
Figure 10 is the another module diagram of the parallax determining module in Fig. 8;
Figure 11 is the module diagram of the second acquisition module in Fig. 8;
Figure 12 is the module diagram of the depth map generating unit in Figure 11;
Figure 13 is the module diagram of the virtual graph generation unit in Figure 11;
Figure 14 is the module diagram of the pixel-map unit in Figure 13;
The another module diagram of virtual graph generation unit in Figure 15 Figure 11;
Figure 16 is the another module diagram of the second acquisition module in Fig. 8.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention. Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, Obviously, described embodiment is only the part of the embodiment of the present invention, rather than whole embodiments.Based in the present invention Embodiment, the every other embodiment that those of ordinary skill in the art are obtained under the premise of creative work is not made, Belong to the scope of protection of the invention.
It is to be appreciated that the directional instruction (such as up, down, left, right, before and after ...) of institute is only used in the embodiment of the present invention In explaining the relative position relation under a certain particular pose (as shown in drawings) between each part, motion conditions etc., if should When particular pose changes, then directionality instruction also correspondingly changes therewith.
In addition, the description for being related to " first ", " second " etc. in the present invention is only used for describing purpose, and it is not intended that referring to Show or imply its relative importance or imply the quantity of the technical characteristic indicated by indicating.Thus, " first ", " are defined At least one this feature can be expressed or be implicitly included to two " feature.In addition, the technical scheme between each embodiment can To be combined with each other, but must can be implemented as basis with those of ordinary skill in the art, when the combination of technical scheme occurs It is conflicting or will be understood that the combination of this technical scheme is not present when can not realize, also not in the protection model of application claims Within enclosing.
The stereoscopic imaging method for mobile terminal of the embodiment of the present invention, it can be mobile phone, flat board to say mobile terminal The intelligent terminals such as computer, or the terminal device such as PC, notebook computer, digital camera, list can also be applied to The picture pick-up devices such as anti-phase machine.Dual camera is provided with the mobile terminal, the dual camera is used for the shooting for carrying out stereo-picture.
In addition, being also provided with three-dimensional display on the mobile terminal, bore hole stereoscopic display can be carried out.The three-dimensional display The light-splitting device of display panel and setting on a display panel is generally included, it is first when mobile terminal carries out bore hole stereoscopic display Row's figure is first carried out to stereo-picture, i.e., is pressed the left-eye image (abbreviation left figure) in stereo-picture and eye image (abbreviation right figure) According to certain regularly arranged display on a display panel, while the light splitting for being equipped with light-dividing device on a display panel acts on, Left-eye image is sent into the left eye of user, eye image is sent into the right eye of user, so that user watches 3D images.
Referring to Fig. 1, propose the embodiment of stereoscopic imaging method one for mobile terminal of the present invention, methods described including with Lower step:
S11, the image sets gathered by dual camera are obtained, the image sets include two width original images.
In the embodiment of the present invention, dual camera is provided with mobile terminal, dual camera can be front camera, also may be used To be rear camera.Dual camera can laterally be arranged along mobile terminal, can also be along mobile terminal longitudinal arrangement.
As shown in Figure 2 a, a mobile terminal has two rear cameras along mobile terminal longitudinal arrangement, such as Fig. 3 a institutes Show, a mobile terminal has two front cameras laterally arranged along mobile terminal.In other embodiments, rear camera Can also laterally it be arranged along mobile terminal, front camera can also be along mobile terminal longitudinal arrangement.
When mobile terminal is by dual camera shooting image, each camera gathers a width original image, so as to obtain One group of image sets for including two width original images, mobile terminal can the pre-display image sets, the image sets of the pre-display can be such as Fig. 4 Or shown in Fig. 5.Usual terminal system can correspond to the pre-display image sets according to the arrangement mode of camera during collection, wherein, Fig. 4 Shown image sets include the two width original image up and down of laid out in parallel, and this two width original image is by above and below laid out in parallel What two camera shootings simultaneously obtained;Image sets shown in Fig. 5 include the width original image of left and right two arranged side by side, and this two Width original image is obtained by the camera of left and right two arranged side by side shooting simultaneously.This two width original image is respectively original Eye image and original left-eye image.
S12, determine whether two width original images have horizontal parallax.
In the embodiment of the present invention, mobile terminal can determine whether two width original images regard with level in the following manner Difference:
Alternatively, first determine mobile terminal IMAQ posture, then according to IMAQ posture determine two it is original Whether image has horizontal parallax.
It is understood that the layout structure of the dual camera of mobile terminal is known, then, which kind of figure mobile terminal is As dual camera is horizontally arranged also to understand during collection posture, i.e. mobile terminal for which kind of IMAQ posture when, two width are former Beginning image is that have also understanding for horizontal parallax, then can be according to the IMAQ posture of mobile terminal, to determine two width original graphs Seem no there is horizontal parallax.
In an alternative embodiment, mobile terminal judges whether the IMAQ posture of this terminal is preset posture;When for During preset posture, then adjudicating two width original images has horizontal parallax;When not being preset posture, then two width original images are adjudicated Without horizontal parallax.Certainly, vice versa.Preset posture is set according to the layout structure of the dual camera of mobile terminal It is fixed, the central junction line of the two cameras shooting posture parallel with horizontal line is typically set to preset posture, now double shootings Two width original images of head shooting are in left and right state arranged side by side, have horizontal parallax.
For example, when the mobile terminal shown in Fig. 2 a is shot using rear camera, if the IMAQ posture of terminal There is horizontal parallax for laterally shooting posture (as shown in Figure 2 b), the then two width original images for adjudicating shooting;If the figure of terminal As gathering posture as longitudinal direction shooting posture (as shown in Figure 2 a), then the two width original images for adjudicating shooting do not have horizontal parallax.
And for example, when the mobile terminal shown in Fig. 3 a is shot using front camera, if the IMAQ posture of terminal Do not have horizontal parallax for laterally shooting posture (as shown in Figure 3 b), the then two width original images for adjudicating shooting;If terminal For IMAQ posture for longitudinal direction shooting posture (as shown in Figure 3 a), then the two width original images for adjudicating shooting have horizontal parallax.
Alternatively, the arrangement mode of two width original images is first determined, determines that two width original images are further according to arrangement mode It is no that there is horizontal parallax.
In an alternative embodiment, mobile terminal judges whether the arrangement mode of two width original images in image sets is simultaneously Row arrangement, if laid out in parallel, then adjudicates two width original images and does not have horizontal parallax;If arranged side by side, then two width are adjudicated Original image has horizontal parallax.For example, mobile terminal parses the arrangement mode of two width original images, when two width original images are in During laid out in parallel state shown in Fig. 4, then adjudicate two width original images and do not have horizontal parallax;When two width original images are in Fig. 5 During shown state arranged side by side, then the two width original images for adjudicating shooting have horizontal parallax.
Alternatively, at least one pair of same place in two width original images is first obtained, further according at least one pair of same place two Positional information in width original image, determines whether two width original images have horizontal parallax.Same place refers in space one When point is by the collection of multiple cameras, the picture point that positions different on an imaging sensor is formed is projected, the form of expression is same Individual point has different coordinates on the collection picture at multiple visual angles.It can detect by existing manner in two width original images At least one pair of same place, and the pixel coordinate of the same place in each image, i.e. positional information are obtained, in order to improve accuracy rate, The average of the positional information of multipair same place can be obtained, if two images have horizontal parallax, the abscissa difference of same place A specific threshold is greater than, if conversely, two images do not have horizontal parallax, the abscissa difference of same place is less than one Specific threshold, for example, difference is 0 or close to 0.
It will be understood by those skilled in the art that in addition to this it is possible to judge to scheme using other manner of the prior art As whether two width original images in group have a horizontal parallax, the present invention will not enumerate to this to be repeated.
S13, when two width original images do not have horizontal parallax, obtained according to two width original images with horizontal parallax Two width anaglyphs.
In the embodiment of the present invention, if two width original images of dual camera collection do not have horizontal parallax, to two width Original image is handled, and obtains the two width anaglyphs with horizontal parallax.
As shown in fig. 6, the mobile specific stream that the two width anaglyphs with horizontal parallax are obtained according to two width original images Journey is as follows:
S131, the width original image of rotating Vortex two, so that the two images obtained after rotation have first level parallax.
The two width original images without horizontal parallax are directed to, usually dual camera vertical array is shot, Two images have vertical parallax, then, in this step S131, mobile terminal can distinguish two width original images counterclockwise (to the left) or counterclockwise it is rotated by 90 ° (to the right) and (allows certain error be present), after rotation, vertical parallax is adjusted to water Difference is looked squarely, that is, causes the two images obtained after rotation that there is first level parallax.
S132, according to the two images obtained after rotation, generation depth map corresponding with the two images obtained after rotating.
In the embodiment of the present invention, mobile terminal can carry out registration process to the two images obtained after rotation first, then Stereo matching is carried out to the two images after registration process, generates a width depth map.Depth can be obtained using any known mode Figure, is repeated no more here.
When carrying out registration process to two images, mobile terminal can first obtain the acquisition parameters of dual camera, then make The two images obtained after rotation are carried out with distortion correction according to acquisition parameters with StereoRectify functions, and to two width figures As being alignd, the edge of two images is carried out according to the area-of-interest (Region Of Interest, ROI) imported in advance Alignment is cut, wherein, area-of-interest is generally the overlapping region of two width original images.Foregoing acquisition parameters mainly include shooting The relevant parameters such as the internal reference of head, outer ginseng, such as the phase of two cameras such as FX, FY, PX, PY parfocal parameter, the anglec of rotation, displacement To location parameter, etc..
When carrying out Stereo matching to two images, after mobile terminal can use Stereo Matching Algorithm to registration process Two images carry out Stereo matching, obtain the depth map corresponding with two images.The Stereo Matching Algorithm can use BM algorithms that OpenCV is supported, SGBM algorithms, GC algorithms etc..
In certain embodiments, image alignment processing step can also be omitted, Stereo matching directly is carried out to two images.
Further, mobile terminal can also carry out edge-smoothing processing to depth map, to improve the solid being subsequently generated The stereoeffect of figure.Specifically, mobile terminal (can be former to two images using edge detection algorithm (such as Canny operators) Figure after figure or optimization processing) carry out rim detection, generation edge graph (Edge figures), and the edge using edge graph to depth map It is smoothed, i.e.,:Edge graph is traveled through, using each edge pixel in edge graph, with Gaussian smoothing operator (Gussian Blur Filter) respective pixel of depth map is smoothed, so that the marginal portion of depth map seems more to put down It is sliding.
S133, from two width original images select piece image be used as reference chart, according to reference chart and depth map generation and Reference chart has the virtual graph of horizontal parallax.
Wherein, when in step S131 90 degree by two width original image rotate counterclockwises, this step S133 is then by two width Original image dextrorotation, which is turn 90 degrees, reverts to original state;When two width original images are turned clockwise in step S131 At 90 degree, two 90 degree of width original image rotate counterclockwises are then reverted to original state by this step S133.When the two of image sets After width original image recovers, mobile terminal can select the width original image in image sets, and as reference chart, the reference chart can Think original left figure or original right figure.
Mobile terminal traversal depth map obtains the depth bounds of depth map, according to the depth bounds of depth map and default water The corresponding relation that poor adjusting range establishes depth value and horizontal parallax adjusted value is looked squarely, then builds a width and reference chart size phase Same virtual graph, and arrived each pixel-map in reference chart according to the corresponding relation of depth value and horizontal parallax adjusted value In virtual graph, there is the virtual graph of horizontal parallax so as to obtain a width and reference chart, the reference chart and there is level with reference chart The virtual graph of parallax be according to the two width anaglyphs with horizontal parallax that get of two width original images, further can general This two width anaglyph synthesizes stereo-picture.In stereo-picture, it is assumed that reference chart is original left figure, then reference chart is a left side Figure, virtual graph will be used as right figure.
The depth bounds of depth map is the span of depth value in depth map, and mobile terminal can travel through depth map, obtain The maximum and minimum value of the depth value of depth map are taken, using the interval range of the minimum value of depth value to maximum as depth map Depth bounds.Horizontal parallax adjusting range is the span of default horizontal parallax adjusted value, can be according to being actually needed Setting.Assuming that the depth bounds of depth map is [0,255], horizontal parallax adjusting range is [0,40], then can establish depth value The corresponding relation of the two is used as with the linear functional relation of horizontal parallax adjusted value.If depth value is x, horizontal parallax adjusted value is Y, then have:Y=kx, 255 in aforementioned depth scope are substituted into y, 40 in horizontal parallax adjusting range substitute into x, then calculate k =8/51, then the linear function expression of the two is y=(8/51) x.
In the embodiment of the present invention, mobile terminal is obtained according to the corresponding relation of depth value and horizontal parallax adjusted value and reference The idiographic flow of virtual graph of the figure with horizontal parallax is as shown in fig. 7, comprises following steps:
S101, the depth value that pixel is found according to the position coordinates of each pixel in reference chart in depth map.
Mobile terminal travels through reference chart, for each pixel P in reference chart, obtains its position coordinates (I, J), then The depth value of pixel corresponding to the position coordinates (I, J) is searched in depth map, the depth value is pixel P depth value.
S102, the water for calculating according to the depth value and depth value of pixel and the corresponding relation of horizontal parallax adjusted value pixel Look squarely poor adjusted value.
Mobile terminal substitutes into pixel P depth value in the x that aforementioned linear function expression is y=(8/51) x, it is possible to Calculate pixel P horizontal parallax adjusted value y.For example, pixel P depth value is 128, then can be according to aforementioned linear function table It is about 20 to calculate corresponding horizontal parallax adjusted value up to formula.
S103, new position will be obtained in the abscissa for the position coordinates that the horizontal parallax adjusted value of pixel is added to pixel Coordinate.
Assuming that pixel P horizontal parallax adjusted value is v, then v is added to the abscissa I of pixel P position coordinates (I, J) It is middle to obtain new position coordinates (I+v, J).
S104, pixel is added to position corresponding to position coordinates new in virtual graph.
Pixel P in reference chart is added to the position corresponding to position coordinates new in virtual graph (I+v, J) by mobile terminal Put, travel through each pixel P in reference chart, until all pixels in reference chart are added in virtual graph, due to reference Each pixel P in figure has carried out horizontal-shift in virtual graph, so that reference chart generates level with virtual graph Parallax.
S14, the two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture.
Because reference chart and virtual graph are the two width anaglyphs with horizontal parallax, thus reference chart and virtual graph is left The image synthesized after right splicing side by side just has stereoeffect, is a width stereo-picture.In general, when reference chart is in image sets Upper figure when, then using reference chart as left figure, virtual graph as right figure carry out side by side splicing synthesize;When reference chart is in image sets Figure below when, then using reference chart as right figure, virtual graph as left figure carry out side by side splicing synthesize.Certainly, the left and right of the two is closed System can also in turn, and this is not limited by the present invention.
Alternatively, due to spacing be present between two cameras of shooting image group, two width original graph in image sets is caused As some pixels on border are incomplete, i.e. the pixel of the non-overlapped pickup area of dual camera, that is, two are original The pixel of Non-overlapping Domain in image, therefore when generating depth map, the part can malfunction, and can carry out blacking to the part Processing, and blacking subregion is recorded.It is corresponding by black region is applied in reference chart and virtual graph when carrying out splicing synthesis Pixel region exclude to synthesize outside region in splicing, only take splicing in reference chart and virtual graph to synthesize region and carry out splicing conjunction Into so as to further improve the stereoeffect of the stereogram finally synthesized.
Further, can also be to virtual graph and reference after the virtual graph with reference chart with horizontal parallax is generated Figure carries out cutting processing so that the pixel filling area of the two is identical, subsequently will then cut reference chart and virtual graph after handling Splicing synthesizes a width stereo-picture, so as to improve the stereoeffect of stereo-picture.
In a preferred embodiment, mobile terminal can by reference chart and virtual graph with it is non-heavy in two width original images Region corresponding to folded region is cut.In an alternative embodiment, mobile terminal can in virtual graph relative to reference chart The part of missing carries out blacking;The part lacked in virtual graph relative to reference chart can also be entered using the pixel around it Row filling;Can also be to relative to the unnecessary part of virtual graph cut in reference chart, etc..
In the embodiment of the present invention, if two width original images of dual camera collection have horizontal parallax, according to existing Two width original images are directly directly synthesized a width stereo-picture by conventional image synthesis mode in technology.
Further, after stereo-picture is generated, mobile terminal is based on stereo-picture and carries out bore hole stereoscopic display so that uses Family can observe directly stereoeffect by bore hole.The concrete mode of bore hole stereoscopic display is same as the prior art, herein not Repeat again.
The stereoscopic imaging method for mobile terminal of the embodiment of the present invention, by determining that two width that dual camera gathers are former Whether beginning image has horizontal parallax, is then obtained when without horizontal parallax according to two width original images with horizontal parallax Two width anaglyphs, then the two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture, so that mobile whole End can also shoot stereo-picture under nonspecific posture, extend shooting appearance during mobile terminal shooting stereo-picture State, the angle coverage of stereo-picture is enriched, improve the shooting experience of user.
Using the embodiment of the present invention when being shot for mobile terminal, no matter using laterally shooting posture or longitudinal direction Posture is shot, stereo-picture can be shot, greatly enrich the angle coverage of stereo-picture, improve the shooting body of user Test.
Referring to Fig. 8, the embodiment of stereoscopic imaging apparatus one for mobile terminal of the present invention is proposed, described device includes the One acquisition module 10, parallax determining module 20, the second acquisition module 30 and image synthesis unit 40, wherein:First acquisition module 10, for obtaining the image sets gathered by the dual camera, described image group includes two width original images;Parallax determines mould Block 20, for determining whether two width original images have horizontal parallax;Second acquisition module 30, for working as two width original images not During with horizontal parallax, the two width anaglyphs with horizontal parallax are obtained according to two width original images;Image synthesis unit 40, For the two width anaglyphs with horizontal parallax to be synthesized into a width stereo-picture.
In the embodiment of the present invention, dual camera is provided with mobile terminal, dual camera can be front camera, also may be used To be rear camera.Dual camera can laterally be arranged along mobile terminal, can also be along mobile terminal longitudinal arrangement.
As shown in Figure 2 a, a mobile terminal has two rear cameras along mobile terminal longitudinal arrangement, such as Fig. 3 a institutes Show, a mobile terminal has two front cameras laterally arranged along mobile terminal.In other embodiments, rear camera Can also laterally it be arranged along mobile terminal, front camera can also be along mobile terminal longitudinal arrangement.
During dual camera shooting image, each camera gathers piece image, original including two so as to obtain one group The image sets of image, the image sets are as shown in Fig. 4 or Fig. 5.Wherein, the image sets shown in Fig. 4 include the upper and lower of laid out in parallel Two width original images, this two width original image are obtained by two camera shootings simultaneously up and down of laid out in parallel;Shown in Fig. 5 Image sets include the width original image of left and right two arranged side by side, this two width original image is by left and right two arranged side by side Camera shooting simultaneously obtains.
After the first acquisition module 10 obtains the image sets gathered by dual camera, parallax determining module 20 is then true immediately Determine whether two width original images in image sets have horizontal parallax.
In the embodiment of the present invention, parallax determining module 20 can determine whether two width original images have in the following manner Horizontal parallax:
Alternatively, parallax determining module 20 first determines the IMAQ posture of mobile terminal, then according to IMAQ appearance State determines whether two width original images have horizontal parallax.
In an alternative embodiment, parallax determining module 20 including posture judging unit 21 and first as shown in figure 9, adjudicate Unit 22, wherein:Posture judging unit 21, for judging whether IMAQ posture is preset posture;First decision unit 22, For when for preset posture when, judgement two width original images there is horizontal parallax;When not being preset posture, judgement two is original Image does not have horizontal parallax.Certainly, vice versa.Preset posture is carried out according to the layout structure of the dual camera of mobile terminal Setting, is typically set to preset posture by the central junction line of the two cameras shooting posture parallel with horizontal line, now double to take the photograph As head shoot two width original images be in left and right state arranged side by side, there is horizontal parallax.
For example, when the mobile terminal shown in Fig. 2 a is shot using rear camera, if the IMAQ posture of terminal Regarded for laterally shooting posture (as shown in Figure 2 b), the two width original images that the first decision unit 22 then adjudicates shooting with level Difference;If the IMAQ posture of terminal is longitudinal direction shooting posture (as shown in Figure 2 a), the first decision unit 22 then adjudicates shooting Two width original images do not have horizontal parallax.
And for example, when the mobile terminal shown in Fig. 3 a is shot using front camera, if the IMAQ posture of terminal Regarded for laterally shooting posture (as shown in Figure 3 b), the two width original images that the first decision unit 22 then adjudicates shooting without level Difference;If the IMAQ posture of terminal is longitudinal direction shooting posture (as shown in Figure 3 a), the first decision unit 22 then adjudicates shooting Two width original images there is horizontal parallax.
Alternatively, parallax determining module 20 first determines the arrangement mode of two width original images, is determined further according to arrangement mode Whether two width original images have horizontal parallax.
In an alternative embodiment, parallax determining module 20 is as shown in Figure 10, including arrangement judging unit 23 and second is sentenced Certainly unit 24, wherein:Arrangement judging unit 23, for judging whether the arrangement mode of two width original images in image sets is simultaneously Row arrangement;Second decision unit 24, for if laid out in parallel, then adjudicating two width original images and not having horizontal parallax;If Arranged side by side, then adjudicating two width original images has horizontal parallax.
For example, arrangement judging unit 23 parses the arrangement mode of two width original images, when two width original images are in shown in Fig. 4 Laid out in parallel state when, the second decision unit 24 then adjudicates two width original images and does not have horizontal parallax;When two width original graphs During as being in the state arranged side by side shown in Fig. 5, the two width original images that the second decision unit 24 then adjudicates shooting regard with level Difference.
Alternatively, parallax determining module 20 first obtains at least one pair of same place in two width original images, further according at least Positional information of a pair of same places in two width original images, determines whether two width original images have horizontal parallax.Same place When referring to that a point is by the collection of multiple cameras in space, the picture point that positions different on an imaging sensor is formed is projected, The form of expression is that same point has different coordinates on the collection picture at multiple visual angles.
It will be understood by those skilled in the art that in addition, parallax determining module 20 can also use of the prior art Other manner judges whether the two images in image sets have horizontal parallax, and the present invention will not enumerate to this to be repeated.
In the embodiment of the present invention, if the two images of dual camera collection have horizontal parallax, image synthesis unit 40 Then according to image synthesis mode conventional in the prior art, two images are directly directly synthesized to a width stereogram.It is if double The two images of camera collection do not have horizontal parallax, then two width original images are handled by the second acquisition module 30, The two width anaglyphs with horizontal parallax are obtained, then by image synthesis unit 40 by the two width anaglyphs with horizontal parallax Synthesize a width stereo-picture.
As shown in figure 11, the second acquisition module 30 includes image rotation unit 31, depth map generating unit 32 and virtual graph Generation unit 33, wherein:
Image rotation unit 31:For the width original image of rotating Vortex two, so that the two images obtained after rotation have First level parallax.
Two width original images in Fig. 4 (to the left) or (to the right) are rotated by 90 ° by image rotation unit 31 counterclockwise counterclockwise It is (allowing certain error be present), as shown in Figure 5 after rotation so that two width original images in image sets are from laid out in parallel shape State is changed into state arranged side by side, so that two width original images have first level parallax.
Depth map generating unit 32:For according to the two images obtained after rotation, generation and two width obtained after rotation Depth map corresponding to image.
In the embodiment of the present invention, depth map generating unit 32 is as shown in figure 12, including registration process unit 321 and three-dimensional With unit 322, wherein:Registration process unit 321, for carrying out registration process to the two images in postrotational image sets; Stereo matching unit 322, for carrying out Stereo matching to the two images after registration process, generate a width depth map.
When carrying out registration process to two images, registration process unit 321 first obtains the acquisition parameters of image sets, then Distortion correction is carried out to the two images obtained after rotation according to acquisition parameters using StereoRectify functions, and to two width Image is alignd, and the edge of two images is entered according to the area-of-interest (Region Of Interest, ROI) imported in advance Row alignment is cut.Foregoing acquisition parameters mainly include the relevant parameters, such as FX, FY, PX, PY Jiao such as the internal reference of camera, outer ginseng Away from parameter, the relative position parameter of two cameras such as the anglec of rotation, displacement, etc..
When carrying out Stereo matching to two images, Stereo matching unit 322 can use Stereo Matching Algorithm to alignment Two images after processing carry out Stereo matching, obtain the depth map corresponding with two images.The Stereo Matching Algorithm can With BM algorithms, SGBM algorithms, GC algorithms using OpenCV supports etc..
In certain embodiments, registration process unit 321 can also be omitted, by Stereo matching unit 322 directly to two width Image carries out Stereo matching.
Virtual graph generation unit 33:For selecting piece image from two width original images as reference chart, according to reference Figure and depth map generation have the virtual graph of horizontal parallax with reference chart.
The arrangement mode of two images in image sets can be reverted to original by virtual graph generation unit 33 from arranged side by side The laid out in parallel come, i.e., recover to Fig. 4 arrangement mode from Fig. 5 arrangement mode.Wherein, when image rotation unit 31 is by two width During 90 degree of original image rotate counterclockwise, two width original image dextrorotations then turn 90 degrees recovery by reference chart selecting unit 33 For original state;When image rotation unit 31 by two width original images turned clockwise 90 degree when, reference chart selecting unit Two 90 degree of width original image rotate counterclockwises are reverted to original state by 33.
After two width original images of image sets revert to laid out in parallel up and down, virtual graph generation unit 33 can select image The upper figure or figure below of group are as reference chart.
In the embodiment of the present invention, virtual graph generation unit 33 is as shown in figure 13, including depth acquiring unit 331, relation are built Vertical unit 332 and pixel-map unit 333, wherein:Depth acquiring unit 331, for traveling through depth map, obtain the depth of depth map Spend scope;Relation establishes unit 332, is established for the depth bounds according to depth map and default horizontal parallax adjusting range deep Angle value and the corresponding relation of horizontal parallax adjusted value;Pixel-map unit 333, for building a width virtual graph, according to depth value With the corresponding relation of horizontal parallax adjusted value by each pixel-map in reference chart into virtual graph, so as to obtain a width with Reference chart has the virtual graph of horizontal parallax.
The depth bounds of depth map is the span of depth value in depth map, and depth acquiring unit 331 can travel through depth Degree figure, the maximum and minimum value of the depth value of depth map are obtained, the interval range of the minimum value of depth value to maximum is made For the depth bounds of depth map.Horizontal parallax adjusting range is the span of default horizontal parallax adjusted value, can basis It is actually needed setting.Assuming that the depth bounds of depth map is [0,255], horizontal parallax adjusting range is [0,40], then can build The linear functional relation of vertical depth value and horizontal parallax adjusted value is used as the corresponding relation of the two.If depth value is x, horizontal parallax Adjusted value is y, then has:Y=kx, 255 in aforementioned depth scope being substituted into y, 40 in horizontal parallax adjusting range substitute into x, K=8/51 is then calculated, then the linear function expression of the two is y=(8/51) x.
In the embodiment of the present invention, pixel-map unit 333 is as shown in figure 14, including depth value is searched subelement 3331, adjusted Whole value computation subunit 3332, new coordinate obtain subelement 3333 and pixel addition subelement 3334, wherein:
Depth value searches subelement 3331:For being looked for according to the position coordinates of each pixel in reference chart in depth map To the depth value of pixel.
Depth value searches subelement 3331 and travels through reference chart, for each pixel P in reference chart, obtains its position seat Mark (I, J), the depth value of pixel corresponding to the position coordinates (I, J) is then searched in depth map, the depth value is pixel P Depth value.
Adjustment calculation subelement 3332:For the depth value according to pixel and pair of depth value and horizontal parallax adjusted value The horizontal parallax adjusted value for calculating pixel should be related to.
It is y=(8/51) x that pixel P depth value is substituted into aforementioned linear function expression by adjustment calculation subelement 3332 X in, it is possible to calculate pixel P horizontal parallax adjusted value y.For example, pixel P depth value is 128, then can be before It is about 20 to state linear function expression and calculate corresponding horizontal parallax adjusted value.
New coordinate obtains subelement 3333:For the horizontal parallax adjusted value of pixel to be added to the position coordinates of pixel New position coordinates is obtained in abscissa.
Assuming that pixel P horizontal parallax adjusted value is v, new coordinate obtains the position that v is then added to pixel P by subelement 3333 Put and new position coordinates (I+v, J) is obtained in the abscissa I of coordinate (I, J).
Pixel adds subelement 3334:For the position being added to pixel corresponding to position coordinates new in virtual graph.
Pixel P in reference chart is added to position coordinates new in virtual graph (I+v, J) by pixel addition subelement 3334 Corresponding position.Each pixel P in reference chart is traveled through, until all pixels in reference chart are added to virtual graph In, because each pixel P in reference chart has carried out horizontal-shift in virtual graph, so that reference chart and virtual graph Generate horizontal parallax.
Because reference chart and virtual graph are the two width anaglyphs with horizontal parallax, therefore image synthesis unit 40 will join Examining the image synthesized after figure and virtual graph or so splice side by side just has stereoeffect, is a width stereo-picture.In general, work as ginseng When to examine figure be the upper figure in image sets, image synthesis unit 40 is then carried out reference chart as left figure, virtual graph simultaneously as right figure Row's splicing synthesis;When reference chart is figure below in image sets, image synthesis unit 40 is then using reference chart as right figure, virtual graph Splicing synthesis side by side is carried out as left figure.Certainly, the left-right relation of the two can also in turn, and this is not limited by the present invention.
Alternatively, due to spacing be present between two cameras of shooting image group, two width original graph in image sets is caused As some pixels on border are incomplete, therefore the part can malfunction when generating depth map, and depth map generating unit 32 can To carry out blacking processing to the part, and blacking subregion is recorded.When carrying out splicing synthesis, image synthesis unit 40 will in reference chart and virtual graph apply black region corresponding to pixel region exclude splicing synthesize region outside, only take reference chart and Splicing synthesis region in virtual graph carries out splicing synthesis, so as to further improve the three-dimensional effect of the stereogram finally synthesized Fruit.
Further, as shown in figure 15, in further embodiments, virtual graph generation unit 33 also includes cutting processing list Member 334, it is used for:After the virtual graph with reference chart with horizontal parallax is generated, reference chart and virtual graph are cut Processing so that the pixel filling area of the two is identical, and successive image synthesis module 40 will then cut reference chart and void after handling Plan figure splicing synthesizes a width stereo-picture, so as to improve the stereoeffect of stereo-picture.
In a preferred embodiment, cut processing unit 334 can by reference chart and virtual graph with two width original images In Non-overlapping Domain corresponding to region cut.In an alternative embodiment, cutting processing unit 334 can be to virtual graph In relative to reference chart missing part carry out blacking;The part lacked in virtual graph relative to reference chart can also be utilized Pixel around it is filled;Can also be to relative to the unnecessary part of virtual graph cut in reference chart, etc..
Further, as shown in figure 16, in further embodiments, it is single also to include depth map optimization for the second acquisition module 40 Member 35, it is used for:After depth map generating unit 32 generates depth map, edge-smoothing processing is carried out to depth map, to improve The stereoeffect for the stereogram being subsequently generated.
Specifically, depth map optimization unit 35 includes edge detection unit and smooth processing unit, wherein:Rim detection list Member, for being entered using edge detection algorithm (such as Canny operators) to two images (can be the figure after artwork or optimization processing) Row rim detection, generation edge graph (Edge figures);Smoothing processing unit, for being put down using edge graph to the edge of depth map Sliding processing, i.e.,:Edge graph is traveled through, using each edge pixel in edge graph, with Gaussian smoothing operator (Gussian Blur Filter) respective pixel of depth map is smoothed, so that the marginal portion of depth map seems more smooth.
The stereoscopic imaging apparatus for mobile terminal of the embodiment of the present invention, by determining that two width that dual camera gathers are former Whether beginning image has horizontal parallax, is then obtained when without horizontal parallax according to two width original images with horizontal parallax Two width anaglyphs, then the two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture, so that mobile whole End can also shoot stereo-picture under nonspecific posture, extend shooting appearance during mobile terminal shooting stereo-picture State, the angle coverage of stereo-picture is enriched, improve the shooting experience of user.
The embodiment of the present invention also proposes a kind of mobile terminal, and the mobile terminal includes memory, processor and at least one It is stored in memory and is configured as the application program by computing device, the application program is configurable for performing use In the stereoscopic imaging method of mobile terminal.The stereoscopic imaging method for mobile terminal comprises the following steps:Acquisition passes through The image sets of dual camera collection, described image group include two width original images;Determine whether two width original images have level Parallax;When two width original images do not have horizontal parallax, obtain two width with horizontal parallax according to two width original images and regard Difference image;The two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture.It is used for described in the present embodiment The stereoscopic imaging method of mobile terminal is the stereoscopic imaging method for mobile terminal involved by above-described embodiment in the present invention, It will not be repeated here.
The mobile terminal of the embodiment of the present invention, by determining whether the two width original images that dual camera gathers have level Parallax, the two width anaglyphs with horizontal parallax then are obtained according to two width original images when without horizontal parallax, then will The two width anaglyphs with horizontal parallax synthesize a width stereo-picture, so that mobile terminal is even in nonspecific posture Under can also shoot stereo-picture, extend mobile terminal shooting stereo-picture when shooting posture, enrich stereo-picture Angle coverage, improve the shooting experience of user.
The embodiment of the present invention proposes a kind of computer-readable recording medium simultaneously, is stored on the computer-readable recording medium There is three-dimensional imaging program, when the three-dimensional imaging program is executed by processor, realize stereoscopic imaging method for mobile terminal Step.The stereoscopic imaging method for mobile terminal comprises the following steps:The image sets gathered by dual camera are obtained, Described image group includes two width original images;Determine whether two width original images have horizontal parallax;When two width original images not During with horizontal parallax, the two width anaglyphs with horizontal parallax are obtained according to two width original images;There to be horizontal parallax Two width anaglyphs synthesize a width stereo-picture.The stereoscopic imaging method for mobile terminal described in the present embodiment For the stereoscopic imaging method for mobile terminal involved by above-described embodiment in the present invention, will not be repeated here.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other words Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal equipment (can be mobile phone, computer, clothes It is engaged in device, or network equipment etc.) perform method described in each embodiment of the present invention.
It should be appreciated that it these are only the preferred embodiments of the present invention, it is impossible to therefore the scope of the claims of the limitation present invention, Every equivalent structure made using description of the invention and accompanying drawing content or equivalent flow conversion, or be directly or indirectly used in Other related technical areas, it is included within the scope of the present invention.

Claims (24)

1. a kind of stereoscopic imaging method for mobile terminal, dual camera is provided with the mobile terminal, it is characterised in that It the described method comprises the following steps:
The image sets gathered by the dual camera are obtained, described image group includes two width original images;
Determine whether the two width original image has horizontal parallax;
When the two width original image does not have horizontal parallax, obtained according to the two width original image with horizontal parallax Two width anaglyphs;
The two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture.
2. the stereoscopic imaging method according to claim 1 for mobile terminal, it is characterised in that described to determine described two Whether width original image includes with horizontal parallax:
Determine the IMAQ posture of the mobile terminal;
Posture is gathered according to described image, determines whether the two width original image has horizontal parallax;
Or
Obtain at least one pair of same place in the two width original image;
According to positional information of at least one pair of the described same place in the two width original image, the two width original image is determined Whether there is horizontal parallax;
Or
Determine the arrangement mode of the two width original image;
According to the arrangement mode, determine whether the two width original image has horizontal parallax.
3. the stereoscopic imaging method according to claim 1 or 2 for mobile terminal, it is characterised in that described according to institute Stating two width anaglyphs of the two width original images acquisition with horizontal parallax includes:
Two width original image described in rotating Vortex, so that the two images obtained after rotation have first level parallax;
According to the two images obtained after rotation, depth map corresponding with the two images obtained after rotation is generated;
Piece image is selected to be generated as reference chart according to the reference chart and the depth map from the two width original image There is the virtual graph of horizontal parallax with the reference chart;
It is described the two width anaglyphs with horizontal parallax are synthesized into a width stereo-picture to include:
The reference chart and virtual graph splicing are synthesized into a width stereo-picture.
4. the stereoscopic imaging method according to claim 3 for mobile terminal, it is characterised in that it is described according to rotation after Obtained two images, generating depth map corresponding with the two images obtained after rotation includes:
Registration process is carried out to the two images obtained after rotation;
Stereo matching is carried out to the two images after the registration process, obtains the depth map.
5. the stereoscopic imaging method according to claim 4 for mobile terminal, it is characterised in that after described pair of rotation To two images carry out registration process include:
Obtain the acquisition parameters of the dual camera;
According to the acquisition parameters, distortion correction is carried out to the two images obtained after rotation, and to two width after distortion correction Image carries out alignment and cut.
6. the stereoscopic imaging method according to claim 4 for mobile terminal, it is characterised in that described to obtain the depth Also include after the step of degree figure:Edge-smoothing processing is carried out to the depth map.
7. the stereoscopic imaging method according to claim 3 for mobile terminal, it is characterised in that described according to the ginseng Examine figure and depth map generation includes with virtual graph that the reference chart has horizontal parallax:
The depth map is traveled through, obtains the depth bounds of the depth map;
According to the depth bounds of the depth map and default horizontal parallax adjusting range, establish depth value and adjusted with horizontal parallax The corresponding relation of value;
A width virtual graph is built, will be every in the reference chart according to the corresponding relation of the depth value and horizontal parallax adjusted value One pixel-map is into the virtual graph.
8. the stereoscopic imaging method according to claim 7 for mobile terminal, it is characterised in that described according to the depth Angle value and the corresponding relation of horizontal parallax adjusted value wrap each pixel-map in the reference chart into the virtual graph Include:
The depth value of the pixel is found in the depth map according to the position coordinates of each pixel in the reference chart;
The pixel is calculated according to the corresponding relation of the depth value of the pixel and the depth value and horizontal parallax adjusted value Horizontal parallax adjusted value;
New position will be obtained in the abscissa for the position coordinates that the horizontal parallax adjusted value of the pixel is added to the pixel Coordinate;
The pixel is added to the position corresponding to position coordinates new described in the virtual graph.
9. the stereoscopic imaging method according to claim 3 for mobile terminal, it is characterised in that described according to the ginseng Examining figure and depth map generation and the reference chart, there is the step of virtual graph of horizontal parallax also to include afterwards:
The reference chart and the virtual graph are carried out cutting processing;
It is described that the reference chart and virtual graph splicing are synthesized a width stereo-picture and included:
The reference chart after handling will be cut and virtual graph splicing synthesizes a width stereo-picture.
10. the stereoscopic imaging method according to claim 9 for mobile terminal, it is characterised in that described to the ginseng Examine figure and the virtual graph is carried out cutting processing and included:
Region corresponding with the Non-overlapping Domain in the two width original image in the reference chart and the virtual graph is carried out Cut.
11. the stereoscopic imaging method according to claim 1 or 2 for mobile terminal, it is characterised in that described by described in Also include after the step of two width anaglyphs with horizontal parallax synthesize a width stereo-picture:Based on the stereo-picture Carry out bore hole stereoscopic display.
12. a kind of stereoscopic imaging apparatus for mobile terminal, dual camera is provided with the mobile terminal, its feature exists In described device includes:
First acquisition module, for obtaining the image sets gathered by the dual camera, described image group is original including two Image;
Parallax determining module, for determining whether the two width original image has horizontal parallax;
Second acquisition module, for when the two width original image does not have horizontal parallax, according to the two width original image Obtain the two width anaglyphs with horizontal parallax;
Image synthesis unit, for the two width anaglyphs with horizontal parallax to be synthesized into a width stereo-picture.
13. the stereoscopic imaging apparatus according to claim 12 for mobile terminal, it is characterised in that the parallax determines Module is used for:
Determine the IMAQ posture of the mobile terminal;Posture is gathered according to described image, determines the two width original image Whether there is horizontal parallax;Or
Obtain at least one pair of same place in the two width original image;It is former in two width according at least one pair of described same place Positional information in beginning image, determines whether the two width original image has horizontal parallax;Or
Determine the arrangement mode of the two width original image;According to the arrangement mode, whether the two width original image is determined With horizontal parallax.
14. the stereoscopic imaging apparatus for mobile terminal according to claim 12 or 13, it is characterised in that described second Acquisition module includes:
Image rotation unit, for two width original image described in rotating Vortex, so that the two images obtained after rotation have the One horizontal parallax;
Depth map generating unit, for according to the two images obtained after rotation, generation and the two images pair obtained after rotation The depth map answered;
Virtual graph generation unit, for selecting piece image from the two width original image as reference chart, according to the ginseng Examining figure and depth map generation has the virtual graph of horizontal parallax with the reference chart;
Described image synthesis module is used for:The reference chart and virtual graph splicing are synthesized into a width stereo-picture.
15. the stereoscopic imaging apparatus according to claim 14 for mobile terminal, it is characterised in that the depth map life Include into unit:
Registration process unit, for carrying out registration process to the two images obtained after rotation;
Stereo matching unit, for carrying out Stereo matching to the two images after registration process, obtain the depth map.
16. the stereoscopic imaging apparatus according to claim 15 for mobile terminal, it is characterised in that the registration process Unit is used for:
Obtain the acquisition parameters of the dual camera;According to the acquisition parameters, the two images obtained after rotation are carried out abnormal Become correction, and alignment is carried out to the two images after distortion correction and cut.
17. the stereoscopic imaging apparatus according to claim 15 for mobile terminal, it is characterised in that described second obtains Module also includes depth map optimization unit, and it is used for:Edge-smoothing processing is carried out to the depth map.
18. the stereoscopic imaging apparatus according to claim 14 for mobile terminal, it is characterised in that the virtual graph life Include into unit:
Depth acquiring unit, for traveling through the depth map, obtain the depth bounds of the depth map;
Relation establishes unit, and depth is established for the depth bounds according to the depth map and default horizontal parallax adjusting range Value and the corresponding relation of horizontal parallax adjusted value;
Pixel-map unit, for building a width virtual graph, according to the depth value and the corresponding relation of horizontal parallax adjusted value By each pixel-map in the reference chart into the virtual graph.
19. the stereoscopic imaging apparatus according to claim 18 for mobile terminal, it is characterised in that the pixel-map Unit includes:
Depth value searches subelement, is looked for for the position coordinates according to each pixel in the reference chart in the depth map To the depth value of the pixel;
Adjustment calculation subelement, for the depth value according to the pixel and pair of the depth value and horizontal parallax adjusted value The horizontal parallax adjusted value for calculating the pixel should be related to;
New coordinate obtains subelement, for the horizontal parallax adjusted value of the pixel to be added to the position coordinates of the pixel New position coordinates is obtained in abscissa;
Pixel adds subelement, for the position being added to the pixel corresponding to position coordinates new described in the virtual graph Put.
20. the stereoscopic imaging apparatus according to claim 14 for mobile terminal, it is characterised in that described second obtains Module also includes cutting processing unit, and the processing unit that cuts is used for:The reference chart and the virtual graph are cut Processing;
Described image synthesis module is used for:The reference chart after handling will be cut and virtual graph splicing synthesizes a width and stood Body image.
21. the stereoscopic imaging apparatus according to claim 20 for mobile terminal, it is characterised in that described to cut processing Unit is used for:
Region corresponding with the Non-overlapping Domain in the two width original image in the reference chart and the virtual graph is carried out Cut.
22. the stereoscopic imaging apparatus for mobile terminal according to claim 12 or 13, it is characterised in that described device Also include stereo display module, the stereo display module is used for:
Bore hole stereoscopic display is carried out based on the stereo-picture.
23. a kind of mobile terminal, including dual camera, memory, processor and at least one it is stored in the memory And it is configured as by the application program of the computing device, it is characterised in that the application program is configurable for performing The stereoscopic imaging method for mobile terminal described in any one of claim 1 to 11.
A kind of 24. computer-readable recording medium, it is characterised in that be stored with the computer-readable recording medium it is three-dimensional into As program, when the three-dimensional imaging program is executed by processor, realizes and be used to move as described in any one of claim 1 to 11 The step of stereoscopic imaging method of terminal.
CN201711195602.7A 2017-11-24 2017-11-24 Mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium Pending CN107820071A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711195602.7A CN107820071A (en) 2017-11-24 2017-11-24 Mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711195602.7A CN107820071A (en) 2017-11-24 2017-11-24 Mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium

Publications (1)

Publication Number Publication Date
CN107820071A true CN107820071A (en) 2018-03-20

Family

ID=61608839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711195602.7A Pending CN107820071A (en) 2017-11-24 2017-11-24 Mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium

Country Status (1)

Country Link
CN (1) CN107820071A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059590A (en) * 2019-03-29 2019-07-26 努比亚技术有限公司 A kind of face living body verification method, device, mobile terminal and readable storage medium storing program for executing
CN110636276A (en) * 2019-08-06 2019-12-31 RealMe重庆移动通信有限公司 Video shooting method and device, storage medium and electronic equipment
CN110956106A (en) * 2019-11-20 2020-04-03 广州华多网络科技有限公司 Processing method, device, storage medium and equipment for live broadcast
CN111314686A (en) * 2020-03-20 2020-06-19 深圳市博盛医疗科技有限公司 Method, system and medium for automatically optimizing 3D (three-dimensional) stereoscopic impression

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102986233A (en) * 2010-07-14 2013-03-20 夏普株式会社 Image imaging device
CN103945207A (en) * 2014-04-24 2014-07-23 浙江大学 Stereo image vertical parallax eliminating method based on viewpoint synthesis

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102986233A (en) * 2010-07-14 2013-03-20 夏普株式会社 Image imaging device
CN103945207A (en) * 2014-04-24 2014-07-23 浙江大学 Stereo image vertical parallax eliminating method based on viewpoint synthesis

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059590A (en) * 2019-03-29 2019-07-26 努比亚技术有限公司 A kind of face living body verification method, device, mobile terminal and readable storage medium storing program for executing
CN110059590B (en) * 2019-03-29 2023-06-30 努比亚技术有限公司 Face living experience authentication method and device, mobile terminal and readable storage medium
CN110636276A (en) * 2019-08-06 2019-12-31 RealMe重庆移动通信有限公司 Video shooting method and device, storage medium and electronic equipment
CN110636276B (en) * 2019-08-06 2021-12-28 RealMe重庆移动通信有限公司 Video shooting method and device, storage medium and electronic equipment
CN110956106A (en) * 2019-11-20 2020-04-03 广州华多网络科技有限公司 Processing method, device, storage medium and equipment for live broadcast
CN110956106B (en) * 2019-11-20 2023-10-10 广州方硅信息技术有限公司 Live broadcast on-demand processing method, device, storage medium and equipment
CN111314686A (en) * 2020-03-20 2020-06-19 深圳市博盛医疗科技有限公司 Method, system and medium for automatically optimizing 3D (three-dimensional) stereoscopic impression
CN111314686B (en) * 2020-03-20 2021-06-25 深圳市博盛医疗科技有限公司 Method, system and medium for automatically optimizing 3D (three-dimensional) stereoscopic impression
WO2021184533A1 (en) * 2020-03-20 2021-09-23 深圳市博盛医疗科技有限公司 Method and system for automatically optimizing 3d stereoscopic perception, and medium

Similar Documents

Publication Publication Date Title
US9214013B2 (en) Systems and methods for correcting user identified artifacts in light field images
CN107820071A (en) Mobile terminal and its stereoscopic imaging method, device and computer-readable recording medium
US8026950B2 (en) Method of and apparatus for selecting a stereoscopic pair of images
JP5432365B2 (en) Stereo imaging device and stereo imaging method
US9398289B2 (en) Method and apparatus for converting an overlay area into a 3D image
CN102957937B (en) The System and method for of process 3 D stereoscopic image
US20080199070A1 (en) Three-dimensional image display apparatus and method for enhancing stereoscopic effect of image
CN106447602B (en) Image splicing method and device
Cheng et al. Spatio-temporally consistent novel view synthesis algorithm from video-plus-depth sequences for autostereoscopic displays
WO2010049850A1 (en) Generation of occlusion data for image properties
WO2012092246A2 (en) Methods, systems, and computer-readable storage media for identifying a rough depth map in a scene and for determining a stereo-base distance for three-dimensional (3d) content creation
JP5444452B2 (en) Stereo imaging device and stereo imaging method
US8514219B2 (en) 3D image special effects apparatus and a method for creating 3D image special effects
US9420263B2 (en) Information processor and information processing method
CN111047709B (en) Binocular vision naked eye 3D image generation method
WO2011108276A1 (en) 3d imaging device and 3d imaging method
WO2013079660A1 (en) Disparity map generation including reliability estimation
CN114450713A (en) Information processing apparatus, video generation method, and program
TWI486052B (en) Three-dimensional image processing device and three-dimensional image processing method
JP5891645B2 (en) Imaging apparatus and program
KR101634225B1 (en) Device and Method for Multi-view image Calibration
TWI502271B (en) Controlling method and electronic apparatus
JP2013201688A (en) Image processing apparatus, image processing method, and image processing program
CN108234988A (en) Parallax drawing generating method, device and computer readable storage medium
CN114972534A (en) Binocular calibration method and device for tilt-shift camera

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180320

RJ01 Rejection of invention patent application after publication