Instruction FACTA UNIVERSITATIS Series: Electronics and Energetics Vol. 28, N o 2, June 2015, pp. 165 - 175 DOI: 10.2298/FUEE1502165N IMAGE AND VIDEO PROCESSING WITH FPGA SUPPORT USED FOR BIOMETRIC AS WELL AS OTHER APPLICATIONS  Andrzej Napieralski, Jakub Cłapa, Kamil Grabowski, Małgorzata Napieralska, Wojciech Sankowski, Przemysław Sękalski, Mariusz Zubert Lodz University of Technology, Department of Microelectronics and Computer Science, Lodz, Poland Abstract. Paper presents the recent research in DMCS. The image processing and biometric research projects are presented. One of the key elements is an image acquisition and processing. The most recent biometric research projects are in the area of authentication in uncooperative scenarios and utilizing many different biometric traits (multimodal biometric systems). Also, the recent research on the removal of geometric distortion from live video streams using FPGA and GPU hardware is presented together with preliminary performance results. Key words: biometrics, FPGA, video correction algorithms 1. RESEARCHES ON BIOMETRICS 1.1. Introduction Biometrics has a great potential and many fascinating applications. One can imagine airports with automatic passenger identification, where passenger does not need to show any ID document but can conveniently pass a biometric identification gate. Another huge space for biometric systems implementations are banking systems, where cash machines do not require bank customers to present credit card or enter pin number. Biometric technologies have been developed for decades. The first successful biometric system implementation was published in 1991 as a case of face recognition and in 1993 as a case of iris recognition. Even longer development has been devoted to fingerprint and hand recognition. Technical note on the first operational fingerprint matching algorithm used at the FBI (Federal Bureau of Investigation) for narrowing the human search was published in 1972, while first commercial hand geometry recognition systems became available in Received December 2, 2014 Corresponding author: Andrzej Napieralski Lodz University of Technology, Department of Microelectronics and Computer Science, ul. Wolczanska 221/223, 90-924 Lodz (e-mail: napier@dmcs.pl) 166 A. NAPIERALSKI ET AL. 1974. Nowadays, after such a huge development effort, one can ask why even the most modern societies have not widely adopted biometric solutions in everyday life. The biometric system to be widely adopted by citizens has to be easy to use, fast, inexpensive, and - what is most important - reliable. Currently none of the existing biometric technologies satisfactorily fulfils all listed conditions. Today even the most advanced solutions do not provide 100% reliability, and the error rates, although extremely low, are inevitable in a practical system. This is especially visible in large scale implementations, where the number of registered users can be counted in millions. 1.2. DMCS biometric projects overview Current practical implementations and current state of the art indicate that there is still a large space for improvements in the field of biometrics. The department of Microelectronics and Computer Science (DMCS) has been conducting researches on biometrics since 2000. The first publications [1,2] concerns the automatic people identification on the basis of iris pattern. In 2004 the first biometric project was granted to the department by the Polish State Committee for Scientific Research. The project was entitled “Persons recognition and identification based on eye biometric parameters” and was focused on iris recognition technology development. The project resulted in construction of Iris Station device and image processing algorithms (see Fig. 1), that form a fully functional prototype system for iris recognition. The experience of the team resulted in the realization of the next two projects which were a continuation of researches on iris recognition technology. These projects were entitled “Hardware acceleration of computations for biometric applications” and “Iris positive authentication system”. The three mentioned projects resulted in a complete iris recognition solution developed in the DMCS. Fig. 1. Authentication process based on iris pattern Current biometric researches in the DMCS focus on multimodal solutions, where data coming from more than one biometric feature are fused to enhance system reliability. The two projects on multimodal biometrics are currently ongoing. They are entitled “Multimodal biometric system for contactless person identification” and “Non-cooperative biometric system for positive authentication”. The first one concentrates on cooperative scenarios, Image and Video Processing with FPGA Support Used for Biometric as well as Other Applications 167 while the second one focuses on non-cooperative scenarios. The list of all projects on biometrics in DMCS (completed and ongoing) is presented in Table 1, while the details are given in the next sections. Table 1 Biometric projects in DMCS Title Acronym Signature Time frame Status Persons recognition and identification based on eye biometric parameters Iris Station 1374/T11/2004/27 17.11.2004 - 16.05.2007 Completed Hardware acceleration of computations for biometric applications BioSys K25/B.W.2/2009 1.01.2009 - 31.12.2009 Completed Iris positive authentication system IPASs K-25/2011/BW/3 1.11.2011 - 05.2013 Completed Multimodal biometric system for contactless persons identification MBS 2011/01/D/ST6/06269 08.12.2011 - 07.12.2014 In progress Non-cooperative biometric system for positive authentication COMPACT LIDER/027/591/L- 4/12/NCBR/2013 01.11.2013 - 10.2016 In progress 1.3. Iris Station project The result of this completed project is Iris Station laboratory stand developed in the DMCS Biometric Laboratory (see Fig. 2). It is a high resolution iris image acquisition system dedicated for biometric applications. This prototype system allows real-time eye tracking and registration/identification of the observed person. Fig. 2 Iris Station laboratory stand In the presented solution the dedicated system is applied, where image acquisition is performed by digital camera controlled and positioned by personal computer in the real- time. Moreover, the system includes specialized lighting system, precise positioning system of the camera with lens and lighting, optical path with image acquisition system. To minimize the impact of accelerations on precise shutter mechanism of camera and photo cameras there was applied a variable frequency control of step motors with the 168 A. NAPIERALSKI ET AL. ability to independently control motors’ movement while tracking the observed object. A multi-channel control of lighting block allows a variety of lighting conditions, including the ability to acquire iris images with different lighting conditions during a single session. The system contains a dedicated support allowing proper and comfortable head placing towards the acquisition system. The system’s operation may be summarized in the following steps: a) software installed on the working station acquires an image from the camera; b) it localizes the iris in the image and verifies if the iris region is focused; c) the focus is corrected if necessary; d) the acquired high resolution iris image is further processed to recognize the person’s identity. Experimental results obtained in the project are presented in [3-5, 9-11]. 1.4. BioSys project A biometric security system needs to process computationally intensive tasks of authentication flow, such as quality assessment, segmentation and analysis, protocols, and database scanning. This flow contains two broad areas of computing: mathematical calculations (typical for DSP systems) and data manipulation and testing (typical for standard processor architectures). Even though such systems require a fair amount of signal processing, typical personal computers (PCs) are still widely used for this purpose with software that is responsible for data processing. Moreover, although current commercially available systems use images that originate from relatively simple vision systems, these systems will have to handle more information and increased processing in the near future because recently a significant effort has been focused on authenticating objects at-a-distance and on-the-move using the iris trait. Fig. 3 Hardware implementation architecture of biometric algorithms The main motivation for this work was to develop a hardware system for iris identification as a positive biometric system that is able to implement contextual and non-contextual filtering, image segmentation, pattern calculation, and testing within a template’s repository. An additional requirement for the device was to impose certain processing time limits, which is important in high-throughput biometric authentication or when preprocessing. Biometric sample quality assessment has to be conducted using a video signal with a certain frame rate. Thus, the described solution introduces a specialized hardware-based architecture (see Fig. Image and Video Processing with FPGA Support Used for Biometric as well as Other Applications 169 3) that can take advantage of the inherent parallelism of FPGAs and their embedded processors as well as the contextual filtering of DSPs. Additionally, DSP reconfiguration and multicore processing techniques used for even more efficient data processing have been tested [6]. The developed system, called BioServer, is presented in Fig. 4. Fig. 4 The BioServer device 1.5. IPASs project The main aim of the project was to design a simple, low-cost device able to realize iris positive authentication within DMCS employees that can be practically implemented in B18 building on TUL campus. The scientific goal of the project is to design a less- cooperative iris-based biometric authentication system as well as methods and devices for acquisition of images with sufficient content of distinctive features. One of the key problems was to enable the automatic identification of people that were previously registered by the system on the basis of observation carried out by the low-cost vision system. Although there are known solutions for positive biometric authentication (identification or verification) available at the commercial market, there is still place for innovations in the field of automated biometric recognition using iris pattern, especially when cooperation between a subject and system is taken under consideration. Such systems need to deal with highly unconstrained imaging conditions, such as: exposition, wavelength of illumination, ambient light reflections from the eye’s surface, perspective fluctuations, as well as cheat attempts, etc. 1.6. MBS project The scientific goal of the project is to develop a multimodal biometric system for contactless persons identification working based on the following physical and behavioral features (biometrics): 1. Iris pattern 2. Face geometry 3. Hand geometry 170 A. NAPIERALSKI ET AL. In the constructed system iris pattern features unique for each individual are derived from the analysis of the iris structure image taken under NIR (Near Infrared) light. Unique face features are computed by analyzing two data sources acquired simultaneously: face image taken under visible light and face geometry acquired using 3D scanner. Unique hand features are extracted by analyzing the 3D scan of hand. The multimodal biometric database is collected using the Iris Station laboratory stand (iris) and the MBS laboratory stand (face and hand). The MBS laboratory stand is presented in Fig. 5. It is built based on two structured light 3D scanning devices manufactured by the SmartTech company. It allows two modes of operation: fast and precise. The precise mode is intended for scanners calibration (setting up common coordinate system based on template of known geometry presented to both devices), while the fast mode is dedicated for face and hand samples acquisition. The preliminary experimental results obtained in the project are presented in [7, 8]. Fig. 5 MBS laboratory stand (left) and the structured light scanning device (right) 1.7. COMPACT project Automatic identification of people at-a-distance and on-the-move is one of the most explored areas of biometrics nowadays. This problem is dealt with by the COMPACT project where the recognition process is done using specialized vision systems under unconstrained imaging conditions, at a distance and on the move. One of the key assumptions is to realize a system able to acquire biometric samples with the level of cooperation lower than in the case of the Iris-On-The-Move technology. It is assumed that the authorized subject should be inside an area around the system rather than the straight path like in the IOM. The other system feature is the high throughput of the system, understood as a number of persons that could be successfully authorized per time interval – not less than in IOM technology, i.e., 30 persons per minute. Using the modern FPGA or/and multicore DSP technology, it may be possible to recognize several subjects at the same time increasing significantly the throughput of the system. The scientific goal of the project is to design a non-cooperative, high-throughput biometric positive authentication system based on features fusion of iris pattern, periocular and face image, as well as methods and devices for acquisition of such images with sufficient content of distinctive features. The authentication process (see Fig. 1) is planned to be mainly based on iris pattern and to be supported by a face trait, since iris pattern achieves the best biometric efficiency (lowest error rates). However, the key problem for iris-based Image and Video Processing with FPGA Support Used for Biometric as well as Other Applications 171 biometric system design is the image acquisition issue. The acquisition of good quality image of an object of 1,2cm 2 area from the subject at-a-distance and on-the-move is the most challenging task in the whole authorization process. Thus, multibiometrics is the tool that allows for fusion of other features that could have been captured during acquisition process. In the case of iris-based systems this can be periocular region: eyebrows and skin texture and color. 2. IMPLEMENTATION AND DEVELOPMENT OF FISHEYE DISTORTION CORRECTION ALGORITHMS 2.1. Background Nowadays, the majority of camera systems have a field of view of about 60 degrees (FOV<60 deg). However, there is a wide market for fisheye lens based and wide angle lens based cameras i.e. GoPro Hero. These cameras provide larger FOVs thanks to specially designed wide angle or fisheye lenses that project much bigger part of the scene onto the image sensor. On the one hand, this type of cameras are used as a toy, but it is worth mentioning that this increase in the field of view is extremely useful in a number of applications ranging from laparoscopic surgery, through rear-view cameras in cars to closed circuit television (CCTV) systems [12], [13]. The increase in the FOV brings geometric distortions, which make straight lines from the scene to appear as curves in the image plane. In the one hand this ‘artistic’ transformation is accepted when we use a sport camera to record our achievements, but in many applications it is not desired and causes problems for proper interpretation of the scene. Our team focuses on research and implementation of novel, on-the-fly algorithms for correcting geometrical distortions in video streams on different systems starting from regular PCs, through mobile devices ending on DSPs and FPGAs. 2.2. The algorithm The equations for geometrical distortion are well documented and they are as old as cartography. The concept of the algorithm is how to project the sphere on a planar surface. This may be happen only using the trigonometric functions as it is presented below [14]. Fig. 6 Set of equations to project the sphere on the planar surface [16] 172 A. NAPIERALSKI ET AL. Hence, the algorithm is well known, but there are always problems with hardware implementations of the above set of equations. For a single image there is a plenty of time to make all the calculations and present the final corrected image. The problem arises when we would like to deal with the high-resolution video at frame rate of i.e. 30 frames per second. Then the power needed to make such a calculation is rising proportionally to the number of frames. One of the biggest problems is the algorithm itself and the fact that it uses trigonometric functions. If we make a brief calculation for a HD video we need to make approximately 1920px * 1080px * 30 frames = 62 million trigonometric calculations per second. In principle, the following calculation for each pixel has to be done. Fig. 7 Block diagram of geometrical correction system As can be seen on the block diagram in Fig. 7, there is a need to read and write single pixels to memory. Using conventional techniques we need to access external memory index by index in the way given as a result of trigonometric calculation. Thus, the access time to memory cell plays the major role. We can use faster memories like DDR5 or even on-chip SRAM (cache), but it is an expensive solution. 2.3 Sample implementation In the first attempt, we built a system based on Xilinx Spartan VI FPGA chip and the APTINA MT9P031 image sensor equipped with fisheye lens. The photo of the system is presented below. Fig. 8 Photo of the real system Image and Video Processing with FPGA Support Used for Biometric as well as Other Applications 173 The internal structure of the image sensor is presented below. One can see that the resolution of camera is 5 megapixels, thus even higher than the HD image described above. Fig. 9 Image sensor MT9P031 internal architecture [from Aptina documentation] We designed and then implemented the correction algorithm [15], [16]. The internal block architecture is presented below. The system contains four main parts:  The front-end frame grabber which acquires the image data from sensor and forms information about the pixels for further processing,  The demosaicer which recalculates the Bayer subpixels and forms RGB pixels,  The datamover state machine which is responsible for running the correction algorithm and performing the transfer of pixels from the input image to the output buffer,  The AXI datamover which is used to store pixel data in RAM memory through AXI bus. Fig. 10 Correction system internal architecture [7] The main performance limit of the above structure is the memory access time. The current research is focused on this issue. 2.4 Results As it was described in [15], currently we are able to deal with 3-4 frames per second with HD resolution (720p). The current research is conducted to increase the number of frames which can be processed simultaneously. Meantime, we developed OpenGL shader programs, which allowed us to build a web-based tool for image and video correction 174 A. NAPIERALSKI ET AL. which can be accessed online. Using powerful machines equipped with high-performance graphic cards, we can deal with medium-resolution video sequences. However, we are looking for more efficient algorithms which can be used with cheaper devices. Moreover, we designed the implementation of geometrical distortion algorithm for Android OS. The preliminary results show that we can process 2-3 frames per second with HD resolution using one core of a mobile ARM CPU. When we decrease the resolution we can deal with a higher frame rate. Fig. 11 Snapshot of web-based implementation of fisheye lens geometrical correction algorithm A sample screenshot from the web-based application is presented in Fig. 11 below. On the left panel the fisheye image is presented. The yellow dots show the image being processed. The right panel presents the corrected image using our implementation of the algorithm. 2.5. Summary The correction of geometrical distortion is a very old problem, which was not solved efficiently until now. The algorithms base on trigonometric functions, thus it consumes a substantial time and energy to make the computation. During the image/video processing there is a need to have access to random indices in the memory so the burst mode of modern memory systems cannot be used to accelerate pixel read and/or write. The current research of our team is focused on better understanding and finding the regularity in image pixel indexing. Intellectual property rights protect the main parts of the presented solution, therefore they were not presented in this paper in details. Acknowledgement: The researches presented in the paper were supported by:  funds from the State Committee for Scientific Research granted on the basis of the decision number 1374/T11/2004/27,  funds from the DMCS department granted on the basis of the decision number K25/B.W.2/2009 and K-25/2011/BW/3, Image and Video Processing with FPGA Support Used for Biometric as well as Other Applications 175  funds from the National Science Centre granted on the basis of the decision number DEC- 2011/01/D/ST6/06269,  funds from the National Centre for Research and Development granted on the basis of the decision number LIDER/027/591/L-4/12/NCBR/2013,  funds from the National Centre for Research and Development (grant number LIDER/30/110/L- 3/11/NCBR/2012). REFERENCES [1] P. Jabłoński, R. Szewczyk, Z. Kulesza, A. Napieralski, M. Moreno, J. Cabestany, "Automatic people identification on the basis of iris pattern – image processing and preliminary analysis", In Proceedings of the 23rd International Conference on Microelectronics, Niš, Yugoslavia, 12-15 May 2002, vol. 2, pp. 687–690. [2] R. Szewczyk, P. Jabłoński, Z. Kulesza, A. Napieralski, M. Moreno, J. Cabestany, "Automatic people identification on the basis of iris pattern -extraction features and classification", In Proceedings of the 23rd International Conference on Microelectronics, Niš, Yugoslavia, 12-15 May 2002, vol. 2, pp. 691–694. [3] K. Grabowski, W. Sankowski, M. Napieralska, M. Zubert, A. Napieralski, "Iris Recognition Algorithm Optimized for Hardware Implementation," 2006 IEEE Symposium on Computational Intelligence and Bioinformatics and Computational Biology, 2006. CIBCB '06., 28-29 Sept. 2006, pp.1–5. [4] K. Grabowski, W. Sankowski, M. Zubert, M. Napieralska, "Reliable Iris Localization Method With Application To Iris Recognition In Near Infrared Light", In Proceedings of the International Conference Mixed Design of Integrated Circuits and System, MIXDES 2006, 22-24 June 2006, pp. 684–687. [5] K. Grabowski, M. Zubert, M. Napieralska, A. Napieralski, "Uncertainty in iris recognition based on texture analysis," In Proceedings of the 17th International Conference Mixed Design of Integrated Circuits and Systems,MIXDES 2010, 24-26 June 2010, pp.587–592. [6] K. Grabowski, A. Napieralski, "Hardware Architecture Optimized for Iris Recognition”, IEEE Transactions on Circuits and Systems for Video Technology, vol. 21, Issue 9, pp. 1293–1303, September 2011. [7] J.A Napieralski, M.M. Pastuszka, W. Sankowski, "3D face geometry analysis for biometric identification," In Proceedings of the 21st International Conference Mixed Design of Integrated Circuits & Systems, MIXDES 2014, 19-21 June 2014, pp. 519–522. [8] P. Nowak, "A comparative study on biometric hand identification," In Proceedings of the 21st International Conference Mixed Design of Integrated Circuits & Systems, MIXDES 2014, 19-21 June 2014, pp. 411–414. [9] W. Sankowski, K. Grabowski, M. Napieralska, M. Zubert, "Eyelids Localization Method Designed for Iris Recognition System," In Proceedings of the 14th International Conference on Mixed Design of Integrated Circuits and Systems, MIXDES 2007, 21-23 June 2007, pp.622–627. [10] W. Sankowski, K. Grabowski, J. Pietek, M. Napieralska, M. Zubert, "Optimization of iris image segmentation algorithm for real time applications," In Proceedings of the 16th International Conference Mixed Design of Integrated Circuits & Systems, MIXDES 2009, 25-27 June 2009, pp. 671–674. [11] W. Sankowski, K. Grabowski, M. Napieralska, M. Zubert, A. Napieralski, "Reliable algorithm for iris segmentation in eye image". Image and Vision Computing, vol. 28, no. 2, pp. 231–237, 2010. [12] C. Hughes, M. Glavin, E. Jones, P. Denny, "Wide-angle camera technology for automotive applications: a review", IET Intelligent Transport Systems, vol. 3, no. 1, pp. 19–31, 2009. [13] L. Meinel, M. Findeisen, M. Hes, A. Apitzsch, and G. Hirtz, "Automated real-time surveillance for ambient assisted living using an omnidirectional camera", in Proceedings of the IEEE International Conference on Consumer Electronics, ICCE 2014, pp. 396–399. [14] R. Andraka, A survey of CORDIC algorithms for FPGA based computers, FPGA'98, Monterey, California, USA, Association for Computing Machinery,1998 [15] M. Michalak, P. Sekalski, K. Grabowski, S. Izydorczyk, "Fast FPGA-based Frame Grabber for Digital Progressive Scan Image Sensors", In Proceedings of the 21st International Conference Mixed Design of Integrated Circuits & Systems, MIXDES 2014, 19-21 June 2014. [16] J. Cłapa, H. Błasinski, K. Grabowski, P. Sekalski, "A Fisheye Distortion Correction Algorithm Optimized for Hardware Implementations", In Proceedings of the 21st International Conference Mixed Design of Integrated Circuits & Systems, MIXDES 2014, 19-21 June 2014.