CN104767912A - Video defogging method and system based on FPGA - Google Patents

Video defogging method and system based on FPGA Download PDF

Info

Publication number
CN104767912A
CN104767912A CN201510175410.4A CN201510175410A CN104767912A CN 104767912 A CN104767912 A CN 104767912A CN 201510175410 A CN201510175410 A CN 201510175410A CN 104767912 A CN104767912 A CN 104767912A
Authority
CN
China
Prior art keywords
matrix
value
video image
mist elimination
minimum value
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.)
Granted
Application number
CN201510175410.4A
Other languages
Chinese (zh)
Other versions
CN104767912B (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.)
SHENZHEN GENIUSUN TECHNOLOGY CO LTD
Original Assignee
SHENZHEN GENIUSUN 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 SHENZHEN GENIUSUN TECHNOLOGY CO LTD filed Critical SHENZHEN GENIUSUN TECHNOLOGY CO LTD
Priority to CN201510175410.4A priority Critical patent/CN104767912B/en
Publication of CN104767912A publication Critical patent/CN104767912A/en
Application granted granted Critical
Publication of CN104767912B publication Critical patent/CN104767912B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to a video defogging method based on an FPGA. With the FPGA as a processing body, through detecting the maximum value and the minimum value of R, G and B values of each pixel in a current video image frame, a maximum value matrix and a minimum value matrix are obtained, the average value of all the minimum values in the minimum value matrix is calculated, and average filtering is performed on the minimum value matrix; according to an obtained average filtering matrix and the obtained average value, an atmospheric transmission ratio matrix is calculated; according to the maximum value matrix, the average filtering matrix and the current video image frame, the light component of atmosphere is calculated; when a next video image frame is received, RGB data of the current video image frame are read and converted into YUV spatial data; according to the atmospheric transmission ratio matrix, the light component of the atmosphere and a Y value in the YUV spatial data, a Y value in the defogged YUV spatial data is calculated, wherein the Y value and a U value and a V value in the YUV spatial data are combined to form the defogged YUV spatial data; the defogged YUV spatial data are converted into RGB data, and the RGB data after defogging the current video image frame are obtained.

Description

Based on video defogging method capable and the system of FPGA
Technical field
The present invention relates to technical field of video image processing, particularly relate to a kind of video defogging method capable based on FPGA and system.
Background technology
The video taken under the weather condition having mist or haze, because the suspended particulate in air produces absorption and scattering process to light, cause image quality decrease, occur ambiguous phenomenon, reduce the visuality of video, and interference is caused to successive image process.Existing mist elimination algorithm speed is slow, and amount of calculation is large, and can not realize on hardware.
Summary of the invention
Technical problem to be solved by this invention is, proposes a kind of video defogging method capable based on FPGA and system, and slow to solve existing algorithm speed, amount of calculation is large, the difficult problem that can not realize on hardware.The present invention is achieved in that
Based on a video defogging method capable of FPGA, described method carries out mist elimination by FPGA to current frame video image, comprises the steps:
Receive and store current frame video image, meanwhile, detecting the maximum in R, G, B value of each pixel in described current frame video image and minimum value, obtaining maximum matrix and minimum value matrix;
Mean filter is carried out to described minimum value matrix, exports the mean filter matrix of minimum value;
Calculate the mean value of each minimum value in described minimum value matrix;
According to described mean filter matrix and described mean value calculation atmospheric transmission rate matrix;
Atmosphere light composition is calculated according to described maximum matrix, mean filter matrix and described current frame video image;
When receiving next frame video image, read the RGB data of described current frame video image, and be converted into yuv space data;
The Y value in the yuv space data after mist elimination is calculated according to the Y value in described atmospheric transmission rate matrix and atmosphere light composition and described yuv space data;
Yuv space data after utilizing the U value in the Y value in the yuv space data after mist elimination and described yuv space data and V value to form mist elimination;
Yuv space data after described mist elimination are converted to RGB data, obtain the RGB data after described current frame video image mist elimination.
Further, described current frame video image is stored in DDR memory.
Further, the formula calculating atmospheric transmission rate matrix is: L 0=min (min (pm av, 1.0) and M ave(x), M (x)); Wherein, p is mist elimination intensity, m avfor the mean value of each minimum value in described minimum value matrix; M avex () is described mean filter matrix; M (x) is described current frame video image; M ave(x)=average sa(Min (x)), wherein, described Min (x) is described minimum value matrix.
Further, described method also comprises the steps:
PC regulates described FPGA by serial ports, to regulate the value of described p.
Further, the computing formula of described atmosphere light composition is: A = 1 2 ( max ( Max ( x ) ) + max Mave ( x ) ) 1 1 1 .
Based on a video mist elimination system of FPGA, described system carries out mist elimination by FPGA to current frame video image, comprising:
Matrix builds module, in order to receive and to store current frame video image, meanwhile, detects the maximum in R, G, B value of each pixel in described current frame video image and minimum value, obtains maximum matrix and minimum value matrix;
Mean filter module, in order to carry out mean filter to described minimum value matrix, exports the mean filter matrix of minimum value;
Mean value calculation module, in order to calculate the mean value of each minimum value in described minimum value matrix;
Atmospheric transmissivity matrix computations module, in order to according to described mean filter matrix and described mean value calculation atmospheric transmission rate matrix;
Atmosphere light composition computing module, in order to calculate atmosphere light composition according to described maximum matrix, mean filter matrix and described current frame video image;
Yuv space data conversion module, in order to when receiving next frame video image, reading the RGB data of described current frame video image, and being converted into yuv space data;
Y value computing module after mist elimination, in order to calculate the Y value in the yuv space data after mist elimination according to the Y value in described atmospheric transmission rate matrix and atmosphere light composition and described yuv space data;
Yuv space data construct module after mist elimination, forms the yuv space data after mist elimination in order to utilize the U value in the Y value in the yuv space data after mist elimination and described yuv space data and V value;
RGB data modular converter, in order to the yuv space data after described mist elimination are converted to RGB data, obtains the RGB data after described current frame video image mist elimination.
Further, described current frame video image is stored in DDR memory.
Further, the formula calculating atmospheric transmission rate matrix is: L 0=min (min (pm av, 1.0) and M ave(x), M (x)); Wherein, p is mist elimination intensity, m avfor the mean value of each minimum value in described minimum value matrix; M avex () is described mean filter matrix; M (x) is described current frame video image; M ave(x)=average sa(Min (x)), wherein, described Min (x) is described minimum value matrix.
Further, described system also comprises PC, and described PC regulates described FPGA by serial ports, to regulate the value of described p.
Further, the computing formula of described atmosphere light composition is: A = 1 2 ( max ( Max ( x ) ) + max Mave ( x ) ) 1 1 1 .
Compared with prior art, the present invention, using FPGA as process main body, only needs storage one frame video, just can meet the function of fast in real time mist elimination, raising picture quality, and meets hardware and process in real time, the time delay one two field picture time, and does not affect video playback.
Accompanying drawing explanation
Fig. 1: the video defogging method capable principle schematic that the present invention is based on FPGA;
Fig. 2: the video mist elimination system composition schematic diagram that the present invention is based on FPGA;
Fig. 3: described video mist elimination system mist elimination degree regulates schematic diagram.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.
The present invention proposes to carry out mist elimination by FPGA to video.As shown in Figure 1, the method specifically comprises the steps:
Step S1: receive and store current frame video image M (x), simultaneously, detect the maximum in R, G, B value of each pixel in current frame video image and minimum value, obtain maximum matrix M ax (x) and minimum value matrix M in (x).R, G, B value of such as a certain pixel is respectively 223,114,51, then the maximum of this pixel is 223, and minimum value is 51.The maximum of each pixel forms maximum matrix M ax (x), and the minimum value of each pixel forms minimum value matrix M in (x).
Step S2: carry out mean filter to minimum value matrix M in (x), exports the mean filter matrix M of minimum value ave(x).
Step S3: the mean value m of each minimum value in calculated minimum matrix av.
Step S4: according to mean filter matrix and mean value calculation atmospheric transmissivity matrix L 0.The formula calculating atmospheric transmission rate matrix is: L 0=min (min (pm av, 1.0) and M ave(x), M (x)), M ave(x)=average sa(Min (x)).FPGA also can connect PC, and PC regulates FPGA by serial ports, to regulate mist elimination intensity p, thus adjustment atmospheric transmissivity matrix L 0, realize the control to mist elimination intensity.
Step S5: calculate atmosphere light composition A according to maximum matrix, mean filter matrix and current frame video image.Atmosphere light composition computing formula is: A = 1 2 ( max ( Max ( x ) ) + max Mave ( x ) ) 1 1 1 .
Step S6: when receiving next frame video image, reads the RGB data of current frame video image, and is converted into yuv space data.
Step S7: calculate the Y value in the yuv space data after mist elimination according to the Y value in atmospheric transmission rate matrix and atmosphere light composition and yuv space data.Computational methods are: wherein Y' is the Y value in yuv space data after mist elimination, and Y is the Y value in the yuv space data before mist elimination.
Step S8: the yuv space data after utilizing the Y value in the yuv space data after mist elimination and the U value in yuv space data and V value to form mist elimination.
Step S9: the yuv space data after mist elimination are converted to RGB data, obtains the RGB data after current frame video image mist elimination.
When implementing of the present invention, the RGB data of current frame video image can be stored in outside DDR memory, the result of calculation of current frame video image can be applicable in the process to current frame video image, the violent saltus step of mist elimination is there will not be in the obvious video of image saltus step, more advanced than the method that the result of calculation of current frame video image is applied in the process of next frame video image.
Based on above-mentioned video defogging method capable, present invention also offers a kind of video mist elimination system based on FPGA, by FPGA101, mist elimination is carried out to current frame video image.Composition graphs 2 and Fig. 3, this system comprises: matrix builds module 2, mean filter module 3, mean value calculation module 4, atmospheric transmissivity matrix computations module 5, atmosphere light composition computing module 6, yuv space data conversion module 7, yuv space data construct module 9 and RGB data modular converter 10 after Y value computing module 8, mist elimination after mist elimination.Wherein:
Matrix builds module 2 in order to receive and to store current frame video image 1, meanwhile, detects the maximum in R, G, B value of each pixel in current frame video image and minimum value, obtains maximum matrix and minimum value matrix.
Mean filter module 3, in order to carry out mean filter to minimum value matrix, exports the mean filter matrix of minimum value.
Mean value calculation module 4 is in order to the mean value of minimum value each in calculated minimum matrix.
Atmospheric transmissivity matrix computations module 5 is in order to according to mean filter matrix and mean value calculation atmospheric transmission rate matrix.
Atmosphere light composition computing module 6 is in order to calculate atmosphere light composition according to maximum matrix, mean filter matrix and current frame video image.
Yuv space data conversion module 7, in order to when receiving next frame video image, reading the RGB data of current frame video image, and being converted into yuv space data.
After mist elimination, Y value computing module 8 is in order to calculate the Y value in the yuv space data after mist elimination according to the Y value in atmospheric transmission rate matrix and atmosphere light composition and yuv space data.
After mist elimination, yuv space data construct module 9 forms the yuv space data after mist elimination in order to utilize the Y value in the yuv space data after mist elimination and the U value in yuv space data and V value.
RGB data modular converter 10, in order to the yuv space data after mist elimination are converted to RGB data, obtains the RGB data after current frame video image mist elimination.Current frame video image is stored in DDR memory, and this DDR memory can adopt DDR2RAM102.
The formula calculating atmospheric transmission rate matrix is: L 0=min (min (pm av, 1.0) and M ave(x), M (x)); Wherein, p is, m avfor the mean value of minimum value each in minimum value matrix; M avex () is mean filter matrix; M (x) is current frame video image; M ave(x)=average sa(Min (x)), wherein, Min (x) is minimum value matrix.The computing formula of atmosphere light composition is: A = 1 2 ( max ( Max ( x ) ) + max Mave ( x ) ) 1 1 1 .
System also comprises PC 103, and PC 103 regulates FPGA by serial ports, to regulate the value of mist elimination intensity p, thus adjustment atmospheric transmissivity matrix L 0, realize the control to mist elimination intensity.
Native system only needs storage one frame video, just can meet the function of fast in real time mist elimination, improves picture quality, and meets hardware and process in real time, a time delay one two field picture time, can not affect video playback.The present invention uses FPGA101 for process main body, can be applicable to multi-signal I/O mode, can be applied in different video source and display occasion, have easy installation, compatibility by force, to the less demanding feature of operating personnel.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. based on a video defogging method capable of FPGA, it is characterized in that, described method carries out mist elimination by FPGA to current frame video image, comprises the steps:
Receive and store current frame video image, meanwhile, detecting the maximum in R, G, B value of each pixel in described current frame video image and minimum value, obtaining maximum matrix and minimum value matrix;
Mean filter is carried out to described minimum value matrix, exports the mean filter matrix of minimum value;
Calculate the mean value of each minimum value in described minimum value matrix;
According to described mean filter matrix and described mean value calculation atmospheric transmission rate matrix;
Atmosphere light composition is calculated according to described maximum matrix, mean filter matrix and described current frame video image;
When receiving next frame video image, read the RGB data of described current frame video image, and be converted into yuv space data;
The Y value in the yuv space data after mist elimination is calculated according to the Y value in described atmospheric transmission rate matrix and atmosphere light composition and described yuv space data;
Yuv space data after utilizing the U value in the Y value in the yuv space data after mist elimination and described yuv space data and V value to form mist elimination;
Yuv space data after described mist elimination are converted to RGB data, obtain the RGB data after described current frame video image mist elimination.
2., as claimed in claim 1 based on the video defogging method capable of FPGA, it is characterized in that, described current frame video image is stored in DDR memory.
3. as claimed in claim 1 based on the video defogging method capable of FPGA, it is characterized in that, the formula calculating atmospheric transmission rate matrix is: L 0=min (min (pm av, 1.0) and M ave(x), M (x)); Wherein, p is mist elimination intensity, m avfor the mean value of each minimum value in described minimum value matrix; M avex () is described mean filter matrix; M (x) is described current frame video image; M ave(x)=average sa(Min (x)), wherein, described Min (x) is described minimum value matrix.
4., as claimed in claim 1 based on the video defogging method capable of FPGA, it is characterized in that, also comprise the steps:
PC regulates described FPGA by serial ports, to regulate the value of described p.
5., as claimed in claim 3 based on the video defogging method capable of FPGA, it is characterized in that, the computing formula of described atmosphere light composition is: A = 1 2 ( max ( Max ( x ) ) + max Mave ( x ) ) 1 1 1 .
6., based on a video mist elimination system of FPGA, it is characterized in that, described system carries out mist elimination by FPGA to current frame video image, comprising:
Matrix builds module, in order to receive and to store current frame video image, meanwhile, detects the maximum in R, G, B value of each pixel in described current frame video image and minimum value, obtains maximum matrix and minimum value matrix;
Mean filter module, in order to carry out mean filter to described minimum value matrix, exports the mean filter matrix of minimum value;
Mean value calculation module, in order to calculate the mean value of each minimum value in described minimum value matrix;
Atmospheric transmissivity matrix computations module, in order to according to described mean filter matrix and described mean value calculation atmospheric transmission rate matrix;
Atmosphere light composition computing module, in order to calculate atmosphere light composition according to described maximum matrix, mean filter matrix and described current frame video image;
Yuv space data conversion module, in order to when receiving next frame video image, reading the RGB data of described current frame video image, and being converted into yuv space data;
Y value computing module after mist elimination, in order to calculate the Y value in the yuv space data after mist elimination according to the Y value in described atmospheric transmission rate matrix and atmosphere light composition and described yuv space data;
Yuv space data construct module after mist elimination, forms the yuv space data after mist elimination in order to utilize the U value in the Y value in the yuv space data after mist elimination and described yuv space data and V value;
RGB data modular converter, in order to the yuv space data after described mist elimination are converted to RGB data, obtains the RGB data after described current frame video image mist elimination.
7., as claimed in claim 6 based on the video mist elimination system of FPGA, it is characterized in that, described current frame video image is stored in DDR memory.
8. as claimed in claim 6 based on the video mist elimination system of FPGA, it is characterized in that, the formula calculating atmospheric transmission rate matrix is: L 0=min (min (pm av, 1.0) and M ave(x), M (x)); Wherein, p is mist elimination intensity, m avfor the mean value of each minimum value in described minimum value matrix; M avex () is described mean filter matrix; M (x) is described current frame video image; M ave(x)=average sa(Min (x)), wherein, described Min (x) is described minimum value matrix.
9., as claimed in claim 6 based on the video mist elimination system of FPGA, it is characterized in that, also comprise PC, described PC regulates described FPGA by serial ports, to regulate the value of described p.
10., as claimed in claim 8 based on the video mist elimination system of FPGA, it is characterized in that, the computing formula of described atmosphere light composition is: A = 1 2 ( max ( Max ( x ) ) + max Mave ( x ) ) 1 1 1 .
CN201510175410.4A 2015-04-14 2015-04-14 Video defogging method and system based on FPGA Expired - Fee Related CN104767912B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510175410.4A CN104767912B (en) 2015-04-14 2015-04-14 Video defogging method and system based on FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510175410.4A CN104767912B (en) 2015-04-14 2015-04-14 Video defogging method and system based on FPGA

Publications (2)

Publication Number Publication Date
CN104767912A true CN104767912A (en) 2015-07-08
CN104767912B CN104767912B (en) 2018-11-30

Family

ID=53649491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510175410.4A Expired - Fee Related CN104767912B (en) 2015-04-14 2015-04-14 Video defogging method and system based on FPGA

Country Status (1)

Country Link
CN (1) CN104767912B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083716A (en) * 2019-06-13 2020-12-15 中国电信股份有限公司 Navigation method, device and system based on machine vision

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104091310A (en) * 2014-06-24 2014-10-08 三星电子(中国)研发中心 Image defogging method and device
CN104394302A (en) * 2014-11-28 2015-03-04 深圳职业技术学院 Real-time video defogging system based on FPGA
CN104506755A (en) * 2015-01-13 2015-04-08 武汉烽火众智数字技术有限责任公司 Method for real-time automatic defogging of high-definition videos based on FPGA

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104091310A (en) * 2014-06-24 2014-10-08 三星电子(中国)研发中心 Image defogging method and device
CN104394302A (en) * 2014-11-28 2015-03-04 深圳职业技术学院 Real-time video defogging system based on FPGA
CN104506755A (en) * 2015-01-13 2015-04-08 武汉烽火众智数字技术有限责任公司 Method for real-time automatic defogging of high-definition videos based on FPGA

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘倩: "基于单幅图像的快速去雾算法", 《第25届中国控制与决策会议论文集》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083716A (en) * 2019-06-13 2020-12-15 中国电信股份有限公司 Navigation method, device and system based on machine vision

Also Published As

Publication number Publication date
CN104767912B (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN102750674B (en) Video image defogging method based on self-adapting allowance
US9361670B2 (en) Method and system for image haze removal based on hybrid dark channel prior
CN104240194B (en) A kind of enhancement algorithm for low-illumination image based on parabolic function
CN102637293B (en) Moving image processing device and moving image processing method
CN103310428A (en) Method and device for removing rainprint in image based on single image
CN106412448B (en) Wide dynamic range processing method and system based on single frame image
CN104506755B (en) HD video based on FPGA automates defogging method in real time
CN102831591A (en) Gaussian filter-based real-time defogging method for single image
CN107862672B (en) Image defogging method and device
CN104867122A (en) Infrared self-adaptive non-uniformity correction and detail enhanced cascade processing method
CN104899843A (en) Real-time haze-eliminating displayer and haze-eliminating display method thereof
CN104867121A (en) Fast image defogging method based on dark channel prior and Retinex theory
CN103886565A (en) Nighttime color image enhancement method based on purpose optimization and histogram equalization
CN103226809B (en) Image demister and image haze removal method
CN103366390A (en) Terminal, image processing method and device thereof
CN112651903A (en) Thermal infrared imager image preprocessing system and preprocessing method thereof
WO2013040857A1 (en) Exposure enhancement method and apparatus for a defogged image
CN103702116A (en) Wide dynamic compressing method and device for image
CN107369144A (en) Based on the multiple dimensioned Retinex images defogging method for improving homomorphic filtering
CN105989583B (en) A kind of image defogging method
CN104574281A (en) Infrared image detail enhancing method and device base on guide filters
CN104767912A (en) Video defogging method and system based on FPGA
CN107610058A (en) High-definition picture defogging method based on down-sampling
CN102572374A (en) Demisting image collection device
KR101535630B1 (en) Apparatus for enhancing the brightness of night image using brightness conversion model

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 Guangdong city of Shenzhen province Baoan District manhole Street Maan Shan Industrial Zone, the first saddle Long Road No. 8 on the third.

Applicant after: Shenzhen Risheng Polytron Technologies Inc

Address before: 518000, Baoan District, Guangdong province Shenzhen Sand Street, Ma'anshan first industrial zone

Applicant before: Shenzhen Geniusun Technology Co.,Ltd.

COR Change of bibliographic data
GR01 Patent grant
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: 20181130

Termination date: 20190414