CN107146193A - A kind of GPU parallel calculating methods based on double video cards applied to image procossing - Google Patents

A kind of GPU parallel calculating methods based on double video cards applied to image procossing Download PDF

Info

Publication number
CN107146193A
CN107146193A CN201710296867.XA CN201710296867A CN107146193A CN 107146193 A CN107146193 A CN 107146193A CN 201710296867 A CN201710296867 A CN 201710296867A CN 107146193 A CN107146193 A CN 107146193A
Authority
CN
China
Prior art keywords
data block
video data
video
gpu
overlapping region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710296867.XA
Other languages
Chinese (zh)
Inventor
王晓芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cabin (Shenzhen) Medical Technology Co., Ltd.
Original Assignee
NANJING MIZONG ELECTRONIC TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NANJING MIZONG ELECTRONIC TECHNOLOGY Co Ltd filed Critical NANJING MIZONG ELECTRONIC TECHNOLOGY Co Ltd
Priority to CN201710296867.XA priority Critical patent/CN107146193A/en
Publication of CN107146193A publication Critical patent/CN107146193A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

A kind of GPU parallel calculating methods based on double video cards applied to image procossing, including:The GPU resource of the double video cards of initialization;Image memory is divided into video data block one and video data block two, video data block one and video data block two are continuous in physical space, the overlapping region size of setting video data block one and video data block two;Create and start two threads, the corresponding GPU resource of two video cards is called respectively, perform image processing program, obtain video data block one and the respective result of video data block two;The data of overlapping region are abandoned, merge video data block.The present invention improves the computational efficiency of image procossing, for current main flow 4k image frames, the GPU concurrent mechanisms of double video cards can greatly improve the real-time of image procossing, it is less than common class effect in cost simultaneously, real-time processing meaning for high-definition picture is very big, it is ensured that the pixel of new adjacent edges calculates consistent with artwork.

Description

A kind of GPU parallel calculating methods based on double video cards applied to image procossing
Technical field
The present invention relates to a kind of image processing method, especially a kind of GPU based on double video cards applied to image procossing Parallel calculating method.
Background technology
Modern GPU provides two programmable parallel processing components of vertex processor and fragment processor.Held using GPU During the general computational tasks such as row image procossing, the groundwork to be done is the figure that duty mapping to be solved to GPU is supported On rendering pipeline.Usual way be attributes such as position, color, the normal vectors on input data summit of calculating task or The graphic plotting such as person's texture key element is expressed, and corresponding Processing Algorithm is then broken down into a series of execution step, and is rewritten For GPU summit processing routine or fragment processing routine, and fragment programs are called to be handled;Finally, it is stored in frame buffer Drawing result be exactly algorithm output data.
Applications of the GPU to image procossing is very universal, but it is synchronous to single image not coordinate multiple video cards The application handled, is handled in real time especially for high-resolution medical image, and the treatment effeciency of single video card can not expire sometimes The real-time of sufficient image.
The content of the invention
It is an object of the invention to provide a kind of method for the real-time and treatment effeciency for improving image procossing.
To achieve these goals, the technical scheme is that:
A kind of GPU parallel calculating methods based on double video cards applied to image procossing, it comprises the following steps:
Step one:The GPU resource of the double video cards of initialization;
Step 2:Image memory is divided into video data block one and video data block two, video data block one and image Data block two is continuous in physical space, the overlapping region size of setting video data block one and video data block two;
Step 3:Create and start two threads, the corresponding GPU resource of two video cards is called respectively, perform image procossing Program, obtains video data block one and the respective result of video data block two;
Step 4:The data of overlapping region are abandoned, merge the result of video data block one and video data block two, it is complete Concurrent processing of the GPU of video card in pairs to an image.
Further, step one is specially:
Step 101:Library file needed for GPU operations is installed;
Step 102:Video card equipment is initialized, the video card that GPU resource can be called is found in platform;
Step 103:Video card facility information is initialized, the required program object of GPU operations is set up;
Step 104:Compile GPU concurrent program modules.
Further, in step 2, image memory dividing mode is:Horizontal segmentation, longitudinally split or oblique segmentation;Level During segmentation:
Step 201:By image memory using horizontal division line even partition as two pieces;
Step 202:Equal-sized overlapping region one and overlapping region are built respectively along horizontal division line to both sides up and down Two, the data of overlapping region one and overlapping region two are consistent with the data of bottom layer image internal memory, build video data block one, including Part and overlapping region two above horizontal division line, build video data block two, including part below horizontal division line and Overlapping region one;
Step 203:Neighborhood calculating is carried out to video data block one and video data block two, neighbour is carried out to video data block one When domain is calculated, the offer data of overlapping region two, when carrying out neighborhood calculating to video data block two, the offer number of overlapping region one According to.
Further, when longitudinally split in described step two:First by 90 ° of image transposition, according still further to horizontal segmentation processing.
Further, the overlapping region size described in step 202 is the size that is calculated according to neighborhood to determine, overlapping The size in region is twice of neighborhood computed altitude.
Further, step 3 is specially:
Step 301:Create and start two threads, the corresponding GPU resource of two video cards is called respectively.
Step 302:Image processing program is performed in two threads, each thread corresponds to a video data block respectively, Two threads are synchronously waited to complete corresponding processing using thread control interface, two video card run times of record are figure compared with elder The time handled as internal memory.
Further, step 4 is specially:
Step 401:Video data block one abandons the data of overlapping region two, and video data block two abandons overlapping region one Data;
Step 402:Merge the result of video data block one and video data block two;
Step 403:GPU resource is discharged, result is exported.
Beneficial effects of the present invention:
The present invention improves the computational efficiency of image procossing, and whole efficiency can lift 70%~80%, for current Main flow 4k image frames, the GPU concurrent mechanisms of double video cards can greatly improve the real-time of image procossing, while being less than in cost DSP or the FPGA hardware design of common class effect, the real-time processing and realistic meaning for high-definition picture are very big, lead to simultaneously Cross setting overlapping region, it is ensured that the pixel of new adjacent edges calculates consistent with artwork.
Brief description of the drawings
By the way that exemplary embodiment of the invention is described in more detail with reference to accompanying drawing, it is of the invention above-mentioned and its Its purpose, feature and advantage will be apparent, wherein, in exemplary embodiment of the invention, identical reference number Typically represent same parts.
Fig. 1 is image memory horizontal segmentation figure.
Fig. 2 is the longitudinally split figure of image memory.
Fig. 3 is overlapping region schematic diagram.
Embodiment
The preferred embodiment of the present invention is more fully described below with reference to accompanying drawings.Although showing the present invention in accompanying drawing Preferred embodiment, however, it is to be appreciated that may be realized in various forms the present invention without the embodiment party that should be illustrated here Formula is limited.
As Figure 1-3, a kind of GPU parallel calculating methods based on double video cards applied to image procossing, it is characterized in that It comprises the following steps:
Step one:The GPU resource of the double video cards of initialization, it is ensured that the validity of equipment;Specially:GPU operations are installed required Library file;Video card equipment is initialized, the video card that GPU resource can be called is found in platform;Video card facility information is initialized, Set up the required program object of GPU operations;Compile GPU concurrent program modules.
Step 2:The overlapping region that image memory is divided between physically continuous two pieces, two pieces of internal memories of setting is big Small, overlapping region size is the size that is calculated according to neighborhood to determine, the size of overlapping region is the two of neighborhood computed altitude Times;It is specific as shown in figure 3, two image memory blocks are 1, shadow region, shadow region above section respectively, below shadow region And with shadow region area identical part;2nd, part below shadow region and shadow region, up and down two pieces of calculating consider be It is different:The calculating of top half need not enter shadow region below and with shadow region area identical part, shade The neighborhood for being only to provide data below region and with shadow region area identical part to be accomplished to medium line is calculated;Lower half The calculating divided does not enter shadow region, and the neighborhood that shadow region is only to provide data to complete medium line is calculated.
Step 3:Create and start two threads, the corresponding GPU resource of two video cards is called respectively, perform image procossing Program, synchronously wait two threads to complete corresponding processing using thread control interface, two video card run times of record are longer Person is the time that image memory is handled, and obtains video data block one and the respective result of video data block two;
Step 4:The data of overlapping region are abandoned, merge the result of video data block one and video data block two, it is complete Concurrent processing of the GPU of video card in pairs to an image.Specially:Video data block one abandons the data of overlapping region two, figure As data block two abandons the data of overlapping region one;Merge the result of video data block one and video data block two;Release GPU resource, exports result.
Consider the concurrent mechanism of more video cards, the treatment mechanism with double video cards is basically identical, general PC frameworks are difficult to adopt The deployment of more than two video card.So we are used as the primary structure of many GPU concurrent processing using double video cards.
It is described above various embodiments of the present invention, described above is exemplary, and non-exclusive, and It is not limited to disclosed each embodiment.In the case of without departing from the scope and spirit of illustrated each embodiment, for this skill Many modifications and changes will be apparent from for the those of ordinary skill in art field.

Claims (8)

1. a kind of GPU parallel calculating methods based on double video cards applied to image procossing, it is characterized in that it comprises the following steps:
Step one:The GPU resource of the double video cards of initialization;
Step 2:Image memory is divided into video data block one and video data block two, video data block one and view data Block two is continuous in physical space, the overlapping region size of setting video data block one and video data block two;
Step 3:Create and start two threads, the corresponding GPU resource of two video cards is called respectively, perform image processing program, Obtain video data block one and the respective result of video data block two;
Step 4:The data of overlapping region are abandoned, merge the result of video data block one and video data block two, complete double Concurrent processing of the GPU of video card to an image.
2. a kind of GPU parallel calculating methods based on double video cards applied to image procossing according to claim 1, it is special Levy is that step one is specially:
Step 101:Library file needed for GPU operations is installed;
Step 102:Video card equipment is initialized, the video card that GPU resource can be called is found in platform;
Step 103:Video card facility information is initialized, the required program object of GPU operations is set up;
Step 104:Compile GPU concurrent program modules.
3. a kind of GPU parallel calculating methods based on double video cards applied to image procossing according to claim 1, it is special Levy in being described step two, image memory dividing mode is:Horizontal segmentation, longitudinally split or oblique segmentation.
4. a kind of GPU parallel calculating methods based on double video cards applied to image procossing according to claim 3, it is special Levy when being horizontal segmentation in described step two:
Step 201:By image memory using horizontal division line even partition as two pieces;
Step 202:Equal-sized overlapping region one and overlapping region two are built respectively along horizontal division line to both sides up and down, weight The data in folded region one and overlapping region two are consistent with the data of bottom layer image internal memory, build video data block one, including level Part and overlapping region two above cut-off rule, build video data block two, including part below horizontal division line and overlapping Region one;
Step 203:Neighborhood calculating is carried out to video data block one and video data block two, neighborhood meter is carried out to video data block one During calculation, the offer data of overlapping region two, when carrying out neighborhood calculating to video data block two, the offer data of overlapping region one.
5. a kind of GPU parallel calculating methods based on double video cards applied to image procossing according to claim 4, it is special Levy when being longitudinally split in described step two:Level point is carried out first by 90 ° of image transposition, the step of according still further to claim 4 Cut processing.
6. a kind of GPU parallel calculating methods based on double video cards applied to image procossing according to claim 4, it is special It is that overlapping region size described in step 202 is the size that is calculated according to neighborhood to determine to levy, and the size of overlapping region is Twice of neighborhood computed altitude.
7. a kind of GPU parallel calculating methods based on double video cards applied to image procossing according to claim 1, it is special Levy is that step 3 is specially:
Step 301:Create and start two threads, the corresponding GPU resource of two video cards is called respectively.
Step 302:Image processing program is performed in two threads, each thread corresponds to a video data block, used respectively Thread control interface synchronously waits two threads to complete corresponding processing, and two video card run times of record are in image compared with elder Deposit the time of processing.
8. a kind of GPU parallel calculating methods based on double video cards applied to image procossing according to claim 1, it is special Levy is that step 4 is specially:
Step 401:Video data block one abandons the data of overlapping region two, and video data block two abandons the number of overlapping region one According to;
Step 402:Merge the result of video data block one and video data block two;
Step 403:GPU resource is discharged, result is exported.
CN201710296867.XA 2017-04-28 2017-04-28 A kind of GPU parallel calculating methods based on double video cards applied to image procossing Pending CN107146193A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710296867.XA CN107146193A (en) 2017-04-28 2017-04-28 A kind of GPU parallel calculating methods based on double video cards applied to image procossing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710296867.XA CN107146193A (en) 2017-04-28 2017-04-28 A kind of GPU parallel calculating methods based on double video cards applied to image procossing

Publications (1)

Publication Number Publication Date
CN107146193A true CN107146193A (en) 2017-09-08

Family

ID=59775044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710296867.XA Pending CN107146193A (en) 2017-04-28 2017-04-28 A kind of GPU parallel calculating methods based on double video cards applied to image procossing

Country Status (1)

Country Link
CN (1) CN107146193A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111429413A (en) * 2020-03-18 2020-07-17 中国建设银行股份有限公司 Image segmentation method and device and computer readable storage medium
CN111984417A (en) * 2020-08-26 2020-11-24 展讯通信(天津)有限公司 Image processing method and device for mobile terminal, storage medium and terminal
CN118071736A (en) * 2024-04-17 2024-05-24 华伦医疗用品(深圳)有限公司 GPU-based medical endoscope image real-time processing effect evaluation method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510448A (en) * 2011-10-13 2012-06-20 苏州百滨电子科技有限公司 Multiprocessor-embedded image acquisition and processing method and device
CN106233719A (en) * 2014-04-24 2016-12-14 索尼公司 Image processing equipment and method and surgical system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510448A (en) * 2011-10-13 2012-06-20 苏州百滨电子科技有限公司 Multiprocessor-embedded image acquisition and processing method and device
CN106233719A (en) * 2014-04-24 2016-12-14 索尼公司 Image processing equipment and method and surgical system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
曹海燕: "数学形态学与变换域图像去噪算法及其并行化研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111429413A (en) * 2020-03-18 2020-07-17 中国建设银行股份有限公司 Image segmentation method and device and computer readable storage medium
CN111984417A (en) * 2020-08-26 2020-11-24 展讯通信(天津)有限公司 Image processing method and device for mobile terminal, storage medium and terminal
WO2022042587A1 (en) * 2020-08-26 2022-03-03 展讯通信(天津)有限公司 Image processing method and apparatus for mobile terminal, and storage medium and terminal
CN118071736A (en) * 2024-04-17 2024-05-24 华伦医疗用品(深圳)有限公司 GPU-based medical endoscope image real-time processing effect evaluation method
CN118071736B (en) * 2024-04-17 2024-06-28 华伦医疗用品(深圳)有限公司 GPU-based medical endoscope image real-time processing effect evaluation method

Similar Documents

Publication Publication Date Title
US20200372609A1 (en) Super-resolution video reconstruction method, device, apparatus and computer-readable storage medium
TWI616846B (en) A graphics subsystem, a computer-implemented method and a computing device for enhanced anti-aliasing by varying sample patterns spatially and/or temporally
WO2022042436A1 (en) Image rendering method and apparatus, and electronic device and storage medium
CN105912234B (en) The exchange method and device of virtual scene
US10186068B2 (en) Method, apparatus and system for rendering an image
EP3161793B1 (en) Adaptive partition mechanism with arbitrary tile shape for tile based rendering gpu architecture
US9519982B2 (en) Rasterisation in graphics processing systems
GB2521260A (en) Method of and apparatus for processing graphics
KR102278021B1 (en) Program code transformation to improve image processor runtime efficiency
US11089320B2 (en) Adaptive pixel sampling order for temporally dense rendering
US10134171B2 (en) Graphics processing systems
CN106095437A (en) The implementation method of the layout type of user interface RTL from right to left and device
CN107146193A (en) A kind of GPU parallel calculating methods based on double video cards applied to image procossing
CN115147579B (en) Block rendering mode graphic processing method and system for expanding block boundary
CN115330986B (en) Method and system for processing graphics in block rendering mode
US11120609B2 (en) Reconstruction for temporally dense ray trace rendering
TWI601096B (en) Method and apparatus for direct and interactive ray tracing of a subdivision surface
CN117501312A (en) Method and device for graphic rendering
US8681154B1 (en) Adaptive rendering of indistinct objects
CN103116897A (en) Three-dimensional dynamic data compression and smoothing method based on image space
Ma et al. Efficient antialiased edit propagation for images and videos
US20170140569A1 (en) System and method for optimized sparse volume rendering
CN103593822B (en) The method and apparatus that frosted special effect processing is carried out to data image
KR101695900B1 (en) Method and apparatus for generating of super resolution image
US10832465B2 (en) Use of workgroups in pixel shader

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Zhang Shiping

Inventor after: Wang Xiaofang

Inventor before: Wang Xiaofang

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20181029

Address after: 518000 B1 701-72, Kexing Science Park, 15 Keyuan Road, Nanshan District, Shenzhen, Guangdong.

Applicant after: Cabin (Shenzhen) Medical Technology Co., Ltd.

Address before: 210000 Room 403, 3 tower 141, Ma Tai Street, Nanjing, Jiangsu.

Applicant before: Nanjing Mizong Electronic Technology Co., Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170908