CN102831577B - The quick Zoom method of two-dimension earthquake image based on GPU - Google Patents
The quick Zoom method of two-dimension earthquake image based on GPU Download PDFInfo
- Publication number
- CN102831577B CN102831577B CN201210312729.3A CN201210312729A CN102831577B CN 102831577 B CN102831577 B CN 102831577B CN 201210312729 A CN201210312729 A CN 201210312729A CN 102831577 B CN102831577 B CN 102831577B
- Authority
- CN
- China
- Prior art keywords
- data
- cuda
- gpu
- image
- interpolation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Abstract
The invention discloses the quick Zoom method of a kind of two-dimension earthquake image based on GPU, be incorporated in the application of earthquake cromogram scaling by the bi-cubic interpolation algorithm that GPU is accelerated, improve scaling and interaction effect;CUDA and openGL bridging technology is incorporated in cromogram scaling algorithm, the display of cromogram after accelerating to scale;Deblocking technology is applied to during seismic profile cromogram shows, display and the scaling problem of magnanimity earthquake cross-sectional data can be solved;Having the optimal effectiveness of bi-cubic interpolation, do not have mosaic, edge transition is mild;Ensure that mass data also can scale in real time, and scaling speed is fast;The internal memory of inventive algorithm limits and limits much smaller more than the internal memory of common double cube interpolation, is suitable for processing the seismic section image of big data quantity.
Description
Technical field
The present invention relates to the quick Zoom method of a kind of two-dimension earthquake image based on GPU.
Background technology
Image information is the main media that the mankind transmit visual information, and image is vivid to the object that people are directly perceived and concrete,
This is that sound, language and word can not be compared.In geological prospecting, a large amount of X-Y schemes obtained by geologic interpretation software
The picture such as information such as two-dimension earthquake profile, provides many facilities, the height of two-dimension earthquake image information accuracy for investigation and prospecting
Low, determine the action effect of geologic interpretation software.
At geological exploration field, because its two-dimension earthquake section number of channels processed is often the order of magnitude in several ten thousand roads, data
Measuring very large, have magnanimity, and the real-time that image manipulation is mutual, large-scale data graph image real-time rendering is at this
One field just seems and is even more important.To in the process of image and interactive operation, the amplification of image and reduce as one basic
Image processing techniques, in the real-time rendering of large-scale data image, as a kind of common operation, have in actual applications
There is important effect.
The quality of mathematical model used by image zooming, it will usually directly affect user and watch quality and the speed of image.?
In geologic interpretation software, due to magnanimity and the mutual real-time of geological data, it is desirable to high-quality existing to geologic image
Scaling also to have the effect of quickly display.
Therefore, the quick scaling of two-dimension earthquake image to be accomplished, need three committed steps: first, mass data is divided
Block becomes the small block data of suitable size to process.Second, select an algorithm, it is ensured that seismic section image can have high-quality
Zooming effect.3rd, this Algorithms T-cbmplexity is little, can make the suitable size that two-dimension earthquake view data is formed after piecemeal
Small block data can process in real time.
One maximum feature of seismic profile data is that data volume is big, usually has 100,000,000, and
Often have the data of several G.In the face of the hugest data, it is extremely difficult for quickly scaling.This is to computer
Hardware and application software are proposed the highest requirement.For magnanimity earthquake image real time transfer, maximum problem is
View data is often big than the internal memory of computer.Seismic profile data also have a feature clearly exactly: it is together
Data together, can be accessed by road.So, the seismic profile data to magnanimity, first can obtain display by road to be shown
Start channel and display terminate the data in road, and these data typically have about 100M, for the data of medium suitable size.Magnanimity number
According to piecemeal well after, for the data block of suitable size, it is necessary to select an algorithm that can have high-quality zooming effect.
Digital picture is the dot array data of discretization.Digital picture zoomed in and out, to be necessary for utilizing known data
With priori, unknown sampled point is estimated.The scaling of digital picture generally realizes by image interpolation.Interpolation algorithm
Quality will be directly connected to the distortion level of image.
In theory, the problem that image scaling is considered as a binary function reconstruct and resampling.If pixel on image (i,
J) color value at place is fij, image size is M × N, now will be by image scaling to P × Q, then image scaling can be described as follows:
(x, function y) being defined on 2 dimensional region, first according to the discrete colors value { f at pixel to assume fij(i=0,
1,...M-1;J=0,1 ... N-1) and reconstruction of function f (x, y) so that f (i, j)=fij, wherein (x, y) ∈ [0, M-1] × [0,
N-1];If source images is gray-scale map, then (x y) is scalar function to f;If source images is coloured image, then and f (x, y)
For phasor function;Then on [0, P-1] × [0, Q-1], according to suitable rule, to f, (x, y) carries out resampling, and result is
Target image after scaling.When P < M and Q is < during N, for image down;As P > M and Q > N time be image amplify.
As the basic operation in image procossing, the most more research existing to image scaling, the most most importantly based on
The method of interpolation kernel function.This kind of interpolation algorithm belongs to traditional linear interpolation algorithm, and with in traditional image scaling theory
The theory " using a continuous function to describe discrete picture " matches.
If (x, y) is the currently processed pixel in target image T, and the general step of such method is: first will (x, y) to
Before (i+u, the j+v) that be mapped in source images S, wherein (0≤u≤1,0≤v≤1), then use pixel (i, j) the most certain
Pixel in territory is as sampled point, and (x y), can use formula table to obtain required pixel according to certain linear interpolation method
It is shown as:
S in formulaijTake from the sampled point of source images S;F (x-i, y-j) is interpolation kernel function, in order to reduce operand, often
Select linear kernel function, i.e. f (x, y)=f (x) f (y).
Such algorithm is essentially identical with tradition interpolation algorithm principle, and the difference between algorithm is utilized sampled point model
Enclose and the difference of interpolation kernel function.Some of them common form is as follows.They have different pluses and minuses.
1) nearest-neighbor interpolation method (Nearest)
This is the simplest algorithm in image scaling, because its interpolation kernel function is zero-order function, is also zeroth-order interpolation, its
Core is that simple pixel replicates.The sampled point interval that this algorithm utilizes is 1 × 1, i.e. and T (x, y)=S (i, j).This algorithm letter
Single, directly perceived, efficient, but obvious crenellated phenomena can be produced when image amplifies, it is difficult to obtain the most high-quality target
Image.The method precision is the highest, but speed is fast, can be used in and browse etc. inessential but require fireballing occasion.
2) bilinear interpolation (Bilinear)
Bilinear interpolation is also single order interpolation, and this algorithm is by S, (i, j) 4 the most adjacent pixels are in both direction
Determine the value of new pixel respectively as linear interpolation, sampled point interval is 2 × 2,4 corresponding sampled points be respectively S (i,
J), S (i+1, j), S (i, j+1) and S (i+1, j+1), i.e.:
T (x, y)=S (i+u, j+v)=(1-u) (1-v) f (i, j)+(1-u) vf (i, j+1)+u (1-v) f (i+1, v)+
The calculating of uvf (i+1, j+1) bilinear interpolation method is more complicated than nearest-neighbor interpolation method, and amount of calculation is bigger.But do not have gray scale not
Successional shortcoming, result is satisfactory.It has low-pass filtering character, but the method can make high fdrequency component impaired, and image is taken turns
Exterior feature has certain fuzzy.Major defect is for not only to have smoothed image high fdrequency component but also make low frequency component create aliasing.
3) bicubic interpolation method (Bicubic)
The sampled point interval of bicubic interpolation algorithm is 4 × 4, make use of S (i, j) information of 16 pixels of surrounding.This is inserted
Value kernel function typically uses preferable interpolating function sin c (x)=the theoretic of sin (x)/x most preferably to approach.Bi-cubic interpolation can
To be realized by lagrange polynomial, cubic spline function or cubic convolution algorithm.Cubic spline function is exactly preferable
The theoretic of interpolating function sin c (x)=sin (x)/x most preferably approaches.Lagrange polynomial the most easily realizes.
Bicubic interpolation eliminates the sawtooth of nearest-neighbor interpolation method and loses shape problem and " mosaic " problem, also solves double
The edge blurring problem of quadratic interpolation, interpolation results is best, and precision is the highest, has preferable visual effect, but amount of calculation is relatively big,
Complexity is higher.
Due to the particularity in geological exploration field, both having required effective, precision is high, requires again scaling real-time, interactive.Institute
Both need to reach the effect of bicubic side's interpolation with the present invention, make to reach alternately real-time effect again.For geological data figure
For Xiang, because the magnanimity of data, being blocked into the data of suitable size, each small block data also has about 100M, if directly
Connect and use traditional bicubic side's interpolation, although can reach the ideal effect that precision is high, but be intended to through the veryest long etc.
Treating the time, interaction effect is poor.
The problem of bicubic side to be solved interpolation processing time length, needs quickly to realize bicubic side's interpolation.This can lead to
Cross use GPU accelerate parallel computation realize.
The growth rate of graphic process unit (GPU) computing capability in graphic hardware has been over central processing unit at present
(CPU) growth rate of computing capability, main flow graphics hardware manufacturers claims, the performance every 1 year GPU will increase by 1 now
Times.One the topmost breakthrough of graphic hardware technology introduces programmable functions exactly in graphic hardware, and this function allows to use
Family is worked out self-defining coloration program (Shader program) and is replaced some functional module in original fixed flowline,
Make GPU functionally more like a general processor.Although GPU has the highest calculating speed, but can not directly by
The algorithm realized in CPU in the past is indiscriminately imitated in GPU and is performed, this is because the instruction execution mode of GPU and CPU are different,
The architecture of GPU is single-instruction multiple-data (SIMD) the instruction execution system of a kind of highly-parallel.So will be based on able to programme
Graphic hardware realizes the algorithm that some are inefficient in CPU, is necessary for reorganizing data structure and the step that algorithm realizes,
To make full use of the performance advantage that GPU parallel processing architecture brings.
Prior art related to the present invention includes:
At present, prior art related to the present invention, there is " the Biquadratic B-spline image based on GPU of the propositions such as Xia Haihong
Scaling " (Journal of Mechanical&Electrical Engineering 2010) etc..These algorithms or article have
Just with bicubic side's interpolation but not do not improve, " the image based on bicubic interpolation algorithm proposed such as Zhang Azhen etc.
The design of zooming engine " (microelectronics and computer 2007);Have accelerates bicubic side by GPU, but acceleration is double
Cubic B-spline scales, such as " bi-cubic B spine Zoom method based on CUDA " (Computer of the propositions such as Laurus nobilis morning
Engineering and Application 2009)。
Any of the above Image Zooming Algorithm has following defects that first, just for the scaling of common size image, does not all have
Have in the specific field being applied to two-dimension earthquake image scaling.Second, major part is by directly proposing a cubic spline letter
Number realizes bicubic side's interpolation, but is not the bi-cubic interpolation in complete meaning.3rd, image data scaling has processed
After, display process is not made improvements, to accelerate display.
At geological exploration field, the cromogram of geological data shows a most basic merit as geologic interpretation software
Can, the good job of the effect of its display first and foremost determines the effect of the follow-up flow process of geologic interpretation.
In existing geologic interpretation software, most cromogram scaling is all by the bilinear interpolation in openGL or Qt
Realize.Although scaling speed is fast, but the image after amplifying has certain fuzzy, and unsightly, zooming effect is bad for image.
Although only geologic interpretation software such as SMT scaling can reach the effect of bi-cubic interpolation, but scaling speed
Slowly, when earthquake cross-sectional data exceed memory size i.e. arrive magnanimity DBMS time, most softwares cannot show or in real time
Display, scaling can not realize the most completely in real time.
Summary of the invention
In order to overcome the disadvantages mentioned above of prior art, the invention provides the fast of a kind of two-dimension earthquake image based on GPU
Speed Zoom method, on the premise of guaranteeing earthquake mass data section cromogram zooming effect, it is achieved that magnanimity earthquake profile
As the real-time that scaling is mutual.
The technical solution adopted for the present invention to solve the technical problems is: a kind of two-dimension earthquake image based on GPU fast
Speed Zoom method, comprises the steps:
Step one, the piecemeal of magnanimity earthquake cross-sectional data: set up two data buffer zones of Foreground and Background, wherein: foreground buffers
District directly serves in displaying of graph and image, and back buffer district is then corresponding to hard disk operation, and is realized forward and backward by multithreading
The exchange of data content between two data buffer zones of platform;
Step 2, employing bi-cubic interpolation algorithm realize scaling;
GPU parallel computation under step 3, CUDA framework;
Step 4, GPU speed up to bi-cubic interpolation:
(1) detection GPU performance parameter;
(2) display window is initialized;
(3) intervalometer is created for measuring;
(4) image data after piecemeal is obtained;
(5) distribution CUDA array, image reproduction data is to array;
(6) arrange and bind CUDA parametric texture to CUDA array;
(7) pixel buffer object is created;
(8) registration video memory buffer object;
(9) display texture is created;
(10) interpolation renders;
Step 5, CUDA and openGL interoperability accelerate display: use CUDA to generate data, then use OpenGL at screen
The figure represented by data is drawn out on curtain.
Compared with prior art, the positive effect of the present invention is:
(1) by GPU accelerate bi-cubic interpolation algorithm be incorporated into earthquake cromogram scaling application in, improve scaling and
Interaction effect.
(2) CUDA and openGL bridging technology is incorporated in cromogram scaling algorithm, cromogram after accelerating to scale
Display.
(3) deblocking technology is applied to during seismic profile cromogram shows, magnanimity earthquake cross-sectional data can be solved
Display and scaling problem.
(4) having the optimal effectiveness of bi-cubic interpolation, do not have mosaic, edge transition is mild.
(5) ensure that mass data also can scale in real time, and scaling speed be fast:
The present invention is the test data drawn after strict emulation testing, and these view data are all at mass data piecemeal
After, the corresponding data obtained according to window size, zoom factor is 2, amplifies 2 times.Bi-cubic interpolation algorithm is calculated with this patent
The test data such as following table of method:
By repeatedly timing measuring, from various algorithms and the data measured under environment:
In bi-cubic interpolation algorithm, in the case of i.e. not having GPU to accelerate, this algorithm process speed is 0.41 million pictures
Element/second;This patent algorithm, when image size is 512*512 pixel, compares double cube algorithm, improves 49 times;When image is big
Little for 1024*1024 pixel time, compare double cube algorithm, improve 85 times;
Compared with this patent algorithm from bi-cubic interpolation algorithm: bi-cubic interpolation algorithm is at this hardware and running software
Processing speed under environment is 0.41 mega pixel/second;And the processing speed of this patent algorithm, because the most certain GPU meter
Calculation resource is idle, can be big along with the change processing data, and processing speed index rises.This meets GPGPU technology just only when place
When the data volume of reason is sufficiently large, the feature of the speed of service could be improved.This has also confirmed the increase along with data volume, GPGPU skill
Art advantage is more and more obvious.
The internal memory of this patent algorithm limits and limits much smaller more than the internal memory of common double cube interpolation, is suitable for processing
The seismic section image of big data quantity.
Detailed description of the invention
The inventive method is concurrency and the magnanimity utilizing geological data, first mass data is done piecemeal and processes,
Data block to the suitable size being in indication range.Bicubic side's interpolation algorithm is accelerated, to suitable size secondly by GPU
Data block zoom in and out process.Finally, in conjunction with the feature of cuda and openGL, use cuda and openGL bridging technology,
Accelerate quickly display.This patent algorithm is applied to mass seismic data cromogram and shows, makes geologic interpretation software existing high-quality
Amount zooming effect, again can be good mutual.Specifically comprise the following steps that
Step one, the piecemeal of magnanimity earthquake cross-sectional data:
In order to reach the purpose that magnanimity earthquake view data is shown in real time, set up storage based on partition and management
Mechanism is a kind of conventional and effective basic skills.Before magnanimity earthquake profile image is zoomed in and out, need mobile image with
Determine region to be scaled.Along with the movement of viewpoint, need to constantly update the data block in internal memory.And read in new from hard disk
Data can consume the regular hour, can bring visual " delay " phenomenon.In order to solve this key issue, set up AM/BAM
Two data buffer zones, and realize the exchange of data content between two relief areas by multithreading.Front buffer is straight
Connecing and serve displaying of graph and image, back buffer district, then corresponding to hard disk operation, uses multithreading to solve data buffer zone
Data replacement problem, by judging that currently displaying region carries out the real-time update of dynamic data, thus realize multi-block data
The real-time any direction roaming of lower mass data.
(1) two data buffer zones of Foreground and Background are set up
Display buffer is used to directly provide the region of memory of data to Graphics Processing Unit (GPU), updates in data
Time, it is desirable to the data in display caching can be updated with the fastest speed, but be unfortunately stored to the number between internal memory from outward
Very slow according to transmitting for CPU speed, cause the bottleneck that whole system is run.Whenever having arrived the critical of data renewal
Point, scene shows that having to wait pending data to update complete draws again, if this process is the longest, will result in picture and stagnates.
Present invention employs the strategy of space for time, the most additionally open up one piece of internal memory (back-end data relief area), be used for
The data that storage pre-reads, display caching (Foreground Data relief area) obtains data from data buffer storage (back-end data relief area),
Without coming into contacts with slow external memory again.By data buffer storage (back-end data relief area) and display caching (foreground
Data buffer zone) concept separately so that the mode of data scheduling is the most flexible, and program use multithreading can be facilitated to enter
Row scheduling, eliminates the impact of data swapping bottleneck to greatest extent.Data buffer storage (back-end data relief area) to shift to an earlier date
Preserve the data of four direction, carry out data renewal for display caching (Foreground Data relief area).
(2) data dispatch
In order to alleviate the real-time rendered and the slow contradiction of data reading speed, present invention employs the scheduling plan of dual-thread
Slightly, be each responsible for scene renders the scheduling with data, compared with single thread mode, alleviates this lance to a certain extent
Shield.
One thread is responsible for pre-read and the calculating of data, and another thread is responsible for the display of result, and two threads will
Access same outcome variable.If the most not carrying out Compliance control, then it is likely to be shown that incorrect result.This
Invention uses event object to maintain display thread (main thread) and the synchronization mechanism of data thread.
Geological data is in addition to magnanimity, and also an important feature is exactly can to access by road.Pre-read at multithreading
When fetching data, a data buffer storage bigger than what comes into a driver's district scope can be obtained according to road scope to be shown during roaming.
Step 2, employing bi-cubic interpolation algorithm realize scaling:
Image scaling is exactly the resolution changing image, i.e. according to pixel distribution and the characteristics of image of source images, and reconstruct
The pixel color value of target image under the resolution that makes new advances, so be sometimes otherwise known as image resampling, image interpolation etc..
In theory, the problem that image scaling is considered as a binary function reconstruct and resampling.
In order to obtain best zooming effect, the present invention uses bi-cubic interpolation algorithm to realize scaling.Bi-cubic interpolation
Lagrange polynomial, cubic spline function or cubic convolution algorithm can be passed through realize.Here simple easily realization is picked
Lagrange polynomial realize double legislation interpolation.Its mathematical principle is as follows:
If it is known that function f (x) and its derivative at x=0, x=1, then function can be between [0,1]
Interpolation, is referred to as meaning cube interpolation when function representation is cubic polynomial.One cubic polynomial and derivative thereof:
F (x)=ax3+bx2+cx+d (2)
F'(x)=3ax2+2bx+c (3)
Multinomial value and derivative value thereof at x=0, x=1 be:
F (0)=d;F (1)=a+b+c+d;F'(0)=c;F'(1)=3a+2b+c;
Four above-mentioned equatioies can be of equal value be transformed to:
A=2f (0)-2f (1)+f'(0)+f'(1);
B=-3f (0)+3f (1)-2f'(0)-f'(1);
C=f'(0);
D=f'(1);
Assume there are four point value p0,p1, p2, p3Respectively at x=-1, x=0, x=1, x=2, value is separately assigned to f
(0), f (1), f'(0), f'(1) in be:
F (0)=p1
F (1)=p2
F'(0)=(p2-p0)/2 (4)
F'(1)=(p3-p1)/2
This cube of formula for interpolation becomes:
f(p0,p1,p2,p3, x)=(-1/2p0+3/2p1-3/2p2+2p3)x3+(p0-5/2p1+2p2-1/2p3)x2
+(-1/2p0+1/2p2)x+p1
Bi-cubic interpolation is the expression at two-dimensional space of cube interpolation, it is assumed that amplification is K, is M × N by a width size
Target image on point (i', j') project and be originally inputted coordinate (i+u, j+v) (i=floor (i'/K), j=floor
(j'/K), when) image being carried out resampling, the pixel value f (i+u, j+v) of this point can be expressed as shape with matrix form
Formula:
F (i+u, j+v)=[A] [B] [C], wherein:
[A]=[0, v, v2,v3];
[C]=[0, u, u2,u3]T;
This formula meets S in the formula of the traditional interpolation talked about in background technology, i.e. formula (1)ijF (x-i, y-j) is f (i
+ u, j+v)=[A] [B] [C].
By 16 points of substitution to SijIn, solve 16 parameters therein i.e. [B], i.e. can get f (x-i, y-j) core letter
Number, also the value of whole target image point.
Bi-cubic interpolation is as the parallel computation on GPU of CUDA kernel function.
GPU parallel computation under step 3, CUDA framework:
Under CUDA framework, a GPU coprocessor as CPU supporting CUDA, it is adaptable to SIMD can be decomposed into
The algorithm of parallel schema, including sharing memorizer on static memory, sheet and by a series of stream processing unit (streaming
Processor) Steaming Multiprocessors (streamming multiprocessors is called for short MP) integrated.Static storage
Device can be divided into read-only Texture memory (texture memory), read-write global storage (global memory) and only
Reading constant memorizer (Constant Memory), being stored in data therein can be by all of Steaming Multiprocessors access
Reason, but speed is slower.And the access speed of memorizer (shared memory) is shared in the read-write in each Steaming Multiprocessors
Comparatively fast, but he can only access by the processing unit in bound fixing Steaming Multiprocessors thereon.For programming mode, GPU
The all tasks performed all are completed by the thread (Threads) in the threading models (Block) that sequence of user is GPU distribution.
Each thread constitutes threading models in an array manner, and all of threading models forms individual final in an array manner
The grid (Grid) of parallel computation.Grid and the dimension size of threading models is specified upon a series of CUDA api functions,
Embedded variable in CUDA API will come to specify a call number for this each thread throwing the net in lattice accordingly.User passes through
Call number controls the thread reading and writing data to being stored on GPU or computing.And simultaneously, dividing according to threading models inside GPU
Joining the service condition of situation and memorizer so that Steaming Multiprocessors as much as possible works simultaneously, order completes in program
The parallel thread distributed.The parallel efficiency of MP resource is made by threading models size and the shared memorizer that is positioned on MP
About.When total number of threads of parallel processing required in a Grid is given, the size of each threading models must be with
Maximizing available calculation resources (within the same clock cycle, allow stream processing unit as much as possible participate in computing) is target,
Rationally given thread module and the size of shared memorizer, avoid the most as far as possible memory access conflict (i.e. when parallel computation,
The conflict that different threads accesses same address in certain internal memory simultaneously and causes).
Step 4, GPU speed up to bi-cubic interpolation:
Because although bi-cubic interpolation algorithm effect in several traditional interpolation algorithms that the present invention selects is best,
But also it is the slowest a kind of interpolation algorithm of speed.This algorithm obtains there is between each pixel value good independence,
Dependency is the most there is not, it is possible to the parallel computation utilizing GPU is special between its solution procedure and the pixel resource that utilized
Property be accelerated process.At Intel Pentium (Pentium) double-core E6600@3.06GHz, 4G internal memory, Nvidia GeForce
GTX 560 video card, 1G video memory and under CUDATookit v4.2 environment use CUDA technology realize this algorithm.Concrete steps
As follows:
(1) detection GPU performance parameter: for CUDA develops, the hardware index of GPU is extremely important.Special for hardware
The optimization of point can greatly improve the performance of program.Detecting system hardware is requisite for CUDA program, in order in journey
Sequence is selected GPU and initializes it, only in this way, could start later calculating.
(2) display window is initialized;
(3) intervalometer is created for measuring;
(4) image data after piecemeal is obtained;
(5) distribution CUDA array, image reproduction data is to array:
Source image data is copied to CUDA array, the most quickly calculates for GPU.CUDA platform is different from classics
GPGPU's it is important that its global storage and shared memorizer, and user can be easily as using host memory one
The use of sample they.Texture memory is most important memorizer in graphic process unit, to the calculation meeting Texture memory characteristic
Method, can have when realizing with Texture memory than by the higher efficiency of global storage.
Neighbouring tables of data is revealed bigger data bandwidth by texture cache especially.If the proximity data that algorithm is to two dimension
Access frequently, use Texture memory can obtain the lifting of performance.A certain block of pixels on image is exactly such data.Logical
Cross binded texture, one piece of texture can be linear memory can also be CUDA array.Because CUDA array be NVIDIA for
Texture pickup and optimize especially, compare and from linear memory, pick up texture so picking up texture from CUDA array have more
Benefit, such as CUDA array can be one-dimensional, two-dimentional or three-dimensional, and element therein can be scalar, or two dimension, four
The vector of dimension.But linear memory can only be one-dimensional etc..
Here it is the reason of why our CUDA array to be selected, CUDA array is selected to be possible not only to process bivector
May be provided for processing speed.
(6) arrange and bind CUDA parametric texture to CUDA array:
Specifying CUDA texture properties, binded texture is to CUDA array.Texture position on Texture memory is drawn by texture
With determining, and the position that texture primitive is on texture is determined by texture coordinate.Due to texture in actual applications general the most all with CUDA
Array is bound.It is the premise of texture binding array that texture is quoted, it must be action scope be the static overall variable of file, and not
Allow as the parameter passing to other functions.
The part attribute of texture reference is constant, is necessary for when compiling it is known that these attributes are in statement texture ginseng
Specify when examining.Texture is stated with reference in file scope, and form is the variable of texture type: texture < Type,
Dim,ReadMode>texRef;
Wherein:
The data type that Type is returned when obtaining texture by appointment, Type is only limitted to basic integer, single-precision floating point class
Type and the self-defining data type of cuda.Because process is color seismic profile, the present invention selects uchar4 type.
Dim is the dimension specifying texture reference, and its value is 1,2 or 3;Dim is an optional parameter, and default value is 1;Cause
Being color seismic profile for process, the present invention selects 2 dimensions.
ReadMode is cudaReadModeNormalizedFloat or cudaReadModeElementType;If
CudaReadModeNormalizedFloat, and Type is 16 or 8 integer type, then value will return as floating point type,
For all integer data, unsigned int will be mapped as [0.0,1.0], have symbol integer will be mapped as [-1.0,
1.0], such as, what value was 0xff will be read as 1 without 8 texel of symbol;If
CudaReadModeElementType, does not the most perform any conversion operation;ReadMode is an optional parameter, default value
For cudaReadModeElementType.Because the present invention to perform operation, so selecting
cudaReadModeNormalizedFloat。
In sum, the texture in this algorithm is claimed as:
texture<uchar4,2,cudaReadModeNormalizedFloat>rgbaTex;Specify CUDA texture
After attribute, next need distribute CUDA array, then by data from main frame transmit to CUDA array, then by Texture memory with
CUDA array is bound.At this moment, it is possible to call the kernel using Texture memory.
(7) pixel buffer object is created;
(8) registration video memory buffer object;
(9) display texture is created;
(10) interpolation renders.
Step 5, CUDA and openGL interoperability are accelerated to show:
Showing for convenience and quickly, this algorithm utilizes OpenGL to show result.The present invention be make use of CUDA and
OpenGL interoperability realizes display.The basic mode of CUDA and OpenGL interoperability is to use CUDA to generate data, then makes
On screen, the figure represented by data is drawn out with OpenGL.Both combinations can be realized by two ways:
I. the PBO (pixel buffer object) of OpenGL is used.In this mode, CUDA directly generates pixel data,
OpenGL shows these pixels;
Ii. the VBO (vertex buffer object) of OpenGL is used.In this mode, CUDA generates mesh of vertices data,
OpenGL can draw out smooth exterior view or line frame graph or a series of summit as required.
The core of both modes is all to utilize cudaGLMapBufferObject function by the Buffer mapping of OpenGL
On the memory headroom of CUDA, so, programmer just can to make full use of the program that the advantage of CUDA writes out performance high interior at this
Depositing and spatially generate data, these data need not transmit, and OpenGL can directly use.If not using CUDA, these numbers
Generation is calculated by CPU according to needs.On the one hand, the calculating speed of CPU is generally slow than GPU;On the other hand, these data need to pass
Deliver to use for OpenGL display on GPU.In consideration of it, when data volume is the biggest, CUDA and OpenGL is used in mixed way effect
Substantially.
Interoperability between CUDA and OpenGL of the present invention is the PBO object implementatio8 by OpenGL.At OpenGL
In firstly the need of create PBO object and transfer data to correspondence PBO in.The process of CUDA use PBO data is exactly in fact
Three parts: the control-> amendment data-> control is returned OpenGL obtaining data are drawn.
Claims (3)
1. the quick Zoom method of a two-dimension earthquake image based on GPU, it is characterised in that: comprise the steps:
Step one, the piecemeal of magnanimity earthquake cross-sectional data: set up two data buffer zones of Foreground and Background, wherein: front buffer is straight
Connecing and serve displaying of graph and image, back buffer district is then corresponding to hard disk operation, and realizes Foreground and Background two by multithreading
The exchange of data content between individual data buffer zone;
Step 2, use lagrange polynomial bi-cubic interpolation algorithm realize scaling, set known function f (x) with
And its derivative at x=0, x=1, there are four point value p0,p1, p2, p3Respectively at x=-1, x=0, x=1, x=2, value point
Be not assigned to f (0), f (1), f'(0), f'(1) in be f (0)=p1, f (1)=p2, f'(0) and=(p2-p0)/2, f'(1)=(p3-
p1)/2, obtain a cube formula for interpolation, are expressed as:
f(p0,p1,p2,p3, x)=(-1/2p0+3/2p1-3/2p2+2p3)x3+(p0-5/2p1+2p2-1/2p3)x2
+(-1/2p0+1/2p2)x+p1
Set amplification as K, be that the point (i', j') on the target image of M × N projects and is originally inputted coordinate by a width size
(i+u, j+v), wherein i=floor (i '/K), j=floor (j '/K), when image is carried out resampling, the pixel value of this point
F (i+u, j+v) can be expressed as form with matrix form:
F (i+u, j+v)=[A] [B] [C]
Wherein, [A]=[0, v, v2,v3],[C]=[0, u, u2,u3]T,
Substitute into 16 points in pixel computing formula, solve 16 parameters corresponding in [B], obtain f (x-i, y-j) kernel function,
The value of whole target image point;
GPU parallel computation under step 3, CUDA framework;
Step 4, GPU speed up to bi-cubic interpolation:
(1) detection GPU performance parameter;
(2) display window is initialized;
(3) intervalometer is created for measuring;
(4) image data after piecemeal is obtained;
(5) distribution CUDA array, image reproduction data is to array;
(6) arrange and bind CUDA parametric texture to CUDA array;
(7) pixel buffer object is created;
(8) registration video memory buffer object;
(9) display texture is created;
(10) interpolation renders;
Step 5, CUDA and OpenGL interoperability accelerate display: use CUDA to generate data, then use OpenGL on screen
Draw out the figure represented by data.
The quick Zoom method of two-dimension earthquake image based on GPU the most according to claim 1, it is characterised in that: CUDA
With the interoperability between OpenGL is the PBO object implementatio8 by OpenGL, first OpenGL creates PBO object handle
Data are sent in the PBO of correspondence, and CUDA uses PBO data.
The quick Zoom method of two-dimension earthquake image based on GPU the most according to claim 2, it is characterised in that: described
The flow process of CUDA use PBO data is:
(1) control of data is obtained;
(2) amendment data;
(3) control is returned OpenGL to draw.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210312729.3A CN102831577B (en) | 2012-08-29 | 2012-08-29 | The quick Zoom method of two-dimension earthquake image based on GPU |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210312729.3A CN102831577B (en) | 2012-08-29 | 2012-08-29 | The quick Zoom method of two-dimension earthquake image based on GPU |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102831577A CN102831577A (en) | 2012-12-19 |
CN102831577B true CN102831577B (en) | 2016-08-24 |
Family
ID=47334695
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210312729.3A Expired - Fee Related CN102831577B (en) | 2012-08-29 | 2012-08-29 | The quick Zoom method of two-dimension earthquake image based on GPU |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102831577B (en) |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103439743B (en) * | 2013-08-30 | 2017-04-19 | 电子科技大学 | Method for drawing seismic data profile graph |
CN103714511B (en) * | 2013-12-17 | 2017-01-18 | 华为技术有限公司 | GPU-based branch processing method and device |
CN103871032A (en) * | 2014-03-07 | 2014-06-18 | 福建工程学院 | Image enhancement method for Wallis filter based on GPU (Graphics Processing Unit) |
CN104182571B (en) * | 2014-08-12 | 2018-05-04 | 电子科技大学 | Kriging interpolation methods based on Delaunay and GPU |
CN104252713B (en) * | 2014-09-04 | 2017-07-07 | 百度在线网络技术(北京)有限公司 | A kind of map rendering intent and device |
CN104407384B (en) * | 2014-12-08 | 2017-01-25 | 中国石油天然气集团公司 | Seismic section display method |
CN109426500B (en) * | 2017-06-21 | 2022-03-08 | 中国石油化工股份有限公司 | Method and system for drawing decimal sampling point based on SU software package |
CN107729105B (en) * | 2017-09-29 | 2021-02-26 | 中国石油化工股份有限公司 | Web-based seismic base map and profile linkage method |
CN107728201B (en) * | 2017-09-29 | 2019-07-12 | 中国石油化工股份有限公司 | A kind of two-dimension earthquake profile drawing method based on Web |
CN108170350A (en) * | 2017-12-28 | 2018-06-15 | 努比亚技术有限公司 | Realize method, terminal and the computer readable storage medium of Digital Zoom |
CN108492257A (en) * | 2018-05-10 | 2018-09-04 | 天津大学 | The OpenCL accelerated methods of bilinear interpolation demosaicing algorithms based on heterogeneous platform |
CN110568494B (en) * | 2019-09-12 | 2020-06-26 | 电子科技大学 | Pre-stack non-Gaussian AVO inversion method based on generalized extremum distribution |
CN110599580A (en) * | 2019-09-20 | 2019-12-20 | 西南石油大学 | Multi-seismic mathematical data rapid cross display based on Hilbert space filling curve index |
CN114845091B (en) * | 2021-02-01 | 2023-11-10 | 扬智科技股份有限公司 | Projection device and trapezoid correction method thereof |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101604453A (en) * | 2009-07-08 | 2009-12-16 | 西安电子科技大学 | Large-scale data field volume rendering method based on partition strategy |
CN101807291A (en) * | 2010-04-27 | 2010-08-18 | 浙江大学 | Biquadratic B-spline local interpolation-based image scaling method |
CN102622723A (en) * | 2011-05-25 | 2012-08-01 | 上海大学 | Image interpolation based on CUDA (compute unified device architecture) and edge detection |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8776030B2 (en) * | 2008-04-09 | 2014-07-08 | Nvidia Corporation | Partitioning CUDA code for execution by a general purpose processor |
-
2012
- 2012-08-29 CN CN201210312729.3A patent/CN102831577B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101604453A (en) * | 2009-07-08 | 2009-12-16 | 西安电子科技大学 | Large-scale data field volume rendering method based on partition strategy |
CN101807291A (en) * | 2010-04-27 | 2010-08-18 | 浙江大学 | Biquadratic B-spline local interpolation-based image scaling method |
CN102622723A (en) * | 2011-05-25 | 2012-08-01 | 上海大学 | Image interpolation based on CUDA (compute unified device architecture) and edge detection |
Non-Patent Citations (1)
Title |
---|
基于CUDA的双三次B样条缩放方法;桂叶晨 等;《计算机工程与应用》;20091231;参见正文第1-3部分 * |
Also Published As
Publication number | Publication date |
---|---|
CN102831577A (en) | 2012-12-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102831577B (en) | The quick Zoom method of two-dimension earthquake image based on GPU | |
Kruger et al. | A particle system for interactive visualization of 3D flows | |
Kaufman et al. | Overview of volume rendering. | |
Buatois et al. | Concurrent number cruncher: a GPU implementation of a general sparse linear solver | |
US6819332B2 (en) | Antialias mask generation | |
CN109978751A (en) | More GPU frame renderings | |
US10354432B2 (en) | Texture space shading and reconstruction for ray tracing | |
US6556200B1 (en) | Temporal and spatial coherent ray tracing for rendering scenes with sampled and geometry data | |
US6466227B1 (en) | Programmable architecture for visualizing sampled and geometry data | |
CN109478310A (en) | Postpone coloring using the multiresolution of texel tinter in a computing environment | |
US20130271465A1 (en) | Sort-Based Tiled Deferred Shading Architecture for Decoupled Sampling | |
CN110458905A (en) | Device and method for the adaptive tessellation of level | |
CN103439743B (en) | Method for drawing seismic data profile graph | |
CN108335349A (en) | Utilize NN filtering image data | |
Doggett | Texture caches | |
CN102915563A (en) | Method and system for transparently drawing three-dimensional grid model | |
Sarton et al. | Interactive visualization and on-demand processing of large volume data: a fully GPU-based out-of-core approach | |
Johnson et al. | The irregular z-buffer and its application to shadow mapping | |
Falk et al. | Interactive gpu-based visualization of large dynamic particle data | |
Rossant et al. | High-performance interactive scientific visualization with datoviz via the vulkan low-level gpu api | |
CN109844802A (en) | For improving the mechanism of thread parallelism in graphics processor | |
Kaufman et al. | A survey of architectures for volume rendering | |
CN108875275B (en) | Vector field real-time simulation method and system based on large-scale streamline | |
Patidar et al. | Exploiting the shader model 4.0 architecture | |
Neophytou et al. | GPU-Accelerated Volume Splatting With Elliptical RBFs. |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160824 Termination date: 20190829 |