• No results found

Shift Frame n

7.1 Future work

Although a significant reduction of the application’s execution time was achieved with the set of optimizations presented in this work, this is by no means the best result that can be obtained. On the contrary, this set of optimizations open new possibilities for improving the application’s performance, for example, by applying similar approaches to other parts of the application. The first idea that comes to mind is to extend the use of NEON technology to other parts of the program that exhibit a high number of independent data calculations. The 5 × 5 filter involved in the calculation of the texture 1 frame, together with the sum of columns and the row shifting operations included in the GMC stage, are good candidates to implement using NEON assembly instructions.

Note, however, that further optimizing parts of the program that comprise a small percentage of the total execution time will not yield significant improvements to the overall application’s performance. This implies that an assessment of the distribution of the total execution time among the different tasks of the application is necessary to determine which parts are the current bottlenecks and hence worth optimizing. The last profiling of the application (bottom bar in Figure 6.3) reveals that a large fraction of the execution time is spent in three stages, namely decoding, calibration, and hole filling.

Whereas the decoding stage was analyzed and partly optimized in this work, the latter two were not considered for optimization.

According to several observations, there is a high probability that the calibration stage can be optimized in an important manner. First, note the significant increase of the execution time of this particular stage between the top and bottom profilings in Figure 6.1. Whereas such increase of time is expected on stages that involve matrix operations (MATLAB usually performs well with this kind of operations), stages based on control structures, such as the nested for loops present in the calibration stage, are not expected to show a decrease of performance in this manner. Moreover, note how the first two optimizations in Figure 6.3, i.e. changing the data type from double to float and tuning

the compiler flags, had a significant impact on this stage’s performance. Considering these series of observations, it is very probable that the current C implementation of this stage is not utilizing the available resources of the Beagleboard-xM in the best possible manner. Analyzing how well this part of the program is exploiting spatial and temporal locality, could reveal directions for further optimizations.

Finally, it is worth noting a few more ideas of how the performance of the application could still be improved. Tuning GCC’s compiler flags was performed early in the overall optimization process. It is probable that the combination of flags found to be optimal in that moment, is not anymore for the current state of the application. Therefore, a new assessment of compiler flags should be performed. It is also important to mention that there is a specific compiler flag, namely -mfloat-abi, that specifies which floating-point application binary interface (ABI) to use. The permissible values are soft, softfp and hard. Despite the fact that a hard-float ABI is expected to produce better performance results, the use of such configuration was not possible in the current project. The reason is that part of the libraries provided by the underlying operating system where compiled with soft-float ABI, and these two ABI’s are not link-compatible. Nevertheless, enabling this configuration is just a matter of recompiling the OS and the other libraries that are used by the application with hard-float ABI support. Finally, it should be noted that there are a wide range of compilers available on the market that could produce better results than those of GCC. Despite the fact that as part of the current project a few of the other options were tested, GCC’s results were always superior. However, it would be interesting to measure how the GCC compiler compares with the compilers produced by ARM, which are known to produce fast running code.

[1] F. J. Nieto, T. B. Young, B. K. Lind, E. Shahar, J. M. Samet, S. Redline, R. B.

D’Agostino, A. B. Newman, M. D. Lebowitz, T. G. Pickering, et al., “Association of sleep-disordered breathing, sleep apnea, and hypertension in a large community-based study,” JAMA: the journal of the American Medical Association, vol. 283, no. 14, pp. 1829–1836, 2000. [Online]. Available: http://jama.ama- assn.org/

content/283/14/1829.short (cit. on p. 1).

[2] J. Bruysters, “Large dutch sleep survey reveals that 4 out of 5 people suffering from sleep apnea are unaware of it,” University of Twente, Tech. Rep., Mar. 2013.

[Online]. Available: http : / / www . utwente . nl / en / archive / 2013 / 03 / large _ dutch_sleep_survey_reveals_that_4_out_of_5_people_suffering_from_

sleep_apnea_are_unaware_of_it.docx/ (cit. on p. 1).

[3] S. Garrigue, P. Bordier, S. S. Barold, and J. Clementy, “Sleep apnea,” Pacing and clinical electrophysiology, vol. 27, no. 2, pp. 204–211, 2004. [Online]. Available:

http://onlinelibrary.wiley.com/doi/10.1111/j.1540-8159.2004.00411.

x/full (cit. on p. 1).

[4] R. Klette, K. Schluns, and A. Koschan, Computer Vision: Three-Dimensional Data from Images. Springer, 1998, isbn: 9789813083714. [Online]. Available: http://

books.google.nl/books?id=qOJRAAAAMAAJ (cit. on pp. 5, 6, 9, 10).

[5] J. Posdamer and M. Altschuler, “Surface measurement by space-encoded projected beam systems,” Computer Graphics and Image Processing, vol. 18, no. 1, pp. 1 –17, 1982, issn: 0146-664X. doi: 10.1016/0146-664X(82)90096-X. [Online]. Available:

http : / / www . sciencedirect . com / science / article / pii / 0146664X8290096X (cit. on pp. 5, 9, 11).

[6] M. Rocque, “3D map creation using the structured light technique for obstacle avoidance,” Master’s thesis, Eindhoven University of Technology, Den Dolech 2 - 5612 AZ Eindhoven - The Netherlands, 2011. [Online]. Available: http : / / alexandria.tue.nl/extra1/afstversl/wsk-i/rocque2011.pdf (cit. on pp. 6, 34).

71

[7] S. Inokuchi, K. Sato, and F. Matsuda, “Range imaging system for 3-D object recognition,” in International Conference on Pattern Recognition, 1984 (cit. on pp. 9, 11).

[8] M. Minou, T. Kanade, and T. Sakai, “A method of time-coded parallel planes of light for depth measurement,” Trans. Institute of Electronics and Communication Engineers of Japan, vol. E64, no. 8, pp. 521–528, Aug. 1981 (cit. on pp. 9, 11).

[9] M. Maruyama and S. Abe, “Range sensing by projecting multiple slits with random cuts,” Pattern Analysis and Machine Intelligence, IEEE Transactions on, vol. 15, no. 6, pp. 647 –651, Jun. 1993, issn: 0162-8828. doi: 10.1109/34.216735 (cit. on pp. 9, 11).

[10] N. Durdle, J. Thayyoor, and V. Raso, “An improved structured light technique for surface reconstruction of the human trunk,” in Electrical and Computer Engi-neering, 1998. IEEE Canadian Conference on, vol. 2, May 1998, 874 –877 vol.2.

doi: 10.1109/CCECE.1998.685637 (cit. on pp. 9, 11).

[11] M. Ito and A. Ishii, “A three-level checkerboard pattern (TCP) projection method for curved surface measurement,” Pattern Recognition, vol. 28, no. 1, pp. 27 –40, 1995, issn: 0031-3203. doi: 10.1016/0031-3203(94)E0047-O. [Online]. Available:

http : / / www . sciencedirect . com / science / article / pii / 0031320394E0047O (cit. on pp. 9, 11).

[12] K. L. Boyer and A. C. Kak, “Color-encoded structured light for rapid active ranging,” Pattern Analysis and Machine Intelligence, IEEE Transactions on, vol.

PAMI-9, no. 1, pp. 14 –28, Jan. 1987, issn: 0162-8828. doi: 10.1109/TPAMI.1987.

4767869 (cit. on pp. 9, 11).

[13] C.-S. Chen, Y.-P. Hung, C.-C. Chiang, and J.-L. Wu, “Range data acquisition using color structured lighting and stereo vision,” Image Vision Comput., pp. 445–456, 1997 (cit. on pp. 9, 11).

[14] P. M. Griffin, L. S. Narasimhan, and S. R. Yee, “Generation of uniquely encoded light patterns for range data acquisition,” Pattern Recognition, vol. 25, no. 6, pp. 609 –616, 1992, issn: 0031-3203. doi: 10 . 1016 / 0031 - 3203(92 ) 90078 - W.

[Online]. Available: http://www.sciencedirect.com/science/article/pii/

003132039290078W (cit. on pp. 9, 12).

[15] B. Carrihill and R. Hummel, “Experiments with the intensity ratio depth sensor,”

Computer Vision, Graphics, and Image Processing, vol. 32, no. 3, pp. 337 –358, 1985, issn: 0734-189X. doi: 10.1016/0734-189X(85)90056-8. [Online]. Available:

http : / / www . sciencedirect . com / science / article / pii / 0734189X85900568 (cit. on pp. 9, 12).

[16] J. Tajima and M. Iwakawa, “3-D data acquisition by rainbow range finder,” in Pattern Recognition, 1990. Proceedings., 10th International Conference on, vol. i, Jun. 1990, 309 –313 vol.1. doi: 10.1109/ICPR.1990.118121 (cit. on pp. 9, 12).

[17] C. Wust and D. Capson, “Surface profile measurement using color fringe projec-tion,” English, Machine Vision and Applications, vol. 4, pp. 193–203, 3 1991, issn:

0932-8092. doi: 10.1007/BF01230201. [Online]. Available: http://dx.doi.org/

10.1007/BF01230201 (cit. on pp. 9, 12).

[18] E. Hall, J. Tio, C. McPherson, and F. Sadjadi, “Measuring curved surfaces for robot vision,” Computer, vol. 15, no. 12, pp. 42 –54, Dec. 1982, issn: 0018-9162.

doi: 10.1109/MC.1982.1653915 (cit. on pp. 10, 14).

[19] J. Salvi, J. Pags, and J. Batlle, “Pattern codification strategies in structured light systems,” Pattern Recognition, vol. 37, pp. 827–849, 2004 (cit. on pp. 11, 12).

[20] A. Woodward, D. An, G. Gimel’farb, and P. Delmas, “A comparison of three 3-D facial reconstruction approaches,” in Multimedia and Expo, 2006 IEEE Interna-tional Conference on, Jul. 2006, pp. 2057 –2060. doi: 10.1109/ICME.2006.262619 (cit. on p. 12).

[21] D. An, A. Woodward, P. Delmas, G. Gimelfarb, and J. Morris, “Comparison of active structure lighting mono and stereo camera systems: application to 3D face acquisition,” in Computer Science, 2006. ENC ’06. Seventh Mexican International Conference on, Sep. 2006, pp. 135 –141. doi: 10.1109/ENC.2006.8 (cit. on pp. 12, 13).

[22] A. Woodward, D. An, P. Delmas, and C.-Y. Chen, “Comparison of structured lightning techniques with a view for facial reconstruction,” in Proc. Image and Vision Computing New Zealand Conf., Dunedin, New Zealand, 2005, pp. 195–200.

[Online]. Available: http://pixel.otago.ac.nz/ipapers/35.pdf (cit. on p. 13).

[23] P. Fechteler, P. Eisert, and J. Rurainsky, “Fast and high resolution 3D face scan-ning,” in Image Processing, 2007. ICIP 2007. IEEE International Conference on, vol. 3, Oct. 2007, pp. III –81 III –84–. doi: 10.1109/ICIP.2007.4379251 (cit. on p. 13).

[24] J. Salvi, X. Armangu, and J. Batlle, “A comparative review of camera calibrating methods with accuracy evaluation,” Pattern Recognition, vol. 35, no. 7, pp. 1617 –1635, 2002, issn: 0031-3203. doi: 10 . 1016 / S0031 - 3203(01 ) 00126 - 1. [On-line]. Available: http : / / www . sciencedirect . com / science / article / pii / S0031320301001261 (cit. on p. 14).

[25] H. J. Chen, J. Zhang, D. J. Lv, and J. Fang, “3-D shape measurement by composite pattern projection and hybrid processing,” Optics Express, vol. 15, p. 12 318, 2007.

doi: 10.1364/OE.15.012318 (cit. on p. 14).

[26] O. D. Faugeras and G. Toscani, “The calibration problem for stereo,” in Proceed-ings, CVPR ’86 (IEEE Computer Society Conference on Computer Vision and Pattern Recognition, Miami Beach, FL, June 22–26, 1986), ser. IEEE Publ.86CH2290-5, IEEE, 1986, pp. 15–20 (cit. on p. 14).

[27] G. Toscani, Systemes de calibration et perception du mouvement en vision ar-tificielle. Institut de recherche ne informatique et en automatique, 1987, isbn:

9782726105726. [Online]. Available: http : / / books . google . nl / books ? id = Rrz5OwAACAAJ (cit. on p. 14).

[28] J. Mas and I. i. A. Universitat de Girona. Departament d’Electr`onica, An Approach to Coded Structured Light to Obtain Three Dimensional Information[, ser. Tesis doctorals / Universitat de Girona. Universitat de Girona, 1998, isbn: 9788495138118.

[Online]. Available: http://books.google.nl/books?id=mmM5twAACAAJ (cit. on p. 15).

[29] R. Tsai, “A versatile camera calibration technique for high-accuracy 3D machine vision metrology using off-the-shelf tv cameras and lenses,” Robotics and Automa-tion, IEEE Journal of, vol. 3, no. 4, pp. 323–344, Aug. 1987, issn: 0882-4967. doi:

10.1109/JRA.1987.1087109. [Online]. Available: http://dx.doi.org/10.1109/

JRA.1987.1087109 (cit. on p. 15).

[30] J. Weng, P. Cohen, and M. Herniou, “Camera calibration with distortion mod-els and accuracy evaluation,” Pattern Analysis and Machine Intelligence, IEEE Transactions on, vol. 14, no. 10, pp. 965 –980, Oct. 1992, issn: 0162-8828. doi:

10.1109/34.159901 (cit. on p. 15).

[31] P. Redert, “Multi-viewpoint systems for 3-D visual communication,” Master’s the-sis, Delft University of Technology, Stevinweg 1 - 2628 CN Delft - The Netherlands, 2000 (cit. on pp. 15, 26).

[32] M. Woo, J. Neider, T. Davis, and D. Shreiner, OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.2, 3rd. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc., 1999, isbn: 0201604582 (cit. on p. 25).

[33] L. P. Chew, “Constrained Delaunay triangulations,” Algorithmica, vol. 4, no. 1-4, pp. 97–108, 1989. [Online]. Available: http://link.springer.com/article/10.

1007/BF01553881 (cit. on pp. 25, 26).

[34] M. Desbrun, M. Meyer, P. Schr¨oder, and A. H. Barr, “Implicit fairing of irregu-lar meshes using diffusion and curvature flow,” in Proceedings of the 26th annual conference on Computer graphics and interactive techniques, ser. SIGGRAPH ’99, New York, NY, USA: ACM Press/Addison-Wesley Publishing Co., 1999, pp. 317–

324, isbn: 0-201-48560-5. doi: 10 . 1145 / 311535 . 311576. [Online]. Available:

http://dx.doi.org/10.1145/311535.311576 (cit. on p. 30).

[35] F. Vahid, Embedded System Design: A Unified Hardware/Software Introduction.

Wiley India Pvt. Limited, 2006, isbn: 9788126508372. [Online]. Available: http:

//books.google.nl/books?id=HloqCOqcHvoC (cit. on p. 31).

[36] S. Dhadiwal Baid, “Single-board computers for embedded applications,” Electron-ics For You, Tech. Rep., 2010. [Online]. Available: http://www.efymagonline.

com/pdf/single-board-computers_aug10.pdf (cit. on p. 32).

[37] M. Roa Villescas, “Thesis preparation,” Eindhoven University of Technology, Tech.

Rep., Jan. 2013 (cit. on p. 32).

[38] G. Coley, “Beagleboard system reference manual,” BeagleBoard. org, December, p. 81, 2009 (cit. on p. 34).

[39] V. G. Reddy, “NEON technology introduction,” ARM Corporation, 2008 (cit. on p. 34).

[40] M Barberis and L Semeria, “How-to: MATLAB-to-C translation,” Catalytic, Tech.

Rep., 2008 (cit. on p. 38).

[41] W. Von Hagen, The definitive guide to GCC. Apress, 2006 (cit. on p. 45).

[42] I. Stephenson, Production rendering: design and implementation. Springer, 2005 (cit. on p. 46).

[43] G. Bradski and A. Kaehler, Learning OpenCV: Computer vision with the OpenCV library. O’reilly, 2008 (cit. on p. 50).

[44] S. Rippa, “Minimal roughness property of the Delaunay triangulation,” Computer Aided Geometric Design, vol. 7, no. 6, pp. 489–497, 1990. [Online]. Available:

http : / / www . sciencedirect . com / science / article / pii / 016783969090011F (cit. on p. 51).

[45] ARM, “Cortex-a series version 3.0 programmer’s guide,” Tech. Rep., 2012 (cit. on p. 54).

[46] N. Pipenbrinck, “ARM NEON optimization. an example,” Tech. Rep., 2009 (cit.

on p. 54).