CN105279765A - System and method for detecting color target based on FPGA (field programmable gate array) - Google Patents

System and method for detecting color target based on FPGA (field programmable gate array) Download PDF

Info

Publication number
CN105279765A
CN105279765A CN201410235952.1A CN201410235952A CN105279765A CN 105279765 A CN105279765 A CN 105279765A CN 201410235952 A CN201410235952 A CN 201410235952A CN 105279765 A CN105279765 A CN 105279765A
Authority
CN
China
Prior art keywords
color
component
pixel
module
road
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
CN201410235952.1A
Other languages
Chinese (zh)
Other versions
CN105279765B (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.)
Nanjing University of Science and Technology
Original Assignee
Nanjing University of Science and Technology
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 University of Science and Technology filed Critical Nanjing University of Science and Technology
Priority to CN201410235952.1A priority Critical patent/CN105279765B/en
Publication of CN105279765A publication Critical patent/CN105279765A/en
Application granted granted Critical
Publication of CN105279765B publication Critical patent/CN105279765B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a system and a method for detecting a color target based on an FPGA (field programmable gate array). The system comprises a Bayer signal receiving module, a Bayer format interpolation to RGB module, an R, G, B three-path color component addition module, an R, G, B three-path color component left shifting module, a division module, and a color judgment and binarization target module. The above modules are all realized in the FPGA. The system and the method provided by the invention can detect a target with color feature information for a high-resolution image in real time, and segment the target from the high-resolution image, thereby carrying out follow-up processing such as target tracking.

Description

A kind of color target detection system based on FPGA and method
Technical field
The invention belongs to the real-time detection and tracking field of target, be specifically related to a kind of color target detection system based on FPGA and method.
Background technology
Machine vision is the science of an Applied Computer Techniques simulation people and biological vision, utilizes robot to replace human eye to carry out measuring and judging target. wherein vision tracking is an important branch of machine vision.
In vision is followed the tracks of, primary work uses vision system to carry out target detection exactly, only can detection and tracking target on the correct basis confirming target, target detection process is exactly the process of image analysis processing, selects suitable image processing method can improve real-time and the robustness of target detection.
Existing color target real-time detection method mainly Based PC and camera system color region object detection method and based on embedded color region object detection method.The color region object detection method of Based PC and camera system is linked in PC by camera, then under the pure software environment such as MicrosoftVisualStudio, target detection is carried out, but this detection method needs to buy the capture card supporting with camera, expensive, and because be pure software environment, image processing speed is very slow, does not reach the requirement of real-time; Have based on embedded color region object detection method and realize in ARM, MCU and FPGA, employ NiosII embedded central processing unit based on the Embedded color region object detection method of FPGA, algorithm travelling speed is slower.These traditional methods, owing to being subject to the restriction of PC performance and digital signal processing chip performance, Color Image Processing ability can only complete the quasi real time process of 300,000 pixel images mostly, cannot process more high-resolution image in real time.
Summary of the invention
The object of the present invention is to provide a kind of color target detection system based on FPGA and method, target with color characteristic information can be detected in real time to high-resolution image, and be split, thus carry out the follow-up process such as target following.
In order to solve the problems of the technologies described above, the invention provides a kind of color target real-time detecting system based on FPGA, comprising Bayer signal receiving module; Bayer form interpolation turns RGB module; R, G, B tri-road color component summation module; R, G, B tri-road color component to move to left module; Dividing module; Color judges and binaryzation object module; Above-mentioned module all realizes in FPGA.
The present invention also provides a kind of color target detection method based on FPGA, comprises the following steps:
Step one, color according to target to be split in image, set each pixel in region to be split whether belong to this color R, G, B tri-road color component account for the decision threshold of color sum-rate;
Step 2, the image of Bayer form is converted into the image of rgb format;
Step 3, extract rgb format image in R, G, B tri-road color component, by the rear color total amount obtaining each pixel of R, G, B tri-road color component addition, then respectively to R, G, B tri-road color component to move to left N position, the span of N between 4 to 32, obtain by R, G, B tri-road color component expand 2 Nth power doubly after component value
Step 4: calculate component accounts for the ratio of color total amount respectively;
Step 5: decision threshold step one set expands the Nth power of 2 doubly, then judges the Nth power whether ratio that three road color components account for color total amount meets expansion 2 doubly after color threshold Rule of judgment, if met, be then 1 by this pixel assignment, if do not met, be 0 by this pixel assignment, obtain the binary image of target affiliated area to be tracked, for the process that target following is follow-up.
Compared with prior art, its remarkable advantage is in the present invention: the manageable bandwidth of (1) the present invention can reach more than Gpbs, in high resolving power high frame rate image procossing, have significant advantage; (2) the present invention departs from NiosII embedded central processing unit in FPGA, adopts pure hardware logic, and processing speed can reach more than 60fps, has the detection that very strong real-time achieves color region target; (3) ratio that each for color component accounts for color total amount is set to threshold value by the present invention, makes the condition differentiating color more abundant, thus reaches more accurate effect.
Accompanying drawing explanation
Fig. 1 is a kind of color target detection system structural representation based on FPGA of the present invention.
Fig. 2 is a kind of color target detection method process flow diagram based on FPGA of the present invention.
Fig. 3 is Bayer picture format schematic diagram.
Fig. 4 is four kinds of array mode schematic diagram that in Bayer format-pattern, R, G, B component exists.
Fig. 5 is the image as detected object in emulation experiment of the present invention.
Fig. 6 is the testing result image obtained in emulation experiment of the present invention.
Embodiment
As shown in Figure 1, a kind of color target detection system based on FPGA of the present invention, comprises Bayer signal receiving module; Bayer form interpolation turns RGB module; R, G, B tri-road color component summation module; R, G, B tri-road color component to move to left module; Dividing module; Color judges and binaryzation object module; Above-mentioned module all realizes in FPGA.The overprogram that FPGA is intrinsic, make the function of present system hardware can as software flexible and programmed configurations easily, and not only can the processing speed of elevator system, ensure the Effec-tive Function of algorithm, can also system bulk be reduced, be convenient to application and popularize.
Bayer signal receiving module, for receiving the picture signal of Bayer form, then sending into Bayer form interpolation and turning RGB module by the picture signal of Bayer form;
Bayer form interpolation turns GRB module for the image of Bayer form being converted to the image of rgb format, and extract the R road color component of each pixel in rgb format image, G road color component and B road color component, then by R, G, B tri-road color component send into respectively simultaneously R, G, B tri-road color component summation module and R, G, B color component to move to left module;
R, G, B tri-road color component summation module for calculating R, G, B tri-total amount of road color component, then color total amount is sent to dividing module;
R, G, B color component move to left module for by R, G, B tri-road color component to move to left respectively N position, the span of N is 4 to 32, obtain by R, G, B tri-road color component expand 2 Nth power doubly after three road color components, and will three road color components are sent to dividing module;
Dividing module is for calculating each pixel three road color components account for the ratio of color total amount separately, and ratio is sent to color determination module;
The ratio that color judges and the color component value of each pixel is accounted for color total amount by binaryzation object module compares with the color of object decision threshold condition preset, the pixel meeting threshold condition is the pixel meeting color of object to be tracked, also namely this pixel belongs to the pixel in target area to be tracked, is 1 by this pixel assignment; The pixel not meeting threshold condition is the pixel not meeting color of object to be tracked, also namely this pixel belongs to the pixel beyond target area to be tracked, be 0 by this pixel assignment, thus obtain the binary image of target affiliated area to be tracked, then sent to by binary image rear end to do target following process.This method solves a floating-point operation difficult problem in FPGA dexterously, makes to detect target at color region and reaches more accurate effect.
As shown in Figure 2, a kind of color target detection method based on FPGA of the present invention, comprises the following steps:
Step one, color according to target to be split in image, set each pixel in region to be split whether belong to this color R, G, B tri-road color component account for the decision threshold of color sum-rate, such as:
When the color of target to be split is red, if in image certain pixel R, G, B tri-road color component account for color sum-rate and meet following threshold decision condition, then this pixel be redness, and namely this pixel belongs to the pixel in target area to be split,
Belong to the threshold decision condition of red pixel: r = R / ( R + G + B ) > 0.4 g = G / ( R + G + B ) < 0.3 b = B / ( R + G + B ) < 0.2 ;
When the color of target to be split is green, if in image certain pixel R, G, B tri-road color component account for color sum-rate and meet following threshold decision condition, then this pixel be green, and namely this pixel belongs to the pixel in target area to be split,
Belong to the threshold decision condition of green pixel: r = R / ( R + G + B ) < 0.4 g = G / ( R + G + B ) > 0 . 4 b = B / ( R + G + B ) < 0.2
When the color of target to be split is blue, if in image certain pixel R, G, B tri-road color component account for color sum-rate and meet following threshold decision condition, then this pixel be blueness, and namely this pixel belongs to and to treat point
Belong to the threshold decision condition of green pixel: r = R / ( R + G + B ) < 0.4 g = G / ( R + G + B ) < 0 . 3 b = B / ( R + G + B ) > 0 . 3
Wherein, R, G, B are respectively R, G, B tri-road color component, and r, g, b are respectively the ratio that R color component, G color component or B color component account for R, G, B color total amount.
Step 2, the image of Bayer form is converted into the image of rgb format, detailed process is:
Interpolation arithmetic is used the picture signal of Bayer form to be converted into the picture signal of rgb format, Bayer picture format as shown in Figure 3, in figure 3, each grid represents a pixel, and each pixel contains the one in R, G, B tri-kinds of components, such as, the pixel of odd-numbered line is alternately made up of R, G component, and the pixel of even number line is alternately made up of G, B component, and wherein G component accounts for the half of all pixels, R component and B component account for second half of all pixels altogether, and namely G component is 2 times of R, B component.Therefore, when the image of Bayer form is converted into the image of rgb format, need to carry out interpolation to G component, using R, G, B color component of R, G, B component after interpolation arithmetic as rgb format image, thus the picture format of Bayer form is converted into the image of rgb format.As shown in Figure 4, in Bayer format-pattern, there are four kinds of array modes in R, G, B component, four kinds of array modes corresponding four kinds of interpolation calculation modes respectively.
The first situation is: the first row is from left to right R, G component, and the second row is from left to right G, B component, and what this situation was corresponding carries out the mode of interpolation as shown in formula (1) to first element in the lower right corner,
B=B 22,R=R 11,G=(G 12+G 21)/2;(1)
The second situation is: the first row is from left to right B, G component, and the second row is from left to right G, R component, and what this situation was corresponding carries out the mode of interpolation as shown in formula (2) to first element in the lower right corner,
G=(G 11+G 22)/2;B=B 12,R=R 21;(2)
The third situation is: the first row is from left to right G, B component, and the second row is from left to right R, G component, and what this situation was corresponding carries out the mode of interpolation as shown in formula (3) to first element in the lower right corner,
G=(G 11+G 22)/2;B=B 12,R=R 21;(3)
4th kind of situation is: the first row is from left to right G, R component, and the second row is from left to right B, G component, and what this situation was corresponding carries out the mode of interpolation as shown in formula (4) to first element in the lower right corner,
G=(G 11+G 22)/2,R=R 12,B=B 21;(4)
In above formula, B ijrepresent the B component pixel of the i-th row jth row; R ijrepresent the R component pixel of the i-th row jth row; G ijrepresent the G component pixel of the i-th row jth row, wherein the span of i and j is 1 to 2.
Step 3, extract rgb format image in R, G, B tri-road color component, by the rear color total amount obtaining each pixel of R, G, B tri-road color component addition, then respectively to R, G, B tri-road color component to move to left N position, the span of N for being generally 4 to 32, obtain by R, G, B tri-road color component expand 2 Nth power doubly after component value
Step 4: calculate component accounts for the ratio of color total amount respectively, account form as shown in formula (5),
RS = R &OverBar; / ( R + G + B ) GS = G &OverBar; ( R + G + B ) BS = B &OverBar; / ( R + G + B ) - - - ( 5 )
In formula (5), RS, GS, BS represent respectively R, G, B tri-road color component expand 2 Nth power doubly after three road color components account for the ratio of color total amount (R+G+B).
Step 5: decision threshold step one set expands the Nth power of 2 doubly, then judges three road color components account for the ratio of color total amount (R+G+B), namely the color threshold Rule of judgment after Nth power that whether RS, GS, BS of each pixel meet expansion 2 is doubly judged, if met, be then 1 by this pixel assignment, if do not met, be 0 by this pixel assignment, obtain the binary image of target affiliated area to be tracked, for the process that target following is follow-up.
Such as:
The pixel belonging to the region to be split of red objects should meet:
(RS>0.4*2 N)&(GS<0.3*2 N)&(BS<0.2*2 N);
The pixel belonging to the region to be split of blue target should meet:
(RS<0.4*2 N)&(GS>0.4*2 N)&(BS<0.2*2 N);
The pixel belonging to the region to be split of blue target should meet:
(RS<0.4*2 N)&(GS<0.3*2 N)&(BS>0.3*2 N);
This step solves a floating-point operation difficult problem in FPGA dexterously, makes to detect target at color region and reaches more accurate effect.
Beneficial effect of the present invention can be further illustrated by following emulation experiment:
Experimental Hardware platform is AlterCycloneIV chip, software platform is QuartusII, detected object as shown in Figure 5, black and white gridiron pattern with red, yellow, blue, grey colouring information is put on the ground, does the detection of red objects (being placed on the red Ipad shell in the upper left corner in figure).As shown in Figure 6, in Fig. 6, white portion is the red objects region detected after binaryzation to experimental result.Illustrate that red objects can extract by the present invention exactly, there is very high degree of accuracy.To differentiate other color target, revising the threshold decision condition of corresponding color in a program, having fully demonstrated dirigibility of the present invention.The present invention has also done the experiment of number of colors target detection, and process picture frame frequency can reach 60fps, does not occur the phenomenon of time delay in experiment, and therefore real-time performance of the present invention is remarkable.

Claims (7)

1. based on a color target detection system of FPGA, it is characterized in that, comprise Bayer signal receiving module; Bayer form interpolation turns RGB module; R, G, B tri-road color component summation module; R, G, B tri-road color component to move to left module; Dividing module; Color judges and binaryzation object module; Above-mentioned module all realizes in FPGA.
2., as claimed in claim 1 based on the color target detection system of FPGA, it is characterized in that,
After Bayer signal receiving module receives the picture signal of Bayer form, the picture signal of Bayer form is sent into Bayer form interpolation and turn RGB module;
Bayer form interpolation turns GRB module and uses interpolation algorithm the image of Bayer form to be converted to the image of rgb format, and extract the R road color component of each pixel in rgb format image, G road color component and B road color component, then by R, G, B tri-road color component send into respectively simultaneously R, G, B tri-road color component summation module and R, G, B color component to move to left module;
R, G, B tri-road color component summation module calculate R, G, B tri-total amount of road color component, then color total amount is sent to dividing module;
R, G, B color component move to left module by R, G, B tri-road color component to move to left respectively N position, the span of N between 4 to 32, obtain by R, G, B tri-road color component expand 2 Nth power doubly after three road color components, and will three road color components are sent to dividing module;
Dividing module calculates each pixel three road color components account for the ratio of color total amount separately, and are sent to by ratio color to judge and binaryzation object module.
3., based on a color target detection method of FPGA, it is characterized in that, comprise the following steps:
Step one, color according to target to be split in image, set each pixel in region to be split whether belong to this color R, G, B tri-road color component account for the decision threshold of color sum-rate;
Step 2, the image of Bayer form is converted into the image of rgb format;
Step 3, extract rgb format image in R, G, B tri-road color component, by the rear color total amount obtaining each pixel of R, G, B tri-road color component addition, then respectively to R, G, B tri-road color component to move to left N position, the span of N between 4 to 32, obtain by R, G, B tri-road color component expand 2 Nth power doubly after component value
Step 4: calculate component accounts for the ratio of color total amount respectively;
Step 5: decision threshold step one set expands the Nth power of 2 doubly, then judges the Nth power whether ratio that three road color components account for color total amount meets expansion 2 doubly after color threshold Rule of judgment, if met, be then 1 by this pixel assignment, if do not met, be 0 by this pixel assignment, obtain the binary image of target affiliated area to be tracked, for the process that target following is follow-up.
4., as claimed in claim 3 based on the color target detection method of FPGA, it is characterized in that, in step one,
When the color of target to be split is red, then judge that the threshold decision bar whether image certain pixel interior belongs to red area pixel is:
When the color of target to be split is green, then judge that the threshold decision bar whether image certain pixel interior belongs to green area pixel is:
When the color of target to be split is blue, then judge that the threshold decision bar whether image certain pixel interior belongs to blue region pixel is:
Wherein, R, G, B are respectively R, G, B tri-road color component of a certain pixel, and r, g, b are respectively the ratio that R color component, G color component or B color component account for R, G, B color total amount.
5., as claimed in claim 3 based on the color target detection method of FPGA, it is characterized in that, in step 2, use interpolation arithmetic that the image of Bayer form is converted into the image of rgb format; Wherein in Bayer format-pattern, the interpolation calculation mode of R, G, B component four kinds of array modes difference correspondences is as follows:
When the first row is from left to right R, G component, the second row is from left to right G, B component, this correspondence the mode of interpolation is carried out as shown in formula (1) to first element in the lower right corner,
B=B 22,R=R 11,G=(G 12+G 21)/2;(1)
When the first row is from left to right B, G component, the second row is from left to right G, R component, then correspondingly carry out the mode of interpolation as shown in formula (2) to first element in the lower right corner,
G=(G 11+G 22)/2;B=B 12,R=R 21;(2)
When the first row is from left to right G, B component, the second row is from left to right R, G component, then correspondingly carry out the mode of interpolation as shown in formula (3) to first element in the lower right corner,
G=(G 11+G 22)/2;B=B 12,R=R 21;(3)
When the first row is from left to right G, R component, the second row is from left to right B, G component, then correspondingly carry out the mode of interpolation as shown in formula (4) to first element in the lower right corner,
G=(G 11+G 22)/2,R=R 12,B=B 21;(4)
In above formula, B ijrepresent the B component pixel of the i-th row jth row; R ijrepresent the R component pixel of the i-th row jth row; G ijrepresent the G component pixel of the i-th row jth row, wherein the span of i and j is 1 to 2.
6., as claimed in claim 3 based on the color target detection method of FPGA, it is characterized in that, in step 4 component accounts for the account form of the ratio of color total amount respectively as shown in formula (5),
In formula (5), RS, GS, BS represent respectively R, G, B tri-road color component expand 2 Nth power doubly after three road color components account for the ratio of color total amount (R+G+B).
7., as claimed in claim 3 based on the color target detection method of FPGA, it is characterized in that, in step 5,
The pixel belonging to the region to be split of red objects should meet:
(RS>0.4*2 N)&(GS<0.3*2 N)&(BS<0.2*2 N);
The pixel belonging to the region to be split of blue target should meet:
(RS<0.4*2 N)&(GS>0.4*2 N)&(BS<0.2*2 N);
The pixel belonging to the region to be split of blue target should meet:
(RS<0.4*2 N)&(GS<0.3*2 N)&(BS>0.3*2 N)。
CN201410235952.1A 2014-05-29 2014-05-29 A kind of color target detecting system and method based on FPGA Expired - Fee Related CN105279765B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410235952.1A CN105279765B (en) 2014-05-29 2014-05-29 A kind of color target detecting system and method based on FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410235952.1A CN105279765B (en) 2014-05-29 2014-05-29 A kind of color target detecting system and method based on FPGA

Publications (2)

Publication Number Publication Date
CN105279765A true CN105279765A (en) 2016-01-27
CN105279765B CN105279765B (en) 2018-04-03

Family

ID=55148716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410235952.1A Expired - Fee Related CN105279765B (en) 2014-05-29 2014-05-29 A kind of color target detecting system and method based on FPGA

Country Status (1)

Country Link
CN (1) CN105279765B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109873954A (en) * 2018-03-30 2019-06-11 电子科技大学 One kind realizing Bayer array color restoration methods based on FPGA

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060101080A1 (en) * 2002-06-28 2006-05-11 Eiji Atsumi Information terminal
CN1964500A (en) * 2006-12-12 2007-05-16 北京中星微电子有限公司 An interpolation method and device for color filter array

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060101080A1 (en) * 2002-06-28 2006-05-11 Eiji Atsumi Information terminal
CN1964500A (en) * 2006-12-12 2007-05-16 北京中星微电子有限公司 An interpolation method and device for color filter array

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孙猛: "基于FPGA的运动目标检测系统", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109873954A (en) * 2018-03-30 2019-06-11 电子科技大学 One kind realizing Bayer array color restoration methods based on FPGA
CN109873954B (en) * 2018-03-30 2020-09-25 电子科技大学 Method for realizing color recovery of Bayer array based on FPGA

Also Published As

Publication number Publication date
CN105279765B (en) 2018-04-03

Similar Documents

Publication Publication Date Title
Huang et al. An advanced single-image visibility restoration algorithm for real-world hazy scenes
Liu et al. A method of segmenting apples at night based on color and position information
CN102509086B (en) Pedestrian object detection method based on object posture projection and multi-features fusion
CN103065334B (en) A kind of color cast detection based on hsv color space, bearing calibration and device
CN104751486A (en) Moving object relay tracing algorithm of multiple PTZ (pan/tilt/zoom) cameras
CN103077531B (en) Based on the gray scale Automatic Target Tracking method of marginal information
CN103996191B (en) A kind of detection method of black and white chessboard table images angle point based on Least-squares minimization
CN107067015B (en) Vehicle detection method and device based on multi-feature deep learning
CN103400150A (en) Method and device for road edge recognition based on mobile platform
CN104318588A (en) Multi-video-camera target tracking method based on position perception and distinguish appearance model
CN104318266B (en) A kind of image intelligent analyzes and processes method for early warning
CN105488811A (en) Depth gradient-based target tracking method and system
CN103679677A (en) Dual-model image decision fusion tracking method based on mutual updating of models
CN107133610B (en) Visual detection and counting method for traffic flow under complex road conditions
CN110751635B (en) Oral cavity detection method based on interframe difference and HSV color space
CN103281513B (en) Pedestrian recognition method in the supervisory control system of a kind of zero lap territory
CN104966285A (en) Method for detecting saliency regions
CN103500451B (en) A kind of independent floating ice extracting method for satellite data
CN104537688A (en) Moving object detecting method based on background subtraction and HOG features
CN102749034B (en) Railway switch gap offset detection method based on image processing
CN104700405A (en) Foreground detection method and system
CN102567998A (en) Head-shoulder sequence image segmentation method based on double-pattern matching and edge thinning
CN105787912A (en) Classification-based step type edge sub pixel localization method
CN104835142A (en) Vehicle queuing length detection method based on texture features
CN102510437B (en) Method for detecting background of video image based on distribution of red, green and blue (RGB) components

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180403

Termination date: 20200529

CF01 Termination of patent right due to non-payment of annual fee