CN104767912B - Video defogging method and system based on FPGA - Google Patents
Video defogging method and system based on FPGA Download PDFInfo
- Publication number
- CN104767912B CN104767912B CN201510175410.4A CN201510175410A CN104767912B CN 104767912 B CN104767912 B CN 104767912B CN 201510175410 A CN201510175410 A CN 201510175410A CN 104767912 B CN104767912 B CN 104767912B
- Authority
- CN
- China
- Prior art keywords
- value
- defogging
- matrix
- video image
- yuv space
- 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 present invention relates to the video defogging methods based on FPGA, using FPGA as processing main body, pass through the maximum value and minimum value in R, G, B value of each pixel in detection current frame video image, maximum value matrix and minimum value matrix are obtained, and the average value of each minimum value and mean filter is carried out to minimum value matrix in calculated minimum matrix;According to obtained mean filter matrix and mean value calculation atmospheric transmission rate matrix;Atmosphere light ingredient is calculated according to maximum value matrix, mean filter matrix and current frame video image;When receiving next frame video image, the RGB data of current frame video image is read, and is converted into yuv space data;The Y value in yuv space data after calculating defogging according to the Y value in atmospheric transmission rate matrix, atmosphere light ingredient and yuv space data, and by the yuv space data after the U value and V value composition defogging in the Y value and yuv space data;Yuv space data after defogging are converted into RGB data, the RGB data after obtaining current frame video image defogging.
Description
Technical field
The present invention relates to technical field of video image processing more particularly to a kind of video defogging method based on FPGA and it is
System.
Background technique
The video shot in the case where there is the weather condition of mist or haze, due to the suspended particulate in atmosphere to light generate absorb and
Scattering process leads to image quality decrease, smudgy phenomenon occurs, reduces the visuality of video, and to subsequent figure
As processing interferes.Existing defogging algorithm speed is slow, computationally intensive, and cannot realize on hardware.
Summary of the invention
The technical problem to be solved by the present invention is to propose a kind of video defogging method and system based on FPGA, with solution
Certainly existing algorithm speed is slow, computationally intensive, the problem that cannot be realized on hardware.The invention is realized in this way:
A kind of video defogging method based on FPGA, the method carry out defogging to current frame video image by FPGA,
Include the following steps:
Current frame video image is received and stored, meanwhile, detect R, G, B of each pixel in the current frame video image
Maximum value and minimum value in value obtain maximum value matrix and minimum value matrix;
Mean filter is carried out to the minimum value matrix, exports the mean filter matrix of minimum value;
Calculate the average value of each minimum value in the minimum value matrix;
According to the mean filter matrix and the mean value calculation atmospheric transmission rate matrix;
Atmosphere light ingredient is calculated according to the maximum value matrix, mean filter matrix and the current frame video image;
When receiving next frame video image, the RGB data of the current frame video image is read, and is converted into YUV
Spatial data;
After calculating defogging according to the Y value in the atmospheric transmission rate matrix and atmosphere light ingredient and the yuv space data
Yuv space data in Y value;
After the U value and V value composition defogging in the Y value and the yuv space data in the yuv space data after defogging
Yuv space data;
Yuv space data after the defogging are converted into RGB data, after obtaining the current frame video image defogging
RGB data.
Further, the current frame video image is stored in DDR memory.
Further, the formula of calculating atmospheric transmission rate matrix is:L0=min (min (pmav,1.0)Mave(x),M(x));
Wherein, p is defogging intensity, mavFor the average value of each minimum value in the minimum value matrix;MaveIt (x) is the mean filter square
Battle array;M (x) is the current frame video image;Mave(x)=averagesa(Min (x)), wherein the Min (x) be it is described most
Small value matrix.
Further, the method also includes following steps:
PC machine adjusts the FPGA by serial ports, to adjust the value of the p.
Further, the calculation formula of the atmosphere light ingredient is:
A kind of video defogging system based on FPGA, the system carry out defogging to current frame video image by FPGA,
Including:
Matrix constructs module, to receive and store current frame video image, meanwhile, detect the current frame video image
In each pixel R, G, B value in maximum value and minimum value, obtain maximum value matrix and minimum value matrix;
Mean filter module exports the mean filter square of minimum value to carry out mean filter to the minimum value matrix
Battle array;
Mean value calculation module, to calculate the average value of each minimum value in the minimum value matrix;
Atmospheric transmission rate matrix computing module, to saturating according to the mean filter matrix and the mean value calculation atmosphere
Penetrate rate matrix;
Atmosphere light ingredient computing module, to be regarded according to the maximum value matrix, mean filter matrix and the present frame
Frequency image calculates atmosphere light ingredient;
Yuv space data conversion module, to read the current frame video image when receiving next frame video image
RGB data, and be converted into yuv space data;
Y value computing module after defogging, to according to the atmospheric transmission rate matrix and atmosphere light ingredient and the yuv space
The Y value in the yuv space data after Y value calculating defogging in data;
Yuv space data construct module after defogging, to using in the yuv space data after defogging Y value and the YUV
The yuv space data after U value and V value composition defogging in spatial data;
RGB data conversion module is worked as described in acquisition the yuv space data after the defogging are converted to RGB data
RGB data after preceding frame video image defogging.
Further, the current frame video image is stored in DDR memory.
Further, the formula of calculating atmospheric transmission rate matrix is:L0=min (min (pmav,1.0)Mave(x),M(x));
Wherein, p is defogging intensity, mavFor the average value of each minimum value in the minimum value matrix;MaveIt (x) is the mean filter square
Battle array;M (x) is the current frame video image;Mave(x)=averagesa(Min (x)), wherein the Min (x) be it is described most
Small value matrix.
Further, the system also includes PC machine, the PC machine adjusts the FPGA by serial ports, to adjust the p
Value.
Further, the calculation formula of the atmosphere light ingredient is:
Compared with prior art, the present invention is using FPGA as processing main body, it is only necessary to store a frame video, so that it may meet
The quickly function of real-time defogging, improves picture quality, and meet hardware and handle in real time, and be delayed a frame image temporal, and not
Influence video playing.
Detailed description of the invention
Fig. 1:The present invention is based on the video defogging method schematic illustrations of FPGA;
Fig. 2:The present invention is based on the video defogging system composition schematic diagrams of FPGA;
Fig. 3:The video defogging system defogging degree adjusts schematic diagram.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.
The present invention proposes to carry out defogging to video by FPGA.As shown in Figure 1, this method specifically comprises the following steps:
Step S1:Current frame video image M (x) is received and stored, meanwhile, detect each pixel in current frame video image
R, G, B value in maximum value and minimum value, obtain maximum value matrix Max (x) and minimum value matrix Min (x).Such as a certain picture
R, G, B value of element are respectively 223,114,51, then the maximum value of the pixel is 223, minimum value 51.The maximum value structure of each pixel
At maximum value matrix Max (x), the minimum value of each pixel constitutes minimum value matrix Min (x).
Step S2:Mean filter is carried out to minimum value matrix Min (x), exports the mean filter matrix M of minimum valueave(x)。
Step S3:The average value m of each minimum value in calculated minimum matrixav。
Step S4:According to mean filter matrix and mean value calculation atmospheric transmissivity matrix L0.Calculate atmospheric transmissivity square
Battle array formula be:L0=min (min (pmav,1.0)Mave(x), M (x)), Mave(x)=averagesa(Min(x)).FPGA may be used also
PC machine is connected, PC machine can adjust FPGA by serial ports, to adjust defogging intensity p, so as to adjust atmospheric transmissivity matrix L0, realize
Control to defogging intensity.
Step S5:Atmosphere light ingredient A is calculated according to maximum value matrix, mean filter matrix and current frame video image.Greatly
Gas light ingredient calculation formula is:
Step S6:When receiving next frame video image, the RGB data of current frame video image is read, and is converted into
Yuv space data.
Step S7:After calculating defogging according to the Y value in atmospheric transmission rate matrix and atmosphere light ingredient and yuv space data
Y value in yuv space data.Calculation method is:Wherein Y' is the yuv space data after defogging
In Y value, Y be defogging before yuv space data in Y value.
Step S8:Using in the yuv space data after defogging Y value in yuv space data U value and V value composition go
Yuv space data after mist.
Step S9:Yuv space data after defogging are converted into RGB data, after obtaining current frame video image defogging
RGB data.
In carrying out the present invention, the RGB data of current frame video image can be stored in external DDR memory, currently
The calculated result of frame video image can be applicable in the processing to current frame video image, jump in apparent video not in image
The violent jump that will appear defogging, than applying the calculated result of current frame video image in the processing of next frame video image
Method it is more advanced.
Based on above-mentioned video defogging method, the video defogging system based on FPGA that the present invention also provides a kind of passes through
FPGA101 carries out defogging to current frame video image.In conjunction with Fig. 2 and Fig. 3, which includes:Matrix constructs module 2, mean value filter
Wave module 3, mean value calculation module 4, atmospheric transmission rate matrix computing module 5, atmosphere light ingredient computing module 6, yuv space number
According to yuv space data building module 9 and RGB data conversion module 10 after Y value computing module 8, defogging after conversion module 7, defogging.
Wherein:
Matrix constructs module 2 to receive and store current frame video image 1, meanwhile, it detects in current frame video image
Maximum value and minimum value in R, G, B value of each pixel obtain maximum value matrix and minimum value matrix.
Mean filter module 3 exports the mean filter matrix of minimum value to carry out mean filter to minimum value matrix.
Average value of the mean value calculation module 4 to each minimum value in calculated minimum matrix.
Atmospheric transmission rate matrix computing module 5 is to according to mean filter matrix and mean value calculation atmospheric transmissivity square
Battle array.
Atmosphere light ingredient computing module 6 is to according to maximum value matrix, mean filter matrix and current frame video image meter
Calculate atmosphere light ingredient.
Yuv space data conversion module 7 is to read current frame video image when receiving next frame video image
RGB data, and it is converted into yuv space data.
Y value computing module 8 is to according in atmospheric transmission rate matrix and atmosphere light ingredient and yuv space data after defogging
The Y value in yuv space data after Y value calculating defogging.
Yuv space data building module 9 is to utilize the Y value and yuv space in the yuv space data after defogging after defogging
The yuv space data after U value and V value composition defogging in data.
RGB data conversion module 10 obtains present frame view the yuv space data after defogging are converted to RGB data
RGB data after frequency image defogging.Current frame video image is stored in DDR memory, which can be used
DDR2RAM102。
Calculate atmospheric transmission rate matrix formula be:L0=min (min (pmav,1.0)Mave(x),M(x));Wherein, p is,
mavFor the average value of each minimum value in minimum value matrix;MaveIt (x) is mean filter matrix;M (x) is current frame video image;
Mave(x)=averagesa(Min (x)), wherein Min (x) is minimum value matrix.The calculation formula of atmosphere light ingredient is:
System further includes PC machine 103, and PC machine 103 adjusts FPGA by serial ports, to adjust the value of defogging intensity p, to adjust
Whole atmospheric transmissivity matrix L0, realize the control to defogging intensity.
This system only needs to store a frame video, so that it may and meet quickly the function of defogging in real time, improves picture quality, and
And meet hardware and handle in real time, be only delayed a frame image temporal, will not influence video playing.The present invention is place using FPGA101
Manage main body, can be suitble to multi-signal I/O mode, can apply in different video source and show occasion, with it is easy to install,
The compatible strong, feature of less demanding to operator.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.
Claims (10)
1. a kind of video defogging method based on FPGA, which is characterized in that the method is by FPGA to current frame video image
Defogging is carried out, is included the following steps:
Current frame video image is received and stored, meanwhile, it detects in R, G, B value of each pixel in the current frame video image
Maximum value and minimum value, obtain maximum value matrix and minimum value matrix;
Mean filter is carried out to the minimum value matrix, exports the mean filter matrix of minimum value;
Calculate the average value of each minimum value in the minimum value matrix;
According to the mean filter matrix and the mean value calculation atmospheric transmission rate matrix;
Atmosphere light ingredient is calculated according to the maximum value matrix, mean filter matrix and the current frame video image;
When receiving next frame video image, the RGB data of the current frame video image is read, and is converted into yuv space
Data;
YUV after calculating defogging according to the Y value in the atmospheric transmission rate matrix and atmosphere light ingredient and the yuv space data
Y value in spatial data, circular are:Wherein Y' is the yuv space data after defogging
In Y value, Y be defogging before yuv space data in Y value, A be atmosphere light ingredient, L0For atmospheric transmission rate matrix, M (Y) is
The current frame video image is converted to the Y value in yuv space data;
After the U value and V value composition defogging in the Y value and the yuv space data in the yuv space data after defogging
Yuv space data;
Yuv space data after the defogging are converted into RGB data, the RGB after obtaining the current frame video image defogging
Data.
2. the video defogging method based on FPGA as described in claim 1, which is characterized in that the current frame video image is deposited
Storage is in DDR memory.
3. the video defogging method based on FPGA as described in claim 1, which is characterized in that calculate atmospheric transmission rate matrix
Formula is:L0=min (min (pmav,1.0)Mave(x),M(x));Wherein, p is defogging intensity, mavFor in the minimum value matrix
The average value of each minimum value;MaveIt (x) is the mean filter matrix;M (x) is the current frame video image;Mave(x)=
averagesa(Min (x)), wherein the Min (x) is the minimum value matrix.
4. the video defogging method based on FPGA as claimed in claim 3, which is characterized in that further include following steps:
PC machine adjusts the FPGA by serial ports, to adjust the value of the p.
5. the video defogging method based on FPGA as claimed in claim 3, which is characterized in that the calculating of the atmosphere light ingredient
Formula is:
6. a kind of video defogging system based on FPGA, which is characterized in that the system is by FPGA to current frame video image
Defogging is carried out, including:
Matrix constructs module, to receive and store current frame video image, meanwhile, it detects every in the current frame video image
Maximum value and minimum value in R, G, B value of one pixel obtain maximum value matrix and minimum value matrix;
Mean filter module exports the mean filter matrix of minimum value to carry out mean filter to the minimum value matrix;
Mean value calculation module, to calculate the average value of each minimum value in the minimum value matrix;
Atmospheric transmission rate matrix computing module, to according to the mean filter matrix and the mean value calculation atmospheric transmissivity
Matrix;
Atmosphere light ingredient computing module, to according to the maximum value matrix, mean filter matrix and the present frame video figure
As calculating atmosphere light ingredient;
Yuv space data conversion module, to read the current frame video image when receiving next frame video image
RGB data, and it is converted into yuv space data;
Y value computing module after defogging, to according to the atmospheric transmission rate matrix and atmosphere light ingredient and the yuv space data
In Y value calculate the Y value in the yuv space data after defogging, circular is:Wherein
Y' is the Y value in the yuv space data after defogging, and Y is the Y value in the yuv space data before defogging, and A is atmosphere light ingredient, L0
For atmospheric transmission rate matrix, M (Y) is that the current frame video image is converted to the Y value in yuv space data;
Yuv space data construct module after defogging, to using in the yuv space data after defogging Y value and the yuv space
The yuv space data after U value and V value composition defogging in data;
RGB data conversion module obtains the present frame the yuv space data after the defogging are converted to RGB data
RGB data after video image defogging.
7. the video defogging system based on FPGA as claimed in claim 6, which is characterized in that the current frame video image is deposited
Storage is in DDR memory.
8. the video defogging system based on FPGA as claimed in claim 6, which is characterized in that calculate atmospheric transmission rate matrix
Formula is:L0=min (min (pmav,1.0)Mave(x),M(x));Wherein, p is defogging intensity, mavFor in the minimum value matrix
The average value of each minimum value;MaveIt (x) is the mean filter matrix;M (x) is the current frame video image;Mave(x)=
averagesa(Min (x)), wherein the Min (x) is the minimum value matrix.
9. the video defogging system based on FPGA as claimed in claim 8, which is characterized in that it further include PC machine, the PC machine
The FPGA is adjusted by serial ports, to adjust the value of the p.
10. the video defogging system based on FPGA as claimed in claim 8, which is characterized in that the meter of the atmosphere light ingredient
Calculating formula is:
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 CN104767912A (en) | 2015-07-08 |
CN104767912B true 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) |
Families Citing this family (1)
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)
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 |
-
2015
- 2015-04-14 CN CN201510175410.4A patent/CN104767912B/en not_active Expired - Fee Related
Patent Citations (3)
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)
Title |
---|
基于单幅图像的快速去雾算法;刘倩;《第25届中国控制与决策会议论文集》;20130525;第3781页左栏第16行-第3782页右栏第14行 * |
Also Published As
Publication number | Publication date |
---|---|
CN104767912A (en) | 2015-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11849224B2 (en) | Global tone mapping | |
CN103955905B (en) | Based on the single image to the fog method that fast wavelet transform and weighted image merge | |
Jiang et al. | Night video enhancement using improved dark channel prior | |
CN104240194B (en) | A kind of enhancement algorithm for low-illumination image based on parabolic function | |
CN104917975B (en) | A kind of adaptive automatic explosion method based on target signature | |
WO2018126962A1 (en) | Systems and methods for enhancing edges in images | |
CN105430385A (en) | Method and device for dead pixel detection and correction of image sensor | |
US20140292616A1 (en) | Computer monitor equalization using handheld device | |
CN107820069B (en) | Video monitoring equipment ISP debugging method | |
CN104021533B (en) | A kind of real time imaging noise-reduction method and device | |
CN111027415B (en) | Vehicle detection method based on polarization image | |
CN104899836B (en) | A kind of Misty Image intensifier and method based near infrared multispectral imaging | |
CN112651903B (en) | Thermal infrared imager image preprocessing system and preprocessing method thereof | |
US10055825B2 (en) | System and method for fast digital signal dynamic range reduction using adaptive histogram compaction and stabilization | |
CN110163807B (en) | Low-illumination image enhancement method based on expected bright channel | |
CN104867122A (en) | Infrared self-adaptive non-uniformity correction and detail enhanced cascade processing method | |
CN108682039A (en) | A kind of binocular stereo vision measurement method | |
CN105791636A (en) | Video processing system | |
CN109886883A (en) | Real-time polarization fog-penetrating imaging image enhancement processing method | |
CN109934790A (en) | Infrared imaging system asymmetric correction method with adaptive threshold | |
CN104767912B (en) | Video defogging method and system based on FPGA | |
CN104240666B (en) | A kind of method for processing video frequency and device | |
CN108093175A (en) | A kind of adaptive defogging method of real-time high-definition video and device | |
CN111028181B (en) | Image enhancement processing method, device, equipment and storage medium | |
CN106404182A (en) | Method for widening suitable temperature scope of one-point correction |
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 |
Granted publication date: 20181130 Termination date: 20190414 |
|
CF01 | Termination of patent right due to non-payment of annual fee |