Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Referring to Fig. 1, the embodiment of the invention provides a kind of method and apparatus of retrieving three-dimensional objects, comprising:
101: estimate the image conditional probability between each correspondence image in three dimensional object to be retrieved and the original three dimensional object respectively;
102: estimate the image sequence conditional probability between each correspondence image in three dimensional object to be retrieved and the original three dimensional object respectively;
103: utilize image conditional probability and image sequence conditional probability, estimate the conditional probability between three dimensional object to be retrieved and original three dimensional object;
104: the conditional probability between all three dimensional objects and original three dimensional object relatively, with the three dimensional object of conditional probability maximum, as the retrieving three-dimensional objects result.
The embodiment of the invention is by estimating image conditional probability and the image sequence conditional probability between each correspondence image in three dimensional object to be retrieved and the original three dimensional object, obtain the conditional probability between three dimensional object to be retrieved and original three dimensional object, the conditional probability between all three dimensional objects and original three dimensional object relatively, with the three dimensional object of conditional probability maximum result as retrieving three-dimensional objects, reduce the retrieval complexity, optimized retrieval effectiveness.
Embodiment 1
The embodiment of the invention provides a kind of retrieving three-dimensional objects method based on image collection, the image collection of three dimensional object is one group of visual pattern that obtains in different points of view, exist a large amount of spatial coherences between each visual pattern in the image collection, has the better space distribution characteristics, therefore, analyze comparison at the spatial information of image collection.
The embodiment of the invention is under the prerequisite of known original three dimensional object, retrieval and the high three dimensional object of original three-dimensional image similarity, analyze from the probability angle, realize the retrieval of three dimensional object by setting up the three dimensional object applied probability model, changed and traditional three dimensional object has been set up the method that model is directly analyzed, described in detail with a specific embodiment below.
Referring to Fig. 2, the embodiment of the invention provides a kind of method of retrieving three-dimensional objects, specifically comprises:
201: calculate the distance between each correspondence image in three dimensional object image collection to be retrieved and the original three dimensional object image collection respectively, and preserve all distances that obtain;
Particularly, in the three dimensional object database, choose a three dimensional object arbitrarily, as three dimensional object to be retrieved, the corresponding image collection of each three dimensional object, the method that the embodiment of the invention provides is directed to the identical situation of picture number in the image collection of each three dimensional object;
Image collection refers to one group at the resulting visual pattern of different points of view observation three dimensional object, and the image in image in the three dimensional object image collection to be retrieved and the original three dimensional object image collection is to concern one to one;
Suppose that original three dimensional object is labeled as Q; There is n three dimensional object in the three dimensional object database, be respectively A1, A2......An, the three dimensional object of choosing to be retrieved is labeled as A1, and the image collection of three dimensional object A1 to be retrieved and original three dimensional object comprises m image respectively, following expression:
The image collection of three dimensional object A1 to be retrieved: { a
1, a
2... a
m}
The image collection of original three dimensional object Q: { q
1, q
2... q
m}
Wherein, a
1, a
2... a
mRepresent each image in the three dimensional object A1 image collection to be retrieved respectively, q
1, q
2... q
mRepresent each image in the original three dimensional object Q image collection respectively;
The embodiment of the invention can adopt RGB (Red Green Blue, RGB) color histogram distance or Edge Distance or HSV (Hue Saturation Value, the color saturation lightness) histogram distance or small echo texture, calculate the distance between each correspondence image in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection respectively, promptly
a
1With q
1Between distance, be labeled as D
1(a
1, q
1),
a
2With q
2Between distance, be labeled as D
2(a
2, q
2),
......
a
mWith q
mBetween distance, be labeled as D
m(a
m, q
m).
202:, estimate the image conditional probability between each correspondence image respectively according to the distance between each correspondence image in three dimensional object image collection to be retrieved and the set of original three dimensional object;
Particularly, will
a
1With q
1Between the image conditional probability, be labeled as P
1(a
1| q
1),
a
2With q
2Between the image conditional probability, be labeled as P
2(a
2| q
2),
......
a
mWith q
mBetween the image conditional probability, be labeled as P
m(a
m| q
m);
Image conditional probability between two images meets probability distribution rule, and the embodiment of the invention is used Gaussian distribution and estimated conditional probability between correspondence image, and the image conditional probability between two images meets Gaussian distribution, promptly
P
1(a
1|q
1)~N(0,σ) (1)
According to the distance between each correspondence image in three dimensional object image collection to be retrieved and the original three dimensional object image collection, use the Gaussian distribution analysis and obtain:
Image conditional probability in three dimensional object image collection to be retrieved and the original three dimensional object image collection between other correspondence image meets Gaussian distribution equally, adopts same analytical approach to obtain corresponding image conditional probability.
203: calculate the transform mode between the adjacent image of each image and this image in three dimensional object image collection to be retrieved and the original three dimensional object image collection respectively;
Suppose that each image in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection respectively has x adjacent image, wherein 1≤x<m;
For the image in the three dimensional object A1 image collection to be retrieved, for example image a
1, with image a
1Adjacent image is designated as { R
1, R
2... R
x, wherein 1≤x<m calculates a respectively
1And the transform mode between x adjacent image is to calculate a
1With image R
1Between transform mode be example;
Particularly,
At first, with image a
1Be divided into the piece that N * N equates, improve the precision of pixel statistics;
Then, in each piece, statistical picture a
1With image R
1In all comprise the pixel number of object information, be designated as r
1Statistical picture a
1Comprise object information pixel and with image R
1In do not comprise the number of the pixel of object information, be designated as
Statistical picture a
1Do not comprise the pixel of object information and image R
1In comprise the pixel number of object information, be designated as
Wherein, each image is a picture element matrix, and the black pixel point in the image does not comprise object information, and the profile of white pixel point description object comprises object information;
At last, calculate the ratio value of three kinds of statisticses, that is:
Similarly, calculate a respectively
1With adjacent image R
2, R
3... R
xTransform mode, obtain respectively
......
For the image in the original three dimensional object Q image collection, for example image q
1, with image q
1Adjacent image is designated as { G
1, G
2... G
x, 1≤x<m wherein adopts and uses the same method, and calculates q respectively
1With image G
1, G
2... G
xBetween transform mode, obtain respectively
......
Similarly, calculate other image in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection according to the method described above and be adjacent transform mode between image.
204: the transform mode difference of calculating each correspondence image in three dimensional object image collection to be retrieved and the original three dimensional object image collection respectively;
Particularly, with the image a in the three dimensional object A1 image collection to be retrieved
1With corresponding image q in the original three dimensional object Q image collection
1Be example;
With image a
1Calculate ratio value and the image q that transform mode obtains in each piece
1It is poor that the ratio value correspondence that the calculating transform mode obtains in each piece is done, promptly
With
Make it poor,
With
Make it poor ...
With
Make it poor; Then the difference on all pieces is sued for peace, and normalization;
Difference between x the transform mode that obtains is averaged, obtain image a
1With image q
1Overall transform mode difference, be designated as: DT
1(a
1, q
1).
Similarly, adopt said method, obtain the transform mode difference of other correspondence image in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection respectively, promptly
a
2With q
2Transform mode difference, be labeled as DT
2(a
2, q
2),
......
a
mWith q
mTransform mode difference, be labeled as DT
m(a
m, q
m).
205:, estimate the image sequence conditional probability of each correspondence image respectively according to the transform mode difference of each correspondence image in three dimensional object image collection to be retrieved and the original three dimensional object image collection;
The inversely proportional relation of transform mode difference of image sequence conditional probability and image in the embodiment of the invention, can multiply by a coefficient with the inverse of the transform mode difference of image and obtain the image sequence conditional probability;
Particularly, the image sequence conditional probability of each correspondence image is respectively in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection:
a
1With q
1The conditional probability of image sequence
PST
1(a
1,q
1)=αDT
1(a
1,q
1)
-1 (9)
a
2With q
2The conditional probability of image sequence
PST
2(a
2,q
2)=αDT
2(a
2,q
2)
-1 (10)
......
a
mWith q
mThe conditional probability of image sequence
PST
m(a
m,q
m)=αDT
m(a
m,q
m)
-1 (11)
206:, estimate the conditional probability between three dimensional object to be retrieved and original three dimensional object according to image conditional probability and the image sequence conditional probability between each correspondence image in three dimensional object image collection to be retrieved and the original three dimensional object image collection;
Conditional probability refers under the situation of given original three dimensional object, the probability that three dimensional object to be retrieved occurs, and conditional probability can be represented the similarity of three dimensional object to be retrieved and original three dimensional object;
Conditional probability between three dimensional object A1 to be retrieved and original three dimensional object Q is designated: P (A
1| Q);
Estimate that according to formula (2) and formula (9)~(11) conditional probability of three dimensional object to be retrieved and original three dimensional object is:
Wherein, β is an empirical value, is obtained β in the embodiment of the invention=0.993 by experiment test.
207: the conditional probability of calculating other three dimensional object and original three dimensional object respectively;
N three dimensional object arranged in the three dimensional object database, is respectively A1, A2......An, respectively with each three dimensional object as object to be retrieved, then the conditional probability of each three dimensional object and original three dimensional object is respectively P (A
1| Q), P (A
2| Q) ... P (A
n| Q), promptly
Wherein, A
jThree dimensional object in the expression three dimensional object database, 1≤j≤n,
Q represents original three dimensional object,
a
i, q
iRepresent three dimensional object A to be retrieved respectively
jWith each image in the original three dimensional object Q image collection;
P (a
i| q
i) expression three dimensional object A to be retrieved
jAnd the image conditional probability between each correspondence image in the original three dimensional object Q image collection;
PST (a
i| q
i) expression three dimensional object A to be retrieved
jAnd the image sequence conditional probability between each correspondence image in the original three dimensional object Q image collection;
Concrete computing method such as step 201~206.
208: the conditional probability of each three dimensional object and original three dimensional object is compared, obtain the three dimensional object of conditional probability maximum, as the retrieving three-dimensional objects result;
Wherein, the similarity of the three dimensional object of conditional probability maximum and original three dimensional object is the highest.
The embodiment of the invention is by to setting up the probability analysis model based on the three dimensional object of image collection, utilize image conditional probability between image to describe the direct similarity of image in the three dimensional object image collection, utilize the image sequence conditional probability to describe the spatial information of image collection, has retrieving three-dimensional objects effect preferably, the effect of method that the embodiment of the invention is provided and art methods does one relatively below, and is as shown in table 1.
Table 1 retrieval effectiveness relatively
|
Precision ratio |
Recall ratio |
Search method provided by the invention |
0.378 |
0.378 |
The search method that Europe graphics meeting proposed in 2003 |
0.274 |
0.274 |
The embodiment of the invention is by the distance of three dimensional object more to be retrieved and each correspondence image of primary object, image conditional probability between estimated image, by calculating the transform mode difference between each correspondence image, estimate the image sequence conditional probability between each image, estimate conditional probability between three dimensional object to be retrieved and original three dimensional object by image conditional probability between image and image sequence conditional probability, the conditional probability between all three dimensional objects and primary object relatively, with the three dimensional object of conditional probability maximum as the retrieving three-dimensional objects result, direct similarity and image space information between each image of three dimensional object have been considered simultaneously, thereby reduced the retrieval complexity, optimized retrieval effectiveness.
Embodiment 2
Referring to Fig. 3, the embodiment of the invention provides a kind of device of retrieving three-dimensional objects, specifically comprises:
Distance calculation module 301 is used for calculating respectively the distance between three dimensional object image collection to be retrieved and original each correspondence image of three dimensional object image collection, and preserves all distances that obtain;
Particularly, in the three dimensional object database, choose a three dimensional object arbitrarily, as three dimensional object to be retrieved, the corresponding image collection of each three dimensional object, the method that the embodiment of the invention provides is directed to the identical situation of picture number in the image collection of each three dimensional object;
Image collection refers to one group at the resulting visual pattern of different points of view observation three dimensional object, and the image in image in the three dimensional object image collection to be retrieved and the original three dimensional object image collection is to concern one to one;
Suppose that original three dimensional object is labeled as Q; There is n three dimensional object in the three dimensional object database, be respectively A1, A2......An, the three dimensional object of choosing to be retrieved is labeled as A1, and the image collection of three dimensional object A1 to be retrieved and original three dimensional object comprises m image respectively, following expression:
The image collection of three dimensional object A1 to be retrieved: { a
1, a
2... a
m}
The image collection of original three dimensional object Q: { q
1, q
2... q
m}
In the embodiment of the invention, distance calculation module 301 can adopt RGB (Red Green Blue, RGB) color histogram distance or Edge Distance or HSV (Hue Saturation Value, the color saturation lightness) histogram distance or small echo texture, calculate the distance between each correspondence image in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection respectively, promptly
a
1With q
1Between distance, be labeled as D
1(a
1, q
1),
a
2With q
2Between distance, be labeled as D
2(a
2, q
2),
......
a
mWith q
mBetween distance, be labeled as D
m(a
m, q
m).
First estimation module 302, the distance between each correspondence image that is used for obtaining according to distance calculation module 301 is estimated the image conditional probability between each correspondence image in three dimensional object to be retrieved and the original three dimensional object respectively;
Particularly, will
a
1With q
1Between the image conditional probability, be labeled as P
1(a
1| q
1),
a
2With q
2Between the image conditional probability, be labeled as P
2(a
2| q
2),
......
a
mWith q
mBetween the image conditional probability, be labeled as P
m(a
m| q
m);
Image conditional probability between two images meets probability distribution rule, and the embodiment of the invention is used Gaussian distribution and estimated conditional probability between correspondence image, and the image conditional probability between two images meets Gaussian distribution, promptly
P
1(a
1|q
1)~N(0,σ) (14)
According to the distance between each correspondence image in three dimensional object image collection to be retrieved and the original three dimensional object image collection, use the Gaussian distribution analysis and obtain:
Image conditional probability in three dimensional object image collection to be retrieved and the original three dimensional object image collection between other correspondence image meets Gaussian distribution equally, adopts same analytical approach to obtain corresponding image conditional probability.
Transform mode computing module 303 is used for calculating respectively the transform mode between the adjacent image of three dimensional object image collection to be retrieved and original each image of three dimensional object image collection and this image;
Suppose that each image in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection respectively has x adjacent image, wherein 1≤x<m;
For the image in the three dimensional object A1 image collection to be retrieved, for example image a
1, with image a
1Adjacent image is designated as { R
1, R
2... R
x, wherein 1≤x<m calculates a respectively
1And the transform mode between x adjacent image is to calculate a
1With image R
1Between transform mode be example;
Particularly,
At first, with image a
1Be divided into the piece that N * N equates, improve the precision of pixel statistics;
Then, in each piece, statistical picture a
1With image R
1In all comprise the pixel number of object information, be designated as r
1Statistical picture a
1Comprise object information pixel and with image R
1In do not comprise the number of the pixel of object information, be designated as
Statistical picture a
1Do not comprise the pixel of object information and image R
1In comprise the pixel number of object information, be designated as
Wherein, each image is a picture element matrix, and the black pixel point in the image does not comprise object information, and the profile of white pixel point description object comprises object information;
At last, calculate the ratio value of three kinds of statisticses, that is:
Similarly, calculate a respectively
1With adjacent image R
2, R
3... R
xTransform mode.
For the image in the original three dimensional object Q image collection, for example image q
1, with image q
1Adjacent image is designated as { G
1, G
2... G
x, 1≤x<m wherein adopts and uses the same method, and calculates q respectively
1With image G
1, G
2... G
xBetween transform mode.
Similarly, calculate other image in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection according to the method described above and be adjacent transform mode between image.
Difference computing module 304 is used for the transform mode that obtains according to transform mode computing module 303, calculates the transform mode difference of each correspondence image in three dimensional object image collection to be retrieved and the original three dimensional object image collection respectively;
Particularly, with the image a in the three dimensional object A1 image collection to be retrieved
1With corresponding image q in the original three dimensional object Q image collection
1Be example;
With image a
1Calculate ratio value and the image q that transform mode obtains in each piece
1It is poor that the ratio value correspondence that the calculating transform mode obtains in each piece is done, promptly
With
Make it poor,
With
Make it poor ...
With
Make it poor; Then the difference on all pieces is sued for peace, and normalization;
Difference between x the transform mode that obtains is averaged, obtain image a
1With image q
1Overall transform mode difference, be designated as: DT
1(a
1, q
1).
Similarly, adopt said method, obtain the transform mode difference of other correspondence image in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection respectively, promptly
a
2With q
2Transform mode difference, be labeled as DT
2(a
2, q
2),
......
a
mWith q
mTransform mode difference, be labeled as DT
m(a
m, q
m).
Second estimation module 305 is used for the transform mode difference of each correspondence image of obtaining according to difference computing module 304, estimates the image sequence conditional probability of each correspondence image in three dimensional object to be retrieved and the original three dimensional object respectively;
The inversely proportional relation of transform mode difference of image sequence conditional probability and image in the embodiment of the invention, can multiply by a coefficient with the inverse of the transform mode difference of image and obtain the image sequence conditional probability;
Particularly, the image sequence conditional probability of each correspondence image is respectively in three dimensional object A1 image collection to be retrieved and the original three dimensional object Q image collection:
a
1With q
1The conditional probability of image sequence
PST
1(a
1,q
1)=αDT
1(a
1,q
1)
-1 (16)
a
2With q
2The conditional probability of image sequence
PST
2(a
2,q
2)=αDT
2(a
2,q
2)
-1 (17)
......
a
mWith q
mThe conditional probability of image sequence
PST
m(a
m,q
m)=αDT
m(a
m,q
m)
-1 (18)
The 3rd estimation module 306, image sequence conditional probability between each correspondence image that the image conditional probability between each correspondence image that is used for obtaining according to first estimation module 302 and second estimation module 305 obtain is estimated the conditional probability between three dimensional object to be retrieved and original three dimensional object;
Conditional probability refers under the situation of given original three dimensional object, the probability that three dimensional object to be retrieved occurs, and conditional probability can be represented the similarity of three dimensional object to be retrieved and original three dimensional object;
Conditional probability between three dimensional object A1 to be retrieved and original three dimensional object Q is designated: P (A
1| Q);
Wherein, β is an empirical value, is obtained β in the embodiment of the invention=0.993 by experiment test.
Retrieval module 307 is used for calculating respectively the conditional probability of other three dimensional object and original three dimensional object, and the conditional probability of each three dimensional object and original three dimensional object is compared, and obtains the three dimensional object of conditional probability maximum, as the retrieving three-dimensional objects result;
N three dimensional object arranged in the three dimensional object database, is respectively A1, A2......An, respectively with each three dimensional object as object to be retrieved, then the conditional probability of each three dimensional object and original three dimensional object is respectively P (A
1| Q), P (A
2| Q) ... P (A
n| Q);
Compare all conditions probability, wherein the similarity of the three dimensional object of conditional probability maximum and original three dimensional object is the highest, as the result of retrieving three-dimensional objects.
Further, transform mode computing module 303 specifically comprises:
Divide module unit 3031, be used for the adjacent image of three dimensional object image collection to be retrieved and original each image of three dimensional object image collection and this image is carried out piecemeal, improve the precision of pixel statistics;
Statistic unit 3032 is used at each piece, all comprises the pixel number of object information in the statistical picture image adjacent with this image; Statistical picture comprises the pixel of object information and does not comprise the number of the pixel of object information in the image adjacent with this image; Statistical picture does not comprise the pixel of object information and comprises the pixel number of object information in the image adjacent with this image;
Ratio computing unit 3033 is used to calculate the ratio value of three kinds of statisticses.
Difference computing module 304 specifically comprises:
Ask poor unit 3041, be used for that the ratio value of each piece of three dimensional object image to be detected that computing unit 3033 is relatively obtained is corresponding with ratio value in original each piece of three dimensional object image to be done poorly, then the difference on all pieces is sued for peace, and normalization;
The unit 3042 of averaging, the difference between the transform mode that is used for asking poor unit 3041 to obtain is averaged, and obtains the transform mode difference between each correspondence image.
Retrieval module 307 specifically comprises:
Computing unit 3071 is used for calculating respectively the conditional probability of other three dimensional object and original three dimensional object;
Comparing unit 3072, each three dimensional object that is used for computing unit 3071 is obtained and the conditional probability of original three dimensional object compare, and obtain the three dimensional object of conditional probability maximum, as the retrieving three-dimensional objects result.
The embodiment of the invention is by the image conditional probability between the first estimation module estimated image, estimate image sequence conditional probability between each image by second estimation module, estimate conditional probability between three dimensional object to be retrieved and original three dimensional object by the 3rd estimation module according to image conditional probability and image sequence conditional probability, the conditional probability between all three dimensional objects and primary object relatively, with the three dimensional object of conditional probability maximum as the retrieving three-dimensional objects result, thereby reduced the retrieval complexity, optimized retrieval effectiveness.
All or part of content in the technical scheme that above embodiment provides can realize that its software program is stored in the storage medium that can read by software programming, storage medium for example: the hard disk in the computing machine, CD or floppy disk.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.