Object-based stereo image depth adjustment method
Technical Field
The present invention relates to a method for processing an image signal, and more particularly, to a method for adjusting a depth of a stereoscopic image based on an object.
Background
With the rapid development of 3D technology, stereo images and stereo videos are more and more noticed and favored by people. Especially, with the development of mobile phones, tablets and personal computers, the display of the mobile terminal is more and more popular among users. However, when displaying a stereoscopic image and a stereoscopic video on a mobile terminal screen, the stereoscopic sensation may be reduced or even disappear, and a movie maker tries to increase the stereoscopic sensation of a specific object by adjusting the size and depth of the object to focus the viewer on the object. Accordingly, for displaying a stereoscopic image and a stereoscopic video on a mobile terminal screen, depth adjustment based on an object can enhance the attention and depth perception of the object.
In the depth adjustment of a stereoscopic image, two methods are roughly classified: depth adjustment using the depth map and depth adjustment without the depth map. The former method requires an accurate depth map and generates an image with adjusted depth using a virtual viewpoint rendering technique; the latter method achieves the purpose of depth adjustment directly by moving pixels in an image, however, the method often generates a hole or causes deformation of an object after depth adjustment, and therefore, how to reduce image deformation of a stereoscopic image after depth adjustment and how to adaptively control adjustment of the object according to selection of a user to highlight significant content are problems which need to be researched and solved in the process of depth adjustment of the stereoscopic image.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide an object-based depth adjustment method for a stereoscopic image, which enables the stereoscopic image after depth adjustment to retain an accurate object shape, have high comfort and depth feeling, and can adaptively control the scaling of important content according to the selection of a user.
The technical scheme adopted by the invention for solving the technical problems is as follows: a method for adjusting depth of a stereoscopic image based on an object is characterized by comprising the following steps:
the method comprises the following steps: the left viewpoint image, the right viewpoint image, and the left parallax image of the stereoscopic image having the width W and the height H to be processed are correspondingly denoted as { L (x, y) }, { R (x, y) }, and { dL(x, y) }; wherein x is more than or equal to 1 and less than or equal to W, y is more than or equal to 1 and less than or equal to H, W and H can be evenly divided by 8, L (x, y) represents the pixel value of the pixel point with the coordinate position (x, y) in { L (x, y) }, R (x, y) represents the pixel value of the pixel point with the coordinate position (x, y) in { R (x, y) }, dL(x, y) represents { d }LThe coordinate position in (x, y) is the pixel value of the pixel point of (x, y);
step two: dividing { L (x, y) } intoFour-sided grids of 8 × 8 size and not overlapping each other, and the kth four-sided grid in { L (x, y) } is marked as UL,kAnd the set of all quadrilateral meshes in { L (x, y) } is denoted as VL,VL={UL,kL 1 is more than or equal to k and less than or equal to M }; then according to all quadrilateral meshes in { L (x, y) } and { dL(x, y) }, acquiring all non-overlapping quadrilateral grids with the size of 8 multiplied by 8 in the { R (x, y) }, and marking the kth quadrilateral grid in the { R (x, y) }asUR,kAnd the set of all quadrilateral meshes in { R (x, y) } is denoted as VR,VR={UR,kL 1 is more than or equal to k and less than or equal to M }; wherein k is a positive integer, k is not less than 1 and not more than M, M represents the total number of quadrilateral meshes contained in { L (x, y) } and also represents the total number of quadrilateral meshes contained in { R (x, y) },UL,kdescribed by its set of 4 mesh vertices above left, below left, above right and below right, corresponds to and represents UL,kA left upper grid vertex as a1 st grid vertex, a left lower grid vertex as a2 nd grid vertex, a right upper grid vertex as a 3 rd grid vertex, a right lower grid vertex as a 4 th grid vertex,to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that,UR,kdescribed by its set of 4 mesh vertices above left, below left, above right and below right, corresponds to and represents UR,kA left upper grid vertex as a1 st grid vertex, a left lower grid vertex as a2 nd grid vertex, a right upper grid vertex as a 3 rd grid vertex, a right lower grid vertex as a 4 th grid vertex,to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (a),to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (a),to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (a),to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (1);
extracting all feature points in the { L (x, y) } by adopting scale-invariant feature conversion; then, the q-th feature point in { L (x, y) } is noted as Then according to each feature in { L (x, y) }Dot sum { dL(x, y) }, acquiring feature points in the { R (x, y) } which are matched with each feature point in the { L (x, y) }, and matching the feature points in the { R (x, y) } with the feature points in the { L (x, y) }The matched feature points are recorded as Wherein Q is a positive integer, 1. ltoreq. q.ltoreq.Q, Q represents the total number of feature points in { L (x, y) }, and also represents the total number of feature points in { R (x, y) },to representThe position of the abscissa of the bar (a),to representThe position of the ordinate of (a) is,to representThe position of the abscissa of the bar (a), represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (a),to representThe position of the ordinate of (a) is,
step three: calculating the total edge retention energy of the target quadrilateral meshes corresponding to all quadrilateral meshes in the { L (x, y) } and the { R (x, y) } according to a matrix formed by the edges of all grid vertexes of each quadrilateral mesh in the { L (x, y) } and a matrix formed by the edges of all grid vertexes of the target quadrilateral mesh corresponding to each quadrilateral mesh in the { L (x, y) }, a matrix formed by the edges of all grid vertexes of each quadrilateral mesh in the { R (x, y) } and a matrix formed by the edges of all grid vertexes of the target quadrilateral mesh corresponding to each quadrilateral mesh in the { R (x, y) }, and recording the total edge retention energy as Eedge;
According to the important content selected by the user, calculating the total object control energy of target quadrilateral grids corresponding to all quadrilateral grids in the rectangular area where the important content selected by the user in { L (x, y) } and { R (x, y) } is located, and marking the total object control energy as Eobject;
According to all feature points in the rectangular areas where the important contents selected by the user are located in the { L (x, y) } and the { R (x, y) } the total depth control energy of the target quadrilateral grids corresponding to all quadrilateral grids in the rectangular areas where the important contents selected by the user are located in the { L (x, y) } and the { R (x, y) } is calculated and recorded as Edepth;
Calculating the total of target quadrilateral grids corresponding to all quadrilateral grids in the { L (x, y) } and the { R (x, y) } in the background area according to all the feature points in the { L (x, y) } and the corresponding target feature points, and all the feature points in the { R (x, y) } in the background area and the corresponding target feature pointsBackground Retention energy, denoted Eback(ii) a The background area is an area except a rectangular area where the important content selected by the user is located;
step four: according to Eedge、Eobject、EdepthAnd EbackCalculating the total energy of the target quadrilateral grids corresponding to all the quadrilateral grids in the { L (x, y) } and the { R (x, y) }, and recording the total energy as Etotal,Etotal=Eedge+λobject×Eobject+λdepth×Edepth+λback×Eback(ii) a Then solving by least squares optimizationObtaining a set formed by the optimal target quadrilateral grids corresponding to all quadrilateral grids in the { L (x, y) } and a set formed by the optimal target quadrilateral grids corresponding to all quadrilateral grids in the { R (x, y) }, and recording the optimal target quadrilateral grids corresponding to all quadrilateral grids in the { L (x, y) }asthe optimal target quadrilateral grids corresponding to all quadrilateral grids in the { R (x, y) } correspondinglyAnd then according toCalculating the optimal similarity transformation matrix of the optimal target quadrilateral grids corresponding to each quadrilateral grid in the { L (x, y) }, and converting U into UL,kCorresponding optimal target quadrilateral meshIs recorded as the optimal similarity transformation matrix And according toCalculating the optimal similarity transformation matrix of the optimal target quadrilateral grids corresponding to each quadrilateral grid in the { R (x, y) }, and converting U into UR,kCorresponding optimal target quadrilateral meshIs recorded as the optimal similarity transformation matrix
Wherein λ isobjectIs EobjectA weighting parameter ofdepthIs EdepthA weighting parameter ofbackIs EbackMin () is a function taking the minimum value,represents a set of target quadrilateral meshes corresponding to all quadrilateral meshes in the { L (x, y) },represents a set of target quadrilateral meshes corresponding to all quadrilateral meshes in R (x, y),represents UL,kThe corresponding optimal target quadrilateral mesh is selected from the set of target quadrilateral meshes, corresponding representation1 st mesh vertex, 2 nd mesh vertex, 3 rd mesh vertex, 4 th mesh vertex,represents UR,kThe corresponding optimal target quadrilateral mesh is selected from the set of target quadrilateral meshes, corresponding representation1 st mesh vertex, 2 nd mesh vertex, 3 rd mesh vertex, 4 th mesh vertex of (a)L,k)TIs AL,kTranspose of (A) ((A)L,k)TAL,k)-1Is (A)L,k)TAL,kThe inverse of (a) is,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representation(ii) a horizontal coordinate position and a vertical coordinate position of (A)R,k)TIs AR,kTranspose of (A) ((A)R,k)TAR,k)-1Is (A)R,k)TAR,kThe inverse of (a) is,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationHorizontal coordinate ofThe position and the position of the vertical coordinate,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationHorizontal coordinate position and vertical coordinate position of (a);
step five: according to the optimal similarity transformation matrix of the optimal target quadrilateral grid corresponding to each quadrilateral grid in the { L (x, y) }, calculating the horizontal coordinate position and the vertical coordinate position of each pixel point in each quadrilateral grid in the { L (x, y) } after the optimal similarity transformation rectangular transformation, and converting the U into the U-shaped coordinate positionL,kThe position of the middle horizontal coordinate is x'L,kAnd vertical coordinate position y'L,kThe correspondence of the horizontal coordinate position and the vertical coordinate position of the pixel point after the optimal similarity transformation matrix is recorded asAnd then according to the horizontal coordinate position sum of each pixel point in each quadrilateral grid in the { L (x, y) } after the rectangular transformation of the optimal similarity transformationThe vertical coordinate position is used for obtaining a left viewpoint image after the depth adjustment and recording the left viewpoint image asWherein x is not less than 1'L,k≤W,1≤y'L,k≤H,X 'is more than or equal to 1 and less than or equal to W', y 'is more than or equal to 1 and less than or equal to H, W' represents the width of the three-dimensional image after the depth adjustment, H is the height of the three-dimensional image after the depth adjustment,to representThe pixel value of the pixel point with the middle coordinate position (x ', y');
similarly, according to the optimal similarity transformation matrix of the optimal target quadrilateral grid corresponding to each quadrilateral grid in the { R (x, y) }, calculating the horizontal coordinate position and the vertical coordinate position of each pixel point in each quadrilateral grid in the { R (x, y) } after the optimal similarity transformation rectangular transformation, and converting the U into the U shapeR,kThe position of the middle horizontal coordinate is x'R,kAnd vertical coordinate position y'R,kThe correspondence of the horizontal coordinate position and the vertical coordinate position of the pixel point after the optimal similarity transformation matrix is recorded asAnd then, according to the horizontal coordinate position and the vertical coordinate position of each pixel point in each quadrilateral grid in the { R (x, y) } after the optimal similarity transformation rectangular transformation, a right viewpoint image after depth adjustment is obtained and recorded as a right viewpoint imageWherein x is not less than 1'R,k≤W,1≤y'R,k≤H,1≤x'≤W',1≤y'≤H,To representAnd the pixel value of the pixel point with the middle coordinate position of (x ', y').
E in the third stepedgeThe calculation process of (2) is as follows:
a1, calculating the edge holding energy of the target quadrilateral grids corresponding to all quadrilateral grids in the { L (x, y) }, and recording the edge holding energy as Wherein e isL,kRepresents UL,kIs used to form a matrix of edges of all mesh vertices,(eL,k)Tis eL,kTranspose of (e) ((e)L,k)TeL,k)-1Is (e)L,k)TeL,kThe inverse of (a) is,to representIs used to form a matrix of edges of all mesh vertices, represents UL,kThe corresponding target quadrilateral mesh is then selected,described by its set of 4 mesh vertices above left, below left, above right and below right, corresponding representationA left upper grid vertex as a1 st grid vertex, a left lower grid vertex as a2 nd grid vertex, a right upper grid vertex as a 3 rd grid vertex, a right lower grid vertex as a 4 th grid vertex,to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that,the symbol "| | |" is to ask EuropeA number of distance symbols;
similarly, the edge holding energy of the target quadrilateral mesh corresponding to all quadrilateral meshes in { R (x, y) } is calculated and recorded as Wherein e isR,kRepresents UR,kIs used to form a matrix of edges of all mesh vertices,(eR,k)Tis eR,kTranspose of (e) ((e)R,k)TeR,k)-1Is (e)R,k)TeR,kThe inverse of (a) is,to representIs used to form a matrix of edges of all mesh vertices, represents UR,kThe corresponding target quadrilateral mesh is then selected,described by its set of 4 mesh vertices above left, below left, above right and below right, corresponding representationA left upper grid vertex as a1 st grid vertex, a left lower grid vertex as a2 nd grid vertex, a right upper grid vertex as a 3 rd grid vertex, a right lower grid vertex as a 4 th grid vertex,to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that,
a2, according toAndcalculating the total edge-preserving energy E of the target quadrilateral meshes corresponding to all quadrilateral meshes in the { L (x, y) } and the { R (x, y) } according to the total edge-preserving energy Eedge,
E in the third stepobjectThe calculation process of (2) is as follows:wherein,a range of a rectangular area in which important contents selected by the user are indicated,denotes a horizontal coordinate position of a mesh vertex of { L (x, y) } which is jth in the horizontal direction and ith in the vertical direction,denotes a horizontal coordinate position of a mesh vertex of { L (x, y) } which is j +1 th in the horizontal direction and i-th in the vertical direction,denotes a horizontal coordinate position of a mesh vertex in the target quadrangular mesh, of a mesh vertex which is jth in the horizontal direction and ith in the vertical direction in { L (x, y) },denotes the horizontal coordinate position of the mesh vertex in the target quadrangular mesh of the mesh vertex of j +1 th in the horizontal direction and i th in the vertical direction in { L (x, y) },denotes a horizontal coordinate position of a mesh vertex of { R (x, y) } which is jth in the horizontal direction and ith in the vertical direction,denotes a horizontal coordinate position of a mesh vertex of { R (x, y) } which is j +1 th in the horizontal direction and i-th in the vertical direction,denotes the horizontal direction in { R (x, y) }To the horizontal coordinate position of the mesh vertex in the target quadrilateral mesh of the mesh vertex which is jth and ith in the vertical direction,denotes the horizontal coordinate position, s, of the mesh vertex in the target quadrilateral mesh of the mesh vertex in { R (x, y) } which is j +1 th in the horizontal direction and i-th in the vertical directionxA horizontal scaling factor representing user-specified important content.
E in the third stepdepthThe calculation process of (2) is as follows:
b1, calculating comfort level maintenance energy of all feature points in the rectangular area where the important content selected by the user is located in the { L (x, y) }, and recording the comfort level maintenance energy as Ecomfort, Wherein,representing a set formed by the serial numbers of all the characteristic points which fall in the rectangular area of the important content selected by the user after renumbering in the { L (x, y) },indicates the depth value of the p-th feature point in the L (x, y) within the rectangular area where the important content selected by the user is located,exp () represents an exponential function with the natural base e as the base, the symbol "|" is an absolute value symbol, ZmaxDenotes the maximum depth value of { L (x, y) }, ZminDenotes the minimum depth value of { L (x, y) }, CVZminA minimum comfortable viewing zone range is indicated,Herepresenting a horizontal baseline distance between left and right viewpoints of the stereoscopic image to be processed, D representing a viewing distance between the left and right viewpoints of the stereoscopic image to be processed and the display, WdIndicating the horizontal width, R, of the displaydIndicating the horizontal resolution of the display, η1Indicating minimum comfortable viewing angle, CVZmaxIndicating the maximum comfortable viewing zone range,η2indicating the maximum comfortable viewing angle of view,the parallax value representing the p-th feature point in { L (x, y) } that falls within the rectangular region in which the important content selected by the user is located also represents { d }LThe coordinate position in (x, y) is the pixel value of the pixel point of the p-th characteristic point in the rectangular area where the important content selected by the user is located,to representThe target depth value of (2);
b2, calculating the feature retention energy of all feature points in the rectangular area where the important content selected by the user is located in the { L (x, y) }, and recording the feature retention energy as Efeature,Wherein,representing that all the feature points in the eight neighborhood range adjacent to the p-th feature point in the rectangular region in which the important content selected by the user is located in the rectangular region are renumbered in the { L (x, y) } stateIs a set of sequence numbers of (a),indicating the depth value of the p' th characteristic point in the eight neighborhood range adjacent to the p-th characteristic point in the rectangular area in which the important content selected by the user is located in the L (x, y),to representThe target depth value of (2);
b3 by solving for min (E)comfort+λfeature×Efeature) Obtaining the optimal target depth value set of all feature points in the rectangular region where the important content selected by the user falls in { L (x, y) } and recording the optimal target depth value set as Is composed ofThe optimal target depth value; then according toAcquiring the optimal target disparity value set of all feature points in the rectangular region where the important content selected by the user is located in the { L (x, y) } and recording the optimal target disparity value set as Is composed ofThe optimal target disparity value of (a) is,wherein min () is a function of taking the minimum value, λfeatureIs EfeatureThe weighting parameter of (2);
b4, according toCalculating the total depth control energy E of target quadrilateral grids corresponding to all quadrilateral grids in the rectangular area where the important content selected by the user is located in the { L (x, y) } and the { R (x, y) } are locateddepth,
Wherein the symbol "| | |" is a euclidean distance-solving symbol,indicating the p-th feature point in the { L (x, y) } that falls within the rectangular area where the important content selected by the user is located,represents the p-th feature point in the R (x, y) within the rectangular area where the important content selected by the user is located,to representThe corresponding target feature points are set to be in a same shape,to representThe corresponding target feature points are set to be in a same shape,to representThe position of the abscissa of the bar (a),to representThe position of the abscissa of the bar (a),to representThe position of the abscissa of the bar (a),to representThe horizontal coordinate position of the X-ray detector is that i 'is more than or equal to 1 and less than or equal to 4, k' is more than or equal to 1 and less than or equal to M,to representQuadrilateral grid UL,k'ith' mesh vertex, UL,k'is the kth' quadrilateral mesh in { L (x, y) },to representQuadrilateral grid UL,k' as the 1 st mesh vertex,to representQuadrilateral grid UL,k' as the 2 nd mesh vertex,to representQuadrilateral grid UL,k' as the top-right mesh vertex of the 3 rd mesh vertex,to representQuadrilateral grid UL,k' as the lower right mesh vertex of the 4 th mesh vertex,to representAndthe euclidean distance between them,to representTarget quadrilateral meshThe ith' mesh vertex of (a),is UL,k' a corresponding target quadrilateral mesh,to representTarget quadrilateral meshAs the 1 st mesh vertex,to representTarget quadrilateral meshAs the 2 nd mesh vertex,to representTarget quadrilateral meshAs the top-right mesh vertex of the 3 rd mesh vertex,to representTarget quadrilateral meshAs the 4 th mesh vertex,to representQuadrilateral grid UR,k'ith' mesh vertex, UR,k'is the kth' quadrilateral mesh in { R (x, y) },denotes fRpQuadrilateral grid UR,k' as the 1 st mesh vertex,to representQuadrilateral grid UR,k' as the 2 nd mesh vertex,to representQuadrilateral grid UR,k' as the top-right mesh vertex of the 3 rd mesh vertex,to representQuadrilateral grid UR,k' as the lower right mesh vertex of the 4 th mesh vertex,to representAndthe euclidean distance between them,to representTarget quadrilateral meshThe ith' mesh vertex of (a),is UR,k' a corresponding target quadrilateral mesh,representing characteristic pointsTarget quadrilateral meshAs the 1 st mesh vertex,to representTarget quadrilateral meshAs the 2 nd mesh vertex,to representTarget quadrilateral meshAs the top-right mesh vertex of the 3 rd mesh vertex,representing characteristic pointsTarget quadrilateral meshAs the 4 th mesh vertex.
E in the third stepbackThe calculation process of (2) is as follows: wherein,representing a set of sequence numbers formed by renumbering all feature points falling in the background area in { L (x, y) } and { R (x, y) },represents the g-th feature point falling within the background region in { L (x, y) },represents the g-th feature point falling within the background region in { R (x, y) },to representThe corresponding target feature points are set to be in a same shape,to representCorresponding target characteristic points, the symbol "| | |" is a Euclidean distance-calculating symbol, i' is more than or equal to 1 and less than or equal to 4, k is more than or equal to 1 and less than or equal to M,to representQuadrilateral grid UL,k"ith' mesh vertex, UL,k"is the kth" quadrilateral mesh in { L (x, y) },to representQuadrilateral grid UL,k"left upper grid vertex as the 1 st grid vertex,to representQuadrilateral grid UL,k"as the 2 nd mesh vertex,to representQuadrilateral grid UL,k"top right mesh vertex as the 3 rd mesh vertex,to representQuadrilateral grid UL,k"as the lower right mesh vertex of the 4 th mesh vertex,to representAndthe euclidean distance between them,to representTarget quadrilateral meshThe ith' mesh vertex of (a),is UL,k"the corresponding target quadrilateral mesh,to representIs located atTarget quadrilateral mesh ofAs the 1 st mesh vertex,to representTarget quadrilateral meshAs the 2 nd mesh vertex,to representTarget quadrilateral meshAs the top-right mesh vertex of the 3 rd mesh vertex,to representTarget quadrilateral meshAs the 4 th mesh vertex,to representQuadrilateral grid UR,kThe ith' ofMesh vertex, UR,k"is the kth" quadrilateral mesh in { R (x, y) },to representQuadrilateral grid UR,k"left upper grid vertex as the 1 st grid vertex,to representQuadrilateral grid UR,k"as the 2 nd mesh vertex,to representQuadrilateral grid UR,k"top right mesh vertex as the 3 rd mesh vertex,to representQuadrilateral grid UR,k"as the lower right mesh vertex of the 4 th mesh vertex,to representAndthe euclidean distance between them,to representTarget quadrilateral meshThe ith' mesh vertex of (a),is UR,k"the corresponding target quadrilateral mesh,to representTarget quadrilateral meshAs the 1 st mesh vertex,representing characteristic pointsTarget quadrilateral meshAs the 2 nd mesh vertex,representing characteristic pointsTarget quadrilateral meshAs the top-right mesh vertex of the 3 rd mesh vertex,representing characteristic pointsTarget quadrilateral meshAs the 4 th mesh vertex.
Compared with the prior art, the invention has the advantages that:
1) the method extracts the total edge holding energy, the total object control energy, the total depth control energy and the total background holding energy corresponding to the left viewpoint image and the right viewpoint image of the stereo image, minimizes the total energy through optimization, and obtains the optimal similarity transformation matrix, so that the stereo image after depth adjustment can keep accurate object shape, has higher comfort and depth feeling, and can adaptively control the scaling of important contents according to the selection of a user.
2) The method of the invention controls the coordinate positions of all the characteristic points in the stereo image in the important area and the background area, and further controls the deformation of the quadrilateral grids, thereby ensuring the comfort and the depth feeling of the stereo image after depth adjustment.
Drawings
FIG. 1 is a block diagram of an overall implementation of the method of the present invention;
FIG. 2a is a "red/green" view of the original stereo Image of "Image 1";
FIG. 2b is a "red/green" diagram of "Image 1" after object depth adjustment;
FIG. 3a is a "red/green" view of the original stereo Image of "Image 2";
FIG. 3b is a "red/green" diagram of "Image 2" after object depth adjustment;
FIG. 4a is a "red/green" view of the original stereo Image of "Image 3";
FIG. 4b is a "red/green" diagram of "Image 3" after object depth adjustment;
FIG. 5a is a "red/green" view of the original stereo Image of "Image 4";
fig. 5b is a "red/green" diagram after the object depth adjustment of "Image 4".
Detailed Description
The invention is described in further detail below with reference to the accompanying examples.
The general implementation block diagram of the method for adjusting the depth of a stereoscopic image based on an object, which is provided by the invention, is shown in fig. 1, and the method comprises the following steps:
the method comprises the following steps: the left viewpoint image, the right viewpoint image, and the left parallax image of the stereoscopic image having the width W and the height H to be processed are correspondingly denoted as { L (x, y) }, { R (x, y) }, and { dL(x, y) }; wherein x is more than or equal to 1 and less than or equal to W, y is more than or equal to 1 and less than or equal to H, W and H can be evenly divided by 8, L (x, y) represents the pixel value of the pixel point with the coordinate position (x, y) in { L (x, y) }, R (x, y) represents the pixel value of the pixel point with the coordinate position (x, y) in { R (x, y) }, dL(x, y) represents { d }LAnd the coordinate position in the (x, y) is the pixel value of the pixel point of (x, y).
Step two: dividing { L (x, y) } intoA grid of non-overlapping 8 × 8 quadrilateral dimensions, which are defined by { L (x, y) } ofThe kth quadrilateral mesh is marked as UL,kAnd the set of all quadrilateral meshes in { L (x, y) } is denoted as VL,VL={UL,kL 1 is more than or equal to k and less than or equal to M }; then according to all quadrilateral meshes in { L (x, y) } and { dL(x, y) }, acquiring all non-overlapping quadrilateral grids with the size of 8 multiplied by 8 in the { R (x, y) }, and marking the kth quadrilateral grid in the { R (x, y) }asUR,kAnd the set of all quadrilateral meshes in { R (x, y) } is denoted as VR,VR={UR,kL 1 is more than or equal to k and less than or equal to M }; wherein k is a positive integer, k is not less than 1 and not more than M, M represents the total number of quadrilateral meshes contained in { L (x, y) } and also represents the total number of quadrilateral meshes contained in { R (x, y) },UL,kdescribed by its set of 4 mesh vertices above left, below left, above right and below right, corresponds to and represents UL,kA left upper grid vertex as a1 st grid vertex, a left lower grid vertex as a2 nd grid vertex, a right upper grid vertex as a 3 rd grid vertex, a right lower grid vertex as a 4 th grid vertex,to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionDevice for placingTo be described, the method has the advantages that,UR,kdescribed by its set of 4 mesh vertices above left, below left, above right and below right, corresponds to and represents UR,kA left upper grid vertex as a1 st grid vertex, a left lower grid vertex as a2 nd grid vertex, a right upper grid vertex as a 3 rd grid vertex, a right lower grid vertex as a 4 th grid vertex,to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (a),to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (a),to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (a),to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (1).
Extracting all Feature points in { L (x, y) } by adopting the conventional Scale Invariant Feature Transform (SIFT); then, the q-th feature point in { L (x, y) } is noted as Let a set of all feature points in { L (x, y) } be denoted asThen according to each feature point in { L (x, y) } and { d }L(x, y) }, acquiring feature points in the { R (x, y) } which are matched with each feature point in the { L (x, y) }, and matching the feature points in the { R (x, y) } with the feature points in the { L (x, y) }The matched feature points are recorded as Let a set of all feature points in { R (x, y) } be denoted asWherein Q is a positive integer, 1. ltoreq. q.ltoreq.Q, Q represents the total number of feature points in { L (x, y) }, and also represents the total number of feature points in { R (x, y) },to representThe position of the abscissa of the bar (a),to representThe position of the ordinate of (a) is,to representThe position of the abscissa of the bar (a), represents { dL(x, y) } coordinate position ofThe pixel value of the pixel point of (a),to representThe position of the ordinate of (a) is,
step three: calculating the total edge retention energy of the target quadrilateral meshes corresponding to all quadrilateral meshes in the { L (x, y) } and the { R (x, y) } according to a matrix formed by the edges of all grid vertexes of each quadrilateral mesh in the { L (x, y) } and a matrix formed by the edges of all grid vertexes of the target quadrilateral mesh corresponding to each quadrilateral mesh in the { L (x, y) }, a matrix formed by the edges of all grid vertexes of each quadrilateral mesh in the { R (x, y) } and a matrix formed by the edges of all grid vertexes of the target quadrilateral mesh corresponding to each quadrilateral mesh in the { R (x, y) }, and recording the total edge retention energy as Eedge。
In this embodiment, step E of step threeedgeThe calculation process of (2) is as follows:
a1, calculating the edge holding energy of the target quadrilateral grids corresponding to all quadrilateral grids in the { L (x, y) }, and recording the edge holding energy as Wherein e isL,kRepresents UL,kAll nets ofThe matrix of edges at the vertices of the grid,(eL,k)Tis eL,kTranspose of (e) ((e)L,k)TeL,k)-1Is (e)L,k)TeL,kThe inverse of (a) is,to representIs used to form a matrix of edges of all mesh vertices, represents UL,kThe corresponding target quadrilateral mesh is then selected,described by its set of 4 mesh vertices above left, below left, above right and below right, corresponding representationA left upper grid vertex as a1 st grid vertex, a left lower grid vertex as a2 nd grid vertex, a right upper grid vertex as a 3 rd grid vertex, a right lower grid vertex as a 4 th grid vertex,to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that,the symbol "| | |" is a euclidean distance solving symbol.
Similarly, the edge holding energy of the target quadrilateral mesh corresponding to all quadrilateral meshes in { R (x, y) } is calculated and recorded as Wherein e isR,kRepresents UR,kIs used to form a matrix of edges of all mesh vertices,(eR,k)Tis eR,kTranspose of (e) ((e)R,k)TeR,k)-1Is (e)R,k)TeR,kThe inverse of (a) is,to representIs used to form a matrix of edges of all mesh vertices, represents UR,kThe corresponding target quadrilateral mesh is then selected,described by its set of 4 mesh vertices above left, below left, above right and below right, corresponding representationA left upper grid vertex as a1 st grid vertex, a left lower grid vertex as a2 nd grid vertex, a right upper grid vertex as a 3 rd grid vertex, a right lower grid vertex as a 4 th grid vertex,to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that, to be provided withHorizontal coordinate position ofAnd vertical coordinate positionTo be described, the method has the advantages that,
a2, according toAndcalculating the total edge-preserving energy E of the target quadrilateral meshes corresponding to all quadrilateral meshes in the { L (x, y) } and the { R (x, y) } according to the total edge-preserving energy Eedge,
According to the important content selected by the user, calculating the total object control energy of target quadrilateral grids corresponding to all quadrilateral grids in the rectangular area where the important content selected by the user in { L (x, y) } and { R (x, y) } is located, and marking the total object control energy as Eobject。
In this embodiment, step E of step threeobjectThe calculation process of (2) is as follows:wherein,a range of a rectangular area in which important contents selected by the user are indicated,denotes a horizontal coordinate position of a mesh vertex of { L (x, y) } which is jth in the horizontal direction and ith in the vertical direction,denotes a horizontal coordinate position of a mesh vertex of { L (x, y) } which is j +1 th in the horizontal direction and i-th in the vertical direction,denotes the horizontal direction in { L (x, y) }To the horizontal coordinate position of the mesh vertex in the target quadrilateral mesh of the mesh vertex which is jth and ith in the vertical direction,denotes the horizontal coordinate position of the mesh vertex in the target quadrangular mesh of the mesh vertex of j +1 th in the horizontal direction and i th in the vertical direction in { L (x, y) },denotes a horizontal coordinate position of a mesh vertex of { R (x, y) } which is jth in the horizontal direction and ith in the vertical direction,denotes a horizontal coordinate position of a mesh vertex of { R (x, y) } which is j +1 th in the horizontal direction and i-th in the vertical direction,denotes a horizontal coordinate position of a mesh vertex in the target quadrangular mesh of a mesh vertex jth in the horizontal direction and ith in the vertical direction in { R (x, y) },denotes the horizontal coordinate position, s, of the mesh vertex in the target quadrilateral mesh of the mesh vertex in { R (x, y) } which is j +1 th in the horizontal direction and i-th in the vertical directionxHorizontal scaling factor, s, representing user-specified important contentxCan be set according to the needs of users, and s is taken in the embodimentx1.8, namely the adjusted important content size is 1.8 times of the original size.
According to all feature points in the rectangular areas where the important contents selected by the user are located in the { L (x, y) } and the { R (x, y) } the total depth control energy of the target quadrilateral grids corresponding to all quadrilateral grids in the rectangular areas where the important contents selected by the user are located in the { L (x, y) } and the { R (x, y) } is calculated and recorded as the total depth control energy of the target quadrilateral grids corresponding to all quadrilateral grids located in the rectangular areas where the important contents selected by the user are located in the { L (x, y) }Edepth。
In this embodiment, step E of step threedepthThe calculation process of (2) is as follows:
b1, calculating comfort level maintenance energy of all feature points in the rectangular area where the important content selected by the user is located in the { L (x, y) }, and recording the comfort level maintenance energy as Ecomfort, Wherein,representing a set formed by the serial numbers of all the characteristic points which fall in the rectangular area of the important content selected by the user after renumbering in the { L (x, y) },indicates the depth value of the p-th feature point in the L (x, y) within the rectangular area where the important content selected by the user is located,exp () represents an exponential function based on a natural base e, e is 2.71828183 …, the symbol "|" is an absolute value symbol, ZmaxDenotes the maximum depth value of { L (x, y) }, ZminDenotes the minimum depth value of { L (x, y) }, CVZminA minimum comfortable viewing zone range is indicated,Herepresenting a horizontal baseline distance between left and right viewpoints of the stereoscopic image to be processed, D representing a viewing distance between the left and right viewpoints of the stereoscopic image to be processed and the display, WdIndicating the horizontal width, R, of the displaydRepresents the horizontal resolution of the display, taken H in this examplee65 mm, 1200 mm, Wd750 mm and Rd1920 mm, η1Indicating a minimum comfortable viewing angle, in this example η1=-1o,CVZmaxIndicating the maximum comfortable viewing zone range,η2indicating the maximum comfortable viewing angle, in this example η2=1o,The parallax value representing the p-th feature point in { L (x, y) } that falls within the rectangular region in which the important content selected by the user is located also represents { d }LThe coordinate position in (x, y) is the pixel value of the pixel point of the p-th characteristic point in the rectangular area where the important content selected by the user is located,to representThe target depth value of (2).
B2, calculating the feature retention energy of all feature points in the rectangular area where the important content selected by the user is located in the { L (x, y) }, and recording the feature retention energy as Efeature,Wherein,representing a set formed by the serial numbers of all feature points in the eight neighborhood range adjacent to the p-th feature point in the rectangular region in which the important content selected by the user is located in the { L (x, y) } region,indicating that the important content falls within the user-selected important content in { L (x, y) }The depth value of the p' th characteristic point in the eight adjacent domains adjacent to the p-th characteristic point in the rectangular region,to representThe target depth value of (2).
B3 by solving for min (E)comfort+λfeature×Efeature) Obtaining the optimal target depth value set of all feature points in the rectangular region where the important content selected by the user falls in { L (x, y) } and recording the optimal target depth value set as Is composed ofThe optimal target depth value; then according toAcquiring the optimal target disparity value set of all feature points in the rectangular region where the important content selected by the user is located in the { L (x, y) } and recording the optimal target disparity value set as Is composed ofThe optimal target disparity value of (a) is,wherein min () is a function of taking the minimum value,λfeatureIs EfeatureIn this embodiment, take λ as the weighting parameter offeature=0.4。
B4, according toCalculating the total depth control energy E of target quadrilateral grids corresponding to all quadrilateral grids in the rectangular area where the important content selected by the user is located in the { L (x, y) } and the { R (x, y) } are locateddepth,
Wherein the symbol "| | |" is a euclidean distance-solving symbol,indicating the p-th feature point in the { L (x, y) } that falls within the rectangular area where the important content selected by the user is located,represents the p-th feature point in the R (x, y) within the rectangular area where the important content selected by the user is located,to representThe corresponding target feature points are set to be in a same shape,to representCorresponding purposeThe characteristic points are marked on the surface of the steel plate,to representThe position of the abscissa of the bar (a),to representThe position of the abscissa of the bar (a),to representThe position of the abscissa of the bar (a),to representThe horizontal coordinate position of the X-ray detector is that i 'is more than or equal to 1 and less than or equal to 4, k' is more than or equal to 1 and less than or equal to M,to representQuadrilateral grid UL,k'ith' mesh vertex, UL,k'is the kth' quadrilateral mesh in { L (x, y) },to representQuadrilateral grid UL,k' as the 1 st mesh vertex,to representQuadrilateral grid UL,k' as the 2 nd mesh vertex,to representQuadrilateral grid UL,k' as the top-right mesh vertex of the 3 rd mesh vertex,to representQuadrilateral grid UL,k' as the lower right mesh vertex of the 4 th mesh vertex,to representAndthe euclidean distance between them,to representTarget quadrilateral meshThe ith' mesh vertex of (a),is UL,k' a corresponding target quadrilateral mesh,to representTarget quadrilateral meshAs the 1 st mesh vertex,to representTarget quadrilateral meshAs the 2 nd mesh vertex,to representTarget quadrilateral meshAs the top-right mesh vertex of the 3 rd mesh vertex,to representTarget quadrilateral meshAs the 4 th mesh vertex,to representQuadrilateral grid UR,k'ith' mesh vertex, UR,k'is the kth' quadrilateral mesh in { R (x, y) },to representQuadrilateral grid UR,k' as the 1 st mesh vertex,to representQuadrilateral grid UR,k' as the 2 nd mesh vertex,to representQuadrilateral grid UR,k' as the top-right mesh vertex of the 3 rd mesh vertex,to representQuadrilateral grid UR,k' as the lower right mesh vertex of the 4 th mesh vertex,to representAndthe euclidean distance between them,to representTarget quadrilateral meshThe ith' mesh vertex of (a),is UR,k' a corresponding target quadrilateral mesh,representing characteristic pointsTarget quadrilateral meshAs the 1 st mesh vertex,to representTarget quadrilateral meshAs the 2 nd mesh vertex,to representTarget quadrilateral meshAs the top-right mesh vertex of the 3 rd mesh vertex,representing characteristic pointsTarget quadrilateral meshAs the 4 th mesh vertex.
Calculating the total background holding energy of the target quadrilateral grids corresponding to all quadrilateral grids in the { L (x, y) } and the { R (x, y) } which fall in the background area, and recording the total background holding energy as E according to all the feature points in the { L (x, y) } and the corresponding target feature points, and all the feature points in the { R (x, y) } and the corresponding target feature pointsback(ii) a The background area is an area except the rectangular area where the important content selected by the user is located.
In this embodiment, step E of step threebackThe calculation process of (2) is as follows:
wherein,representing a set of sequence numbers formed by renumbering all feature points falling in the background area in { L (x, y) } and { R (x, y) },represents the g-th feature point falling within the background region in { L (x, y) },represents the g-th feature point falling within the background region in { R (x, y) },to representThe corresponding target feature points are set to be in a same shape,to representCorresponding target characteristic points, the symbol "| | |" is a Euclidean distance-calculating symbol, i' is more than or equal to 1 and less than or equal to 4, k is more than or equal to 1 and less than or equal to M,to representQuadrilateral grid UL,k"ith' mesh vertex, UL,k"is the kth" quadrilateral mesh in { L (x, y) },to representQuadrilateral grid UL,k"left upper grid vertex as the 1 st grid vertex,to representQuadrilateral grid UL,k"as the 2 nd mesh vertex,to representQuadrilateral grid UL,k"top right mesh vertex as the 3 rd mesh vertex,to representQuadrilateral grid UL,k"as the lower right mesh vertex of the 4 th mesh vertex,to representAndthe euclidean distance between them,to representTarget quadrilateral netGrid (C)The ith' mesh vertex of (a),is UL,k"the corresponding target quadrilateral mesh,to representTarget quadrilateral meshAs the 1 st mesh vertex,to representTarget quadrilateral meshAs the 2 nd mesh vertex,to representTarget quadrilateral meshAs the top-right mesh vertex of the 3 rd mesh vertex,to representTarget quadrilateral meshAs the 4 th mesh vertex,to representQuadrilateral grid UR,k"ith' mesh vertex, UR,k"is the kth" quadrilateral mesh in { R (x, y) },to representQuadrilateral grid UR,k"left upper grid vertex as the 1 st grid vertex,to representQuadrilateral grid UR,k"as the 2 nd mesh vertex,to representQuadrilateral grid UR,k"top right mesh vertex as the 3 rd mesh vertex,to representQuadrilateral grid UR,k"as the lower right mesh vertex of the 4 th mesh vertex,to representAndthe euclidean distance between them,to representTarget quadrilateral meshThe ith' mesh vertex of (a),is UR,k"the corresponding target quadrilateral mesh,to representTarget quadrilateral meshAs the 1 st mesh vertex,representing characteristic pointsTarget quadrilateral meshAs the 2 nd mesh vertex,representing characteristic pointsTarget quadrilateral meshAs the top-right mesh vertex of the 3 rd mesh vertex,representing characteristic pointsTarget quadrilateral meshAs the 4 th mesh vertex.
Step four: according to Eedge、Eobject、EdepthAnd EbackCalculating the total energy of the target quadrilateral grids corresponding to all the quadrilateral grids in the { L (x, y) } and the { R (x, y) }, and recording the total energy as Etotal,Etotal=Eedge+λobject×Eobject+λdepth×Edepth+λback×Eback(ii) a Then solving by least squares optimizationObtaining a set formed by optimal target quadrilateral grids corresponding to all quadrilateral grids in the { L (x, y) } and optimal target quadrilateral grids corresponding to all quadrilateral grids in the { R (x, y) }Set of best target quadrilateral meshes, correspondence being notedAnd then according toCalculating the optimal similarity transformation matrix of the optimal target quadrilateral grids corresponding to each quadrilateral grid in the { L (x, y) }, and converting U into UL,kCorresponding optimal target quadrilateral meshIs recorded as the optimal similarity transformation matrix And according toCalculating the optimal similarity transformation matrix of the optimal target quadrilateral grids corresponding to each quadrilateral grid in the { R (x, y) }, and converting U into UR,kCorresponding optimal target quadrilateral meshIs recorded as the optimal similarity transformation matrix Wherein λ isobjectIs EobjectWeighting ofParameter, λdepthIs EdepthA weighting parameter ofbackIs EbackIn this embodiment, take λ as the weighting parameter ofobject=4、λdepth=8、λbackMin () is the take minimum function, 4,represents a set of target quadrilateral meshes corresponding to all quadrilateral meshes in the { L (x, y) },represents a set of target quadrilateral meshes corresponding to all quadrilateral meshes in R (x, y),represents UL,kThe corresponding optimal target quadrilateral mesh is selected from the set of target quadrilateral meshes,described by its set of 4 mesh vertices above left, below left, above right and below right, corresponding representation1 st mesh vertex, 2 nd mesh vertex, 3 rd mesh vertex, 4 th mesh vertex,represents UR,kThe corresponding optimal target quadrilateral mesh is selected from the set of target quadrilateral meshes,described by its set of 4 mesh vertices above left, below left, above right and below right, corresponding representation1 st mesh vertex, 2 nd mesh vertex, 3 rd mesh vertex, 4 th mesh vertex of (a)L,k)TIs AL,kTranspose of (A) ((A)L,k)TAL,k)-1Is (A)L,k)TAL,kThe inverse of (a) is,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representation(ii) a horizontal coordinate position and a vertical coordinate position of (A)R,k)TIs AR,kTranspose of (A) ((A)R,k)TAR,k)-1Is (A)R,k)TAR,kThe inverse of (a) is,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationA horizontal coordinate position and a vertical coordinate position of,andcorresponding representationA horizontal coordinate position and a vertical coordinate position.
Step five: according to the optimal similarity transformation matrix of the optimal target quadrilateral grid corresponding to each quadrilateral grid in the { L (x, y) }, calculating the horizontal coordinate position and the vertical coordinate position of each pixel point in each quadrilateral grid in the { L (x, y) } after the optimal similarity transformation rectangular transformation, and converting the U into the U-shaped coordinate positionL,kThe position of the middle horizontal coordinate is x'L,kAnd vertical coordinate position y'L,kThe correspondence of the horizontal coordinate position and the vertical coordinate position of the pixel point after the optimal similarity transformation matrix is recorded asAnd then, according to the horizontal coordinate position and the vertical coordinate position of each pixel point in each quadrilateral grid in the { L (x, y) } after the optimal similarity transformation rectangular transformation, a left viewpoint image after depth adjustment is obtained and recorded as a left viewpoint image after the depth adjustmentWherein x is not less than 1'L,k≤W,1≤y'L,k≤H,X 'is more than or equal to 1 and less than or equal to W', y 'is more than or equal to 1 and less than or equal to H, W' represents the width of the three-dimensional image after the depth adjustment, H is the height of the three-dimensional image after the depth adjustment,to representAnd the pixel value of the pixel point with the middle coordinate position of (x ', y').
Similarly, according to the optimal similarity transformation matrix of the optimal target quadrilateral grid corresponding to each quadrilateral grid in the { R (x, y) }, calculating the horizontal coordinate position and the vertical coordinate position of each pixel point in each quadrilateral grid in the { R (x, y) } after the optimal similarity transformation rectangular transformation, and converting the U into the U shapeR,kThe position of the middle horizontal coordinate is x'R,kAnd vertical coordinate position y'R,kThe correspondence of the horizontal coordinate position and the vertical coordinate position of the pixel point after the optimal similarity transformation matrix is recorded asAnd then, according to the horizontal coordinate position and the vertical coordinate position of each pixel point in each quadrilateral grid in the { R (x, y) } after the optimal similarity transformation rectangular transformation, a right viewpoint image after depth adjustment is obtained and recorded as a right viewpoint imageWherein x is not less than 1'R,k≤W,1≤y'R,k≤H,1≤x'≤W',1≤y'≤H,To representAnd the pixel value of the pixel point with the middle coordinate position of (x ', y').
To further illustrate the feasibility and effectiveness of the method of the present invention, the method of the present invention was tested.
Next, the subject depth adjustment experiment was performed on four stereoscopic images, Image1, Image2, Image3, and Image4, by the method of the present invention. FIG. 2a shows a "red/green" map of the original stereo Image of "Image 1", and FIG. 2b shows a "red/green" map of "Image 1" after object depth adjustment; FIG. 3a shows a "red/green" map of the original stereo Image of "Image 2", and FIG. 3b shows a "red/green" map of "Image 2" after object depth adjustment; FIG. 4a shows a "red/green" map of the original stereo Image of "Image 3", and FIG. 4b shows a "red/green" map of "Image 3" after object depth adjustment; fig. 5a shows a "red/green" map of the original stereoscopic Image of "Image 4", and fig. 5b shows a "red/green" map of "Image 4" after object depth adjustment. As can be seen from fig. 2a to 5b, the depth-adjusted stereoscopic image obtained by the method of the present invention can better retain the object shape, and the size of the important object can be increased according to the selection of the user.