CN106469440B - Dark defogging parallel optimization method based on OpenCL - Google Patents

Dark defogging parallel optimization method based on OpenCL Download PDF

Info

Publication number
CN106469440B
CN106469440B CN201610808183.9A CN201610808183A CN106469440B CN 106469440 B CN106469440 B CN 106469440B CN 201610808183 A CN201610808183 A CN 201610808183A CN 106469440 B CN106469440 B CN 106469440B
Authority
CN
China
Prior art keywords
image
gray
transmittance
dark
defogging
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.)
Active
Application number
CN201610808183.9A
Other languages
Chinese (zh)
Other versions
CN106469440A (en
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.)
Xidian University
Original Assignee
Xidian University
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 Xidian University filed Critical Xidian University
Priority to CN201610808183.9A priority Critical patent/CN106469440B/en
Publication of CN106469440A publication Critical patent/CN106469440A/en
Application granted granted Critical
Publication of CN106469440B publication Critical patent/CN106469440B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • 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 Processing (AREA)

Abstract

The dark defogging parallel optimization method based on OpenCL that the invention discloses a kind of it is limited mainly to solve the applicable platform of the prior art, it is difficult to the defect that high-definition picture is handled in real time, implementation step are as follows: the initialization of 1. equipment;2. will have a frame image copy of mist video into equipment;3. calculating the grayscale image and triple channel minimum value figure of foggy image, and calculate dark channel diagram;4. calculating atmosphere light according to dark channel diagram;5. estimating transmittance figure according to dark channel diagram and atmosphere optical oomputing;Fine transmittance figure is obtained 6. pair estimating transmittance figure and carrying out Steerable filter;7. according to atmosphere light, foggy image and fine transmittance figure carry out defogging processing, and by the image copy after defogging to host memory.The present invention is suitable for a variety of parallel computing platforms, improves the processing speed of dark defogging, can be used for for subsequent video monitoring, and image recognition provides clearly image source.

Description

Dark defogging parallel optimization method based on OpenCL
Technical field
The invention belongs to technical field of image processing, are further a kind of defogging parallel optimization methods, can be used for rear Continuous real-time video monitoring, image recognition provide clearly image source.
Background technique
Under the conditions of haze weather, outdoor images acquisition equipment is affected by it, and acquired image will appear fuzzy, contrast Decline, the degradation phenomenas such as hue shift have not only seriously affected the normal work of vision detection system, also give later period intelligent recognition Huge challenge is brought Deng application.
The dark channel prior defogging method that He Kaiming et al. is proposed, has obtained academia in terms of single-frame images defog effect Approval since to calculate the time longer for this method, pass through simple CPU serial arithmetic, it is difficult to full however in terms of processing speed Requirement of the sufficient video monitoring scene to real-time.
Be conducive to segmentation based on image data, can a large amount of parallel feature, many solutions of the Heterogeneous Computing based on CPU+GPU Certainly scheme is come into being." the dark primary priori defogging algorithm based on CUDA is simultaneously in paper by Xue Yungang of the National University of Defense technology et al. Row realize and optimization " in propose a kind of Parallel Implementation method based on CUDA Computational frame, to 640 × 480 image have 25 frames/ The processing speed of second;Sichuan Chuandazhisheng Software Co., Ltd, a kind of patent application " figure based on CUDA of Sichuan University As real-time defogging method " (publication number: CN103049890A, application number: CN201310017014.X, the applying date: in January, 2013 17 days) in disclose a kind of method of real-time defogging of the image based on CUDA, 32 frames/second can achieve to 600 × 400 image Processing speed.These methods have the disadvantage that
Firstly, existing Heterogeneous Computing solution reaches the processing speed of the 25 frames/more than second to low resolution, with In recent years monitoring device gradually to 1920 × 1080 high-resolution transition, this unappeasable HD video of processing speed Real-time processing requirement;
Secondly, be only capable of on the GPU for operating in the production of NVIDIA company based on the program that CUDA Computational frame is write, it is removable Plant property is lower.
Summary of the invention
It is an object of the invention to overcome the shortcomings of prior art, propose that a kind of dark defogging based on OpenCL is parallel Optimization method, to improve the defogging speed of video and realize the compatibility of platform.
To achieve the goals above, the present invention includes:
(1) platform for supporting open computational language OpenCL is selected, which is initialized, and therefrom chooses and can transport The equipment E of row kernel function, the equipment include CPU, GPU, intel MIC accelerator card;
(2) there is a frame image I of mist video from the global memory that host memory copies equipment E to RGB color;
(3) gray value of each location of pixels of RGB color foggy image I is calculated by way of parallel processing, generates gray scale Scheme Igray, each location of pixels RGB triple channel minimum value is calculated by way of parallel processing, generates minimum value figure Imin
(4) to minimum value figure IminMini-value filtering is carried out, dark channel diagram I is obtaineddark
(5) according to dark channel diagram IdarkCalculate atmosphere light A:
(5a) calculates dark channel diagram IdarkHistogram h;
(5b) acquires the corresponding gray value lower bound l of maximum 0.1% pixel of gray value according to histogram h;
(5c) is threshold value to dark channel image I using ldarkIt carries out binaryzation and obtains bianry image I';
The RGB triple channel figure I of (5d) to foggy image Ir、Ig、IbDot product bianry image I' respectively obtains RGB triple channel ash Spend image Ir'、Ig'、Ib';
(5e) calculates separately RGB triple channel gray level image Ir'、Ig'、Ib' histogram hr、hg、hb
(5f) passes through RGB three channel histogram hr、hg、hb, calculate atmosphere light A={ Ar,Ag,Ab,
Wherein,C ∈ { r, g, b }, i are the gray value in 0~255 variation, Ar、Ag、AbIt is respectively red Color, green, the air light value of blue triple channel;
(6) according to the RGB triple channel figure I of atmosphere light A and foggy image Ir、Ig、Ib, calculate and estimate transmittance figure t;
(7) according to the grayscale image I of foggy imagegrayWith estimate transmittance figure t, obtain fine transmittance figure t:
(7a) is gone to transmittance figure t is estimated to mean filter, and row mean filter result figure t is obtainedr;Again to row mean value Filter result figure trIt is arranged to mean filter, obtains smooth transmissive rate figure mt
The grayscale image I of (7b) to foggy imagegrayMean filter is carried out, smooth guide figure m is obtainedI
(7c) is according to smooth transmissive rate figure mt, smooth guide figure mI, estimate the grayscale image of transmittance figure t and foggy image Igray, obtain smooth scaled matrix ma, smoothed offset matrix mb
(7d) is according to smooth scaled matrix ma, smoothed offset matrix mbWith the grayscale image I of foggy imagegray, obtain fine saturating Penetrate rate figure
(8) according to RGB triple channel foggy image I, fine transmittance figureWith atmosphere light A, defogging result figure J is calculated;
(9) RGB triple channel defogging result figure J is read back host memory from equipment E;
The present invention compared with prior art, has the advantages that
First, it, can be with based on the program that OpenCL language is write due to present invention uses open computational language OpenCL It is run in the MIC platform of INTEL, the CPU of AMD, NVIDIA, the GPU of AMD, INTEL, on the other hand, other solutions are adopted The CUDA computational language used is only capable of running on NVDIA video card as the exclusive Computational frame of NVIDIA, therefore, the present invention program With better platform compatibility.
Second, since present invention introduces histograms to solve atmosphere light, calculated with the former dark defogging for choosing single pixel Method is compared, and gained air light value numerically has stability.
Third, since the present invention has used local memory in mean filter, the type memory has very high access speed It spends, the use in the present invention to local memory, ensure that the read-write operation to global memory to merge access, improves reading and writes Enter efficiency, saves the processing time.
4th, it is calculated since the present invention uses first piecemeal in mean filter, the method for remerging piecemeal processing result, Degree of parallelism is improved, the processing time is saved.
5th, since the present invention uses advanced every trade to filtering in mean filter, then arranged the ranks to filtering Isolated processing method avoids the redundant access to same pixel, improves processing speed.
Detailed description of the invention
Fig. 1 is implementation flow chart of the invention.
Fig. 2 is the frame image that the RGB color that the present invention uses has mist video.
Fig. 3 is defogging result figure of the invention.
Specific embodiment
Referring to the drawings, the specific embodiment of the invention and effect are described further:
Referring to Fig.1, the present invention uses OpenCL Computational frame, can be in any a equipment for supporting OpenCL framework It realizes, its step are as follows:
Step 1, it initializes.
The platform for supporting open computational language OpenCL is selected, which is initialized, and therefrom chooses and can run The equipment E of kernel function, the equipment include CPU, GPU, intel MIC accelerator card.
Step 2, there is a frame image I of mist video from the global memory that host memory copies equipment E to RGB color.
Since video is considered as the image sequence of Time Continuous, the present invention is by having mist video successive frame to RGB color It carries out image defogging and realizes video defogging, the global memory that will there is mist video sequential frame image to copy equipment from host memory to In, to carry out image defogging.
Step 3, grayscale image and triple channel minimum value figure are calculated.
With single thread process single pixel point, different threads handle the mode of different coordinate position pixels, calculate RGB The gray value of colored each coordinate position of foggy image I forms grayscale image Igray
Wherein, grayscale image IgrayPixel value at coordinate x:
Igray(x)=0.299 × r+0.587 × g+0.114 × b, r, g, b be respectively red of the foggy image I at x, Green, blue pixel value;
With single thread process single pixel point, different threads handle the mode of different coordinate position pixels, calculate each Location of pixels RGB triple channel minimum value forms minimum value figure Imin
Wherein, minimum value figure IminPixel value at coordinate x: Imin(x)=min (r, g, b).
Step 4, to minimum value figure IminMini-value filtering is carried out, dark channel diagram I is obtaineddark
Calculate dark channel diagram IdarkPixel value I at coordinate xdark(x):
Form dark channel diagram Idark, wherein Ω (x) is the square neighborhood centered on coordinate x.
Step 5, atmosphere light is calculated.
(5a) calculates dark channel diagram IdarkHistogram h;
(5b) acquires the corresponding gray value lower bound l of maximum 0.1% pixel of gray value according to histogram h:
Calculate accumulative and value of the array s at coordinate o:Meet following formula by accumulative and array s lookup Gray value lower bound l:
S [l] >=0.001 × n
s[l+1]<0.001×n
Wherein, s [l], s [l+1] are respectively value of the s at coordinate l, l+1, and n is dark channel diagram IdarkPixel sum;
(5c) is threshold value to dark channel image I using ldarkBinaryzation is carried out, bianry image I' is obtained;
The RGB triple channel figure I of (5d) to foggy image Ir、Ig、IbDot product bianry image I' respectively obtains RGB triple channel ash Spend image Ir'、Ig'、Ib';
(5e) calculates separately RGB triple channel gray level image Ir'、Ig'、Ib' histogram hr、hg、hb
(5f) passes through RGB three channel histogram hr、hg、hb, calculate atmosphere light A={ Ar,Ag,Ab,
Wherein,C ∈ { r, g, b }, i are the gray value in 0~255 variation, Ar、Ag、AbIt is respectively red Color, green, the air light value of blue triple channel.
Step 6, it calculates and estimates transmittance figure.
(6a) is according to red, green, the air light value A of blue triple channelr、Ag、Ab, calculate and estimate transmittance figure t in coordinate Pixel value t (z) at z:
Wherein Ir(y)、Ig(y)、IbIt (y) is respectively RGB triple channel figure Ir、Ig、IbGray value at coordinate y, Ω (z) are Square neighborhood centered on coordinate z;
Pixel value t (z) at each coordinate is combined by (6b), and transmittance figure t is estimated in formation.
Step 7, to transmittance figure progress Steerable filter is estimated, fine transmittance figure is obtained.
(7a) is gone to transmittance figure t is estimated to mean filter, and row mean filter result figure t is obtainedr;Again to row mean value Filter result figure trIt is arranged to mean filter, obtains smooth transmissive rate figure mt:
H working group is arranged in (7a1), and each working group includes 256 threads, and each working group's alignment processing estimates transmission The data line of rate figure t, wherein H is the height for estimating transmittance figure t;
(7a2) uses whole threads of i-th of working group, and by way of merging memory access, reading estimates transmittance figure t's I-th row data, storage to local memory array g origin coordinates are l1In the contiguous memory space of=R+1, wherein R is filter Radius;
The border extension pixel assignment of (7a3) to local memory array g:
First to the l of array g1A left margin extends pixel assignment, obtains pixel value of the array g at coordinate j:
G [j]=g [2l1- 1-j], wherein 0≤j < l1
Again to the l of array g2A right margin extends pixel assignment, obtains array g in coordinate l1The pixel value at the place+W+k:
g[l1+ W+k]=g [l1+ W-1-k], in which: l2=(W+l1+R+M-1)/M×M-W-l1, W is to estimate transmittance figure t Width, M be filter width M=2 × R+1,0≤k < l2
(7a4) calculates block count: L=(W+R+l2)/M;
(7a5) with L thread preceding in i-th of working group, the prefix of the L piecemeal of parallel computation local memory array g and:
G [m]=g [m-1]+g [m], wherein g [m] is pixel value of the array g at coordinate m, to first of thread,
1+l × M≤m < 1+ (l+1) × M, l are thread number;
(7a6) calculates row mean filter result figure t with thread parallels all in i-th of working grouprIn the pixel of the i-th row Value, then merge to form row mean filter result figure t with each row resultr, wherein trPixel value at coordinate position (i, j) are as follows:
tr(i, j)=(g [j+l1+R]+g[(j+M-1)/M×M]-g[j])/M;
(7a7) is according to row mean filter result figure tr, with ith thread, calculate the i-th filter result for arranging the 0th row:
Wherein, tr(j, i) is trIn the pixel value of coordinate position (j, i);
(7a8) is according to row mean filter result figure tr, i-th arranges the 0th row filter result mt(0, i) is calculated with ith thread The H-1 row filter result m of i-th columnt(j, i):
mt(j, i)=mt(j-1, i)+q (j+R, i)-q (j-R, i),
Wherein,
1≤j < H, mt(j-1, i) is the i-th column, -1 row filter result of jth;
The filter result m that (7a9) arranges the 0th row for i-thtThe H-1 row filter result m of (0, i) and the i-th columnt(j, i) carries out group It closes, forms smooth transmissive rate figure mt
The grayscale image I of (7b) to foggy imagegrayMean filter is carried out, smooth guide figure m is obtainedI
(7c) is according to smooth transmissive rate figure mt, smooth guide figure mI, estimate the grayscale image of transmittance figure t and foggy image Igray, obtain smooth scaled matrix ma, smoothed offset matrix mb:
(7c1) is according to the grayscale image I of foggy imagegrayWith smooth guide figure mI, calculate guidance figure variance matrix varI:
varI=fmean(Igray.*Igray,R)-mI.*mI,
Wherein fmean(Igray.*Igray, R) and it indicates to IgrayWith IgrayThe result of dot product carries out mean filter, and R is filter Radius;
(7c2) is according to the grayscale image I for estimating transmittance figure, foggy imagegray, smooth guide figure mIWith smooth transmittance figure mt, calculate guidance figure and estimate the covariance matrix cov of transmittance figureIt:
covIt=fmean(t.*Igray,R)-mt.*mI,
Wherein, fmean(t.*Igray, R) and it indicates to IgrayMean filter is carried out with the result of t dot product, R is filter half Diameter .* are point multiplication operation symbol;
(7c3) is according to guidance figure variance matrix varI, guidance figure with estimate the covariance matrix cov of transmittance figureIt, it is smooth Guidance figure mIWith smooth transmittance figure mt, calculate scaled matrix a, excursion matrix b:
B=mI-a.*mt
(7c4) carries out mean filter to scaled matrix a, excursion matrix b respectively, obtains smooth scaled matrix ma, it is smooth partially Move matrix mb
(7d) is according to smooth scaled matrix ma, smoothed offset matrix mbWith the grayscale image I of foggy imagegray, obtain fine saturating Penetrate rate figure:
Step 8, defogging result figure is calculated.
(8a) calculates defogging result figure J pixel value J (z) at coordinate z:
Wherein,Respectively foggy image I, fine transmittance figurePixel value at coordinate z;
Pixel value J (z) at each coordinate is combined by (8b), forms defogging result figure J.
Step 9, it copies defogging result figure J to host memory, completes to the single frames defogging for having mist video.
The present invention realizes the video defogging of high speed by above step, can be subsequent video monitoring, image The application such as identification provides clearly image source.
Effect of the invention can be further illustrated by following experiment:
Experiment 1, platform compatibility test:
The mist video resolution that has of this experiment test is 640 × 480, is calculated in different platform to before test video 500 Frame carries out defogging, exports average frame per second=frame number/processing time (second) of video, as shown in Table 1:
Table one, different platform video defogging are averaged frame per second table
As can be seen from Table I, the present invention is suitable for different platform, and the average frame per second of defogging output video is above now There is solution.
Experiment 2, performance test
This experiment test equipment is AMD HD7750 video card, and choosing different resolution has a mist video, calculate to preceding 500 frame into Row defogging exports the average frame per second of video, as shown in Table 2:
Table two, AMD HD7750 video card are averaged frame per second table to different resolution video defogging
As can be seen from Table II, the present invention has the processing speed per second more than 40 frames for high-definition picture, realizes HD video is in real time handled.
Experiment 3, defog effect test
The mist video resolution that has of this experiment test is 640 × 480, and comparison has a frame image and the frame figure in mist video As the clarity of image after defogging.
The 320th frame image of mist video has been taken, as shown in Fig. 2, defogging processing is carried out to the foggy image with the method for the present invention, Image is as shown in Figure 3 after obtaining defogging.
2 Fig. 3 of comparison diagram shows that the present invention has good defog effect as it can be seen that image definition significantly improves after defogging.
To sum up, the present invention solves the defect of prior art, is suitable for a variety of parallel computing platforms, realizes high definition Video is handled in real time, can be subsequent video monitoring, and the application such as image recognition provides clearly image source.

Claims (6)

1. the dark defogging parallel optimization method based on OpenCL, comprising:
(1) platform for supporting open computational language OpenCL is selected, which is initialized, and in therefrom choosing and capable of running The equipment E of kernel function, the equipment include CPU, GPU, intel MIC accelerator card;
(2) there is a frame image I of mist video from the global memory that host memory copies equipment E to RGB color;
(3) gray value of each coordinate position of RGB color foggy image I is calculated by way of parallel processing, generates grayscale image Igray, each coordinate position RGB triple channel minimum value is calculated by way of parallel processing, generates minimum value figure Imin
(4) to minimum value figure IminMini-value filtering is carried out, dark channel diagram I is obtaineddark
(5) according to dark channel diagram IdarkCalculate atmosphere light A:
(5a) calculates dark channel diagram IdarkHistogram h;
(5b) acquires the corresponding gray value lower bound l of maximum 0.1% pixel of gray value according to histogram h;
(5c) is threshold value to dark channel image I using ldarkIt carries out binaryzation and obtains bianry image I';
The RGB triple channel figure I of (5d) to foggy image Ir、Ig、IbDot product bianry image I' respectively, obtains RGB triple channel grayscale image As Ir'、Ig'、Ib';
(5e) calculates separately RGB triple channel gray level image Ir'、Ig'、Ib' histogram hr、hg、hb
(5f) passes through RGB three channel histogram hr、hg、hb, calculate atmosphere light A={ Ar,Ag,Ab, whereinI is the gray value in 0~255 variation, Ar、Ag、AbIt is respectively red, green, blue The air light value of triple channel;
(6) according to the RGB triple channel figure I of atmosphere light A and foggy image Ir、Ig、Ib, calculate and estimate transmittance figure t;
(7) according to the grayscale image I of foggy imagegrayWith estimate transmittance figure t, obtain fine transmittance figure
(7a) is gone to transmittance figure t is estimated to mean filter, and row mean filter result figure t is obtainedr;Again to row mean filter Result figure trIt is arranged to mean filter, obtains smooth transmissive rate figure mt:
H working group is arranged in (7a1), and each working group includes 256 threads, and each working group's alignment processing estimates transmittance figure The data line of t, wherein H is the height for estimating transmittance figure t;
(7a2) uses whole threads of i-th of working group, and by way of merging memory access, reading estimates the i-th of transmittance figure t Row data, storage to local memory array g origin coordinates are l1In the contiguous memory space of=R+1, wherein R is filter half Diameter;
The border extension pixel assignment of (7a3) to local memory array g:
First to the l of array g1A left margin extends pixel assignment, obtains pixel value of the array g at coordinate j: g [j]=g [2l1- 1-j], wherein 0 <=j < l1
Again to the l of array g2A right margin extends pixel assignment, obtains array g in coordinate l1The pixel value at the place+W+k: g [l1+W+ K]=g [l1+ W-1-k], wherein l2=(W+l1+R+M-1)/M×M-W-l1, W is the width for estimating transmittance figure t, and M is filtering Device width M=2 × R+1,0 <=k < l2
(7a4) calculates block count: L=(W+R+l2)/M;
(7a5) calculates the prefix and g [m] of the L piecemeal of local memory array g with L thread parallel preceding in i-th of working group =g [m-1]+g [m], wherein g [m] is the prefix and array of one-row pixels, and each pair of point of the array final calculation result is answered Be pixel value at m, to first of thread, 1+l × M <=m < 1+ (l+1) × M, l are thread number;
(7a6) calculates row mean filter result figure t with thread parallels all in i-th of working grouprIn the pixel value of the i-th row, then use Each row result merges to form row mean filter result figure tr, wherein trPixel value at coordinate position (i, j) are as follows:
tr(i, j)=(g [j+l1+R]+g[(j+M-1)/M×M]-g[j])/M;
(7a7) is according to row mean filter result figure tr, with ith thread, calculate the i-th filter result m for arranging the 0th rowt(0, i):
Wherein, tr(j, i) is trIn the pixel value of coordinate position (j, i);
(7a8) is according to row mean filter result figure tr, i-th arranges the 0th row filter result mt(0, i) calculates i-th with ith thread The H-1 row filter result m of columnt(j, i):
mt(j, i)=mt(j-1,i)+q(j+R,i)-q(j-R,i)
Wherein,
1 <=j < H, mt(j-1, i) is the i-th column, -1 row filter result of jth;
The filter result m that (7a9) arranges the 0th row for i-tht(0, i) is placed on the H-1 row filter result m of the column of matrix i-thtBefore (j, i), Form smooth transmissive rate figure mt
The grayscale image I of (7b) to foggy imagegrayMean filter is carried out, smooth guide figure m is obtainedI
(7c) is according to smooth transmissive rate figure mt, smooth guide figure mI, estimate the grayscale image I of transmittance figure t and foggy imagegray, obtain To smooth scaled matrix ma, smoothed offset matrix mb
(7d) is according to smooth scaled matrix ma, smoothed offset matrix mbWith the grayscale image I of foggy imagegray, obtain fine transmissivity Figure
(8) according to RGB triple channel foggy image I, fine transmittance figureWith atmosphere light A, defogging result figure J is calculated;
(9) it copies defogging result figure J to host memory, completes to the single frames defogging for having mist video.
2. the dark defogging parallel optimization method according to claim 1 based on OpenCL, it is characterised in that: step (3) parallel processing manner refers to single thread process single pixel point, different threads alignment processing image difference coordinate position in Pixel.
3. the dark defogging parallel optimization method according to claim 1 based on OpenCL, it is characterised in that: step (6) according to the RGB triple channel figure I of atmosphere light A and foggy image I inr、Ig、Ib, calculate and estimate transmittance figure t, as follows It carries out:
Pixel value t (z) of the transmittance figure t at coordinate z is estimated in (6a) calculating:
Wherein Ir(y)、Ig(y)、IbIt (y) is respectively Ir、Ig、IbGray value at coordinate y, Ω (z) are centered on coordinate z Square neighborhood;
Pixel value t (z) at each coordinate is combined by (6b), and transmittance figure t is estimated in formation.
4. the dark defogging parallel optimization method according to claim 1 based on OpenCL, it is characterised in that: step Merging memory access in (7a2) refers to that, using the continuous thread of number in working group, the address accessed in global memory is continuous Region of memory.
5. the dark defogging parallel optimization method according to claim 1 based on OpenCL, it is characterised in that: step (7c) is carried out as follows:
(7c1) is according to the grayscale image I of foggy imagegray, smooth guide figure mI, calculate guidance figure variance matrix varI:
varI=fmean(Igray.*Igray,R)-mI.*mI,
Wherein fmean(Igray.*Igray, R) and it indicates to IgrayWith IgrayThe result of dot product carries out mean filter, and R is filter radius;
(7c2) basis estimates transmittance figure t, the grayscale image I of foggy imagegray, smooth guide figure mI, smooth transmissive rate figure mt, meter It calculates guidance figure and estimates the covariance matrix cov of transmittance figureIt:
covIt=fmean(t.*Igray,R)-mt.*mI
Wherein, fmean(t.*Igray, R) and it indicates to IgrayMean filter is carried out with the result of t dot product, R is filter radius, and .* is Point multiplication operation symbol;
(7c3) is according to guidance figure variance matrix varI, guidance figure and the covariance matrix cov for estimating transmittance figureIt, smooth guide Scheme mI, smooth transmissive rate figure mt, calculate scaled matrix a, excursion matrix b:
(7c4) carries out mean filter to scaled matrix a, excursion matrix b respectively, obtains smooth scaled matrix ma, smoothed offset matrix mb
6. the dark defogging parallel optimization method according to claim 1 based on OpenCL, it is characterised in that: step (8) according to RGB triple channel foggy image I, fine transmittance figure inWith atmosphere light A, defogging result figure J is calculated, as follows It carries out:
(8a) calculates defogging result figure J pixel value J (z) at coordinate z:
Wherein,Respectively foggy image I, fine transmittance figurePixel value at coordinate z;
Pixel value J (z) at each coordinate is combined by (8b), forms defogging result figure J.
CN201610808183.9A 2016-09-08 2016-09-08 Dark defogging parallel optimization method based on OpenCL Active CN106469440B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610808183.9A CN106469440B (en) 2016-09-08 2016-09-08 Dark defogging parallel optimization method based on OpenCL

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610808183.9A CN106469440B (en) 2016-09-08 2016-09-08 Dark defogging parallel optimization method based on OpenCL

Publications (2)

Publication Number Publication Date
CN106469440A CN106469440A (en) 2017-03-01
CN106469440B true CN106469440B (en) 2019-07-16

Family

ID=58230664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610808183.9A Active CN106469440B (en) 2016-09-08 2016-09-08 Dark defogging parallel optimization method based on OpenCL

Country Status (1)

Country Link
CN (1) CN106469440B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107424132B (en) * 2017-07-25 2020-07-07 西安电子科技大学 Optimization method for rapid image defogging
CN108093175B (en) * 2017-12-25 2018-11-13 北京航空航天大学 A kind of adaptive defogging method of real-time high-definition video and device
CN108765302B (en) * 2018-03-29 2022-07-22 西安电子科技大学 Image real-time defogging method based on GPU
CN109901840B (en) * 2019-02-14 2020-10-27 中国科学院计算技术研究所 Heterogeneous compilation optimization method for inter-thread redundancy deletion

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104751421A (en) * 2015-03-10 2015-07-01 西安理工大学 Method for achieving image defogging on FPGA
CN105488769A (en) * 2015-12-08 2016-04-13 中国航空工业集团公司西安航空计算技术研究所 Real time video defogging method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8340461B2 (en) * 2010-02-01 2012-12-25 Microsoft Corporation Single image haze removal using dark channel priors

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104751421A (en) * 2015-03-10 2015-07-01 西安理工大学 Method for achieving image defogging on FPGA
CN105488769A (en) * 2015-12-08 2016-04-13 中国航空工业集团公司西安航空计算技术研究所 Real time video defogging method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
An improved sharpening algorithm for foggy picture based on dark-channel prior;Liu, H 等;《PROCEEDINGS OF THE 2015 INTERNATIONAL INDUSTRIAL INFORMATICS AND COMPUTER ENGINEERING CONFERENCE》;20150111;第2099-2104页
单幅雾天降质图像色彩复原算法研究;楚君;《中国优秀硕士学位论文全文数据库信息科技辑》;20151231;论文第3.3.3节,4.3节
基于 OpenCL 的图像去雾算法研究;刘晓光;《中国优秀硕士学位论文全文数据库信息科技辑》;20140329;论文第1.3,1.4,3.4,4.2,4.3,4.4节
高效均值滤波算法;王科俊等;《计算机应用研究》;20100228;论文引言

Also Published As

Publication number Publication date
CN106469440A (en) 2017-03-01

Similar Documents

Publication Publication Date Title
CN106469440B (en) Dark defogging parallel optimization method based on OpenCL
CN107301623B (en) Traffic image defogging method and system based on dark channel and image segmentation
CN102750674B (en) Video image defogging method based on self-adapting allowance
CN105354806B (en) Rapid defogging method and system based on dark
CN100539698C (en) The video of interactive time-space unanimity is scratched drawing method in a kind of Digital Video Processing
CN110634147B (en) Image matting method based on bilateral guide up-sampling
CN111914698B (en) Human body segmentation method, segmentation system, electronic equipment and storage medium in image
CN106023091B (en) The real-time defogging method of image based on graphics processor
CN108564549A (en) A kind of image defogging method based on multiple dimensioned dense connection network
CN103996170A (en) Image edge saw-tooth eliminating method with super resolution
CN105976337B (en) A kind of image defogging method based on intermediate value guiding filtering
CN105654440B (en) Quick single image defogging algorithm based on regression model and system
CN111899295B (en) Monocular scene depth prediction method based on deep learning
CN106933579A (en) Image rapid defogging method based on CPU+FPGA
Ling et al. Single image dehazing using saturation line prior
CN104021527B (en) Rain and snow removal method in image
CN110570381B (en) Semi-decoupling image decomposition dark light image enhancement method based on Gaussian total variation
CN106780380A (en) A kind of image defogging method and system
US20070200864A1 (en) Method and system for gathering per-frame image statistics while preserving resolution and runtime performance in a real-time visual simulation
Fang et al. Single image dehazing and denoising with variational method
CN114926407A (en) Steel surface defect detection system based on deep learning
CN110189390A (en) A kind of monocular vision SLAM method and system
CN111414938B (en) Target detection method for bubbles in plate heat exchanger
CN104822030B (en) A kind of squaring antidote of irregular video based on anamorphose
CN108629750A (en) A kind of night defogging method, terminal device and storage medium

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
GR01 Patent grant
GR01 Patent grant