Content of the invention
It is an object of the invention to provide a kind of three-dimensional real time imagery method, thus solving aforementioned present in prior art
Problem.
To achieve these goals, the technical solution used in the present invention is as follows:
A kind of three-dimensional real time imagery method, comprises the steps:
S1, determines the acquisition parameters of high-speed camera, including time interval and single group between shooting group number, frame rate, group
Interior frame number;
S2, coding controls described high-speed camera according to described acquisition parameters, rotary part to be shot, and obtains
The two dimensional image of described rotary part;
S3, extracts the boundary contour of described two dimensional image;
S4, is separated into two-dimensional coordinate, and the rotation according to described rotary part by extracting the described boundary contour obtaining
Gyration carries out changes in coordinates, obtains constituting the three-dimensional coordinate of the point of described rotary part;
S5, is fitted obtaining the bus of described rotary part to the three-dimensional coordinate of the point of described rotary part;Using institute
State bus group and do curved surface, form three-dimensional image.
Preferably, in S1, described frame rate is calculated using equation below:
In formula,
f:Frame rate,
θ:The angle that when shooting every time, rotary part rotated through relative to last time,
n:The rotating speed of rotary part.
Preferably, in S1, in described single group, frame number is calculated using equation below:
M=360/ θ
In formula,
m:Frame number in single group,
θ:The angle that when shooting every time, rotary part rotated through relative to last time.
Preferably, in S1, described shooting group number is calculated using equation below:
In formula,
l:Shooting group number,
I:Intensity,
δ:Precision,
t:Time.
Preferably, S3 comprises the steps:
S301, sets a numerical value;
S302, each pixel of the gray level image of described two dimensional image and the numerical value of this setting is compared, obtains
The all pixels point of this numerical value must be more than, and all pixels point less than this numerical value;
S303, obtain be located at the described all pixels point more than this numerical value, and less than this numerical value all pixels point it
Between pixel, form described two dimensional image boundary contour.
Preferably, S4 comprises the steps:
S401, outline line is that pixel forms one by one, the central shaft of described rotary part is set to X-axis, described rotation
The summit of part is set to initial point, obtains the two-dimensional coordinate of each pixel forming described boundary contour;
S402, the two-dimensional coordinate obtaining in S401 is converted into polar coordinates;
S403, the angle being turned over according to the described rotary part of every graphical representation, obtain the described side forming this image
The three-dimensional cylindrical coordinates of each pixel of boundary's outline line.
Preferably, S5 specifically can adopt and be implemented with the following method:
S501, the three-dimensional cylindrical coordinates of all pixels obtaining in S403 point is converted in surf function in Matlab requiring
Matrix,
S502, calls the surf function in Matlab, obtains three-dimensional image.
The invention has the beneficial effects as follows:A kind of three-dimensional real time imagery method provided in an embodiment of the present invention, by according to rotation
The rotating speed of rotation member, to adjust the frame rate of camera, is realized automatically controlling of discontinuity shooting, and need not manually be operated, not only
Save human resources, and improve shooting control accuracy, in addition, by changing into three-dimensional by shooting the two dimensional image obtaining
Stereo-picture, that can realize rotary part on image reduces the research so as to high-speed rotary part and its surface condition
More there is foundation.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, below in conjunction with accompanying drawing, the present invention is entered
Row further describes.It should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not used to
Limit the present invention.
As shown in figure 1, embodiments providing a kind of three-dimensional real time imagery method, comprise the steps:
S1, determines the acquisition parameters of high-speed camera, including time interval and single group between shooting group number, frame rate, group
Interior frame number;
S2, coding controls described high-speed camera according to described acquisition parameters, rotary part to be shot, and obtains
The two dimensional image of described rotary part;
S3, extracts the boundary contour of described two dimensional image;
S4, is separated into two-dimensional coordinate, and the rotation according to described rotary part by extracting the described boundary contour obtaining
Gyration carries out changes in coordinates, obtains constituting the three-dimensional coordinate of the point of described rotary part;
S5, is fitted obtaining the bus of described rotary part to the three-dimensional coordinate of the point of described rotary part;Using institute
State bus group and do curved surface, form three-dimensional image.
In practical operation, determine time interval between shooting group number, frame rate, group, frame number in single group as requested
Set in operation interface after (every group of shooting number), store path, need to click on when starting to shoot and start shooting and can complete
Image automatic shooting and storage.
Programme controlled Main Function is just that instead of people makes it more accurate come the shooting and stopping to control camera, specifically
Process in turn includes the following steps:Camera starts shooting --- shoot the n second----stop shoots and transmits
Data ----waiting m (the every group of interval-n) second ----startup shoots and is repeated up to complete the shooting of all groups of numbers.
In S1, described frame rate can be calculated using equation below:
In formula,
f:Frame rate,
θ:The angle that when shooting every time, rotary part rotated through relative to last time,
n:The rotating speed of rotary part.
In S1, in described single group, frame number can be calculated using equation below:
M=360/ θ
In formula,
m:Frame number in single group,
θ:The angle that when shooting every time, rotary part rotated through relative to last time.
In S1, described shooting group number can be calculated using equation below:
In formula,
l:Shooting group number,
I:Intensity,
δ:Precision,
t:Time.
S3 may include steps of:
S301, sets a numerical value;
S302, each pixel of the gray level image of described two dimensional image and the numerical value of this setting is compared, obtains
The all pixels point of this numerical value must be more than, and all pixels point less than this numerical value;
S303, obtain be located at the described all pixels point more than this numerical value, and less than this numerical value all pixels point it
Between pixel, form described two dimensional image boundary contour.
The extraction process of the boundary contour of above-mentioned two dimensional image, mainly to judge according to gray scale:The gray scale of picture
Each pixel of image is stored as a byte in computer, and its value is set as certain number between 0-255.Numerical value
Bigger this pixel of expression brighter (white), numerical value is more little then to represent pixel darker (black).First set a numerical value, compared with this number
What value was big is considered as white pixel, and little compared with this numerical value is considered as black picture element.White pixel is edge with the boundary of black picture element.
In the embodiment of the present invention, S4 may include steps of:
S401, outline line is that pixel forms one by one, the central shaft of described rotary part is set to X-axis, described rotation
The summit of part is set to initial point, obtains the two-dimensional coordinate of each pixel forming described boundary contour;
S402, the two-dimensional coordinate obtaining in S401 is converted into polar coordinates;
S403, the angle being turned over according to the described rotary part of every graphical representation, obtain the described side forming this image
The three-dimensional cylindrical coordinates of each pixel of boundary's outline line.
S5 specifically can adopt and be implemented with the following method:
S501, the three-dimensional cylindrical coordinates of all pixels obtaining in S403 point is converted in surf function in Matlab requiring
Matrix,
S502, calls the surf function in Matlab, obtains three-dimensional image.
By using technique scheme disclosed by the invention, having obtained following beneficial effect:The embodiment of the present invention carries
For a kind of three-dimensional real time imagery method, adjust the frame rate of camera by the rotating speed according to rotary part, realize interruption
Property shoot automatically control, and need not manually operate, not only save human resources, and improve shooting control accuracy, separately
Outward, by changing into three-dimensional image by shooting the two dimensional image obtaining, the reduction of rotary part can be realized on image,
So that the research to high-speed rotary part and its surface condition more has foundation.
Each embodiment in this specification is all described by the way of going forward one by one, what each embodiment stressed be with
The difference of other embodiment, between each embodiment identical similar partly mutually referring to.
Those skilled in the art should be understood that the sequential of the method and step that above-described embodiment provides can be entered according to actual conditions
Row accommodation, is concurrently carried out also dependent on actual conditions.
All or part of step in the method that above-described embodiment is related to can be instructed by program correlation hardware Lai
Complete, described program can be stored in the storage medium that computer equipment can read, for executing the various embodiments described above side
All or part of step described in method.Described computer equipment, for example:Personal computer, server, the network equipment, intelligent sliding
Dynamic terminal, intelligent home device, wearable intelligent equipment, vehicle intelligent equipment etc.;Described storage medium, for example:RAM、
ROM, magnetic disc, tape, CD, flash memory, USB flash disk, portable hard drive, storage card, memory stick, webserver storage, network cloud storage
Deng.
Last in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by
One entity or operation are made a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between there is any this actual relation or order.And, term " inclusion ", "comprising" or its any other variant meaning
Covering comprising of nonexcludability, so that including a series of process of key elements, method, commodity or equipment not only include that
A little key elements, but also include other key elements being not expressly set out, or also include for this process, method, commodity or
The intrinsic key element of equipment.In the absence of more restrictions, the key element being limited by sentence "including a ...", does not arrange
Remove and also there is other identical element in the process including described key element, method, commodity or equipment.
The above is only the preferred embodiment of the present invention it is noted that ordinary skill people for the art
For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should
Depending on protection scope of the present invention.