Grafik İşlemci Birimi Üzerinde Genel Amaçlı Hesaplama Yöntemi İle Görüntülerin Gerçek Zamanlı Ortorektifikasyonu

thumbnail.default.alt
Tarih
2016-04-01
Yazarlar
Şahin, Hakan
Süreli Yayın başlığı
Süreli Yayın ISSN
Cilt Başlığı
Yayınevi
Fen Bilimleri Enstitüsü
Institute of Science And Technology
Özet
Bilgisayarların grafik kartları üzerindeki grafik işlemci birimleri (Graphic Processing Units – GPU) on sene öncesine göre, özellikle performans ve yeteneklerinin artışı doğrultusunda büyük gelişme göstermiştir. Modern GPU’lar sadece çok güçlü grafik motoru olmaktan çıkarak, bilgisayar işlemcilerine (Central Processing Unit-CPU) göre aritmetik işlem yapabilme hızı ve hafıza band genişliği hızı çok daha yüksek olan ve üst seviyede paralel programlanabilir işlemciler halini almışlardır. GPU’ların programlanabilirliğindeki ve yeteneklerindeki hızlı gelişme, yüksek seviyede hesap yapma ihtiyacı olan karmaşık problemlerle uğraşan araştırmacıların ilgisini çekmiştir. Bu ilgi “grafik işlemci birimi üzerinde genel amaçlı hesaplama (General Purpose Computation on Graphic Processing Units - GPGPU)” ve “akış işleme (stream processing)” kavramlarını ortaya çıkarmıştır. Grafik işlemcilerin bilgisayar işlemcilerine bir alternatif olarak gündeme gelmesinin asıl nedeni ise; çok güçlü ve bunun yanında ucuz temin edilebilir donanım olmalarıdır. Bu grafik çipler, sabit uygulama donanımları olmaktan çıkarak günümüzde modern, güçlü ve programlanabilir genel ihtiyaçları karşılayabilecek işlemcilere dönüşmüşlerdir.  Özellikle son yıllarda grafik işlemci birimlerinin genel amaçlı hesaplamalarda da kullanılabileceği olgusu, araştırmacılar ve geliştirmecileri bu noktaya yöneltmiştir. Buradaki en büyük problem, grafik işlemci birimlerinin mevcut programlama yöntemlerinden farklı bir programlama modelini kullanıyor olmasıdır. Bu nedenle etkili bir GPU programlama, mevcut program algoritmasının, donanımın yapısını ve sınırlamalarını da dikkate alan grafik terimlerini kullanarak tekrardan yazılmasını gerektirmektedir. Halen çok çekirdekli işlemcilerin programlanabilmesi, geleneksel programlama yöntemleriyle gerçekleştirilememektedir. Tipik olay yordamlı programlama yönteminin birden fazla çekirdekli işlemcilerin programlanması için kullanılması mümkün olamamaktadır. GPU’lar aynı hesaplama işlem adımının birçok veri elemanına, özellikle yüksek aritmetik doğrulukla uygulanmasının gerektiği durumlarda çok etkili ve hızlı sonuçlar ortaya koymaktadırlar. Böylelikle yapılan hesaplama işleminin daha hızlı ve doğru olması sağlanmaktadır. Bilgisayar CPU’ları bir akış kontrolü içerisinde ve belli bir sıra ile her seferinde sadece tek bir hesaplama yaptıkları için GPU’lar ile kıyaslandığında daha yavaş işlem yapmaktadırlar. Bu yapı bilgisayar teknolojisinin kullanıldığı çok çeşitli uygulamalar için değerlendirilebilmektedir. Çeşitli platformlardan elde edilen görüntülerden harita üretimi ve özellikle görüntü değerlendirme sonuçlarının hızla elde edilmesi gereken felaketler ve doğal afetler gibi kriz durumları, askeri açıdan hedef istihbaratı, hızlı bir biçimde hedef konumunun tespiti gibi işlemleri yapmadan önce yapılması gereken en önemli işlem adımı; görüntülerin ortorektifikasyonudur. Özellikle insansız hava araçlarından çok hızlı olarak hedef tespit edebilmek ve bu hedefleri de doğru koordinatlarla belirleyebilmek için elde edilen görüntülerin ortorektifiye edilmesi ihtiyacı bulunmaktadır. Sayısal hava kameraları ve insansız hava araçları gibi çeşitli sensör ve platformlardan elde edilen görüntülerin boyutları oldukça yüksektir. Haliyle bu görüntülerin ortorektifikasyonu için çok güçlü bilgisayarlara ihtiyaç vardır. Yapılan çeşitli çalışmalar incelendiğinde görüntülerin anlık georektifikasyonu için çok sayıda güçlü donanıma sahip bilgisayarın kullanıldığı görülmektedir. Bu türden sistemlerin normal uçak platformları için oluşturulabileceği, maliyet göz önüne alınmazsa mümkün olabilir.  Fakat insansız hava araçları gibi yapı itibariyle normal uçaklardan çok daha küçük olan ve görüntü alımı gerçekleştirerek çok hızlı ve doğru sonuç elde edilmesi gereken platformlarda ise böyle çoklu bilgisayar sistemlerinin kurulabilmesi pek olanaklı değildir. Aynı zamanda bu sistemlerde platform üzerindeki kamera, navigasyon sistemi gibi faydalı yük olarak ifade edilen donanımın hafif olması da önemlidir. Mevcut sayısal hava kameraları ve insansız hava araçlarındaki görüntüleme sistemlerinin üzerinde GPS-IMU (Global Positioning System-Inertial Measurement Unit) sistemi vardır. Haliyle kamera sistemi ile senkronize olarak yapılan ölçümler ve kamera kalibrasyon değerleri ile doğrudan ortorektifikasyon yapılabilir. İşte bu doğrudan ortorektifikasyon noktasında karşımıza GPGPU yöntemi çıkmaktadır.  Ortorektifikasyon işlemi GPGPU yöntemi ile CUDA (Compute Unified Device Architecture-Birleşik Hesaplama Aygıt Mimarisi) programlama dili kullanılarak yeniden programlanarak, daha kısa sürede ve daha ucuz maliyetli donanımlarla ortorektifiye edilmiş görüntülerin elde edilebileceği değerlendirilmiştir. Bu amaçla tez kapsamında öncelikle literatür araştırması yapılmıştır. Sonrasında kullanılacak yöntemlerin matematiksel modelleri ortaya konulmuştur. Ardından kullanılacak yöntem açıklanmıştır. Bu aşamanın ardından da uygulama aşamasına geçilerek çeşitli uygulamalar gerçekleştirilmiş ve sonuçlar elde edilmiştir. Çalışma içerisinde yapılan uygulamalardan görüleceği gibi, etkili bir GPU programlama, mevcut program algoritmasının, donanımın yapısını ve sınırlamalarını da dikkate alan grafik terimlerini kullanarak tekrardan yazılmasını gerektirmektedir. Halen çok çekirdekli işlemcilerin programlanabilmesi, geleneksel programlama yöntemleriyle gerçekleştirilememektedir. Tipik olay yordamlı programlama yönteminin birden fazla çekirdekli işlemcilerin programlanması için kullanılması mümkün olamamaktadır. Yapılan uygulamalarda elde edilen sonuçlar değerlendirildiğinde, yöntemin fotogrametrinin görüntü işlemeyi gerektirdiği ve aynı işlem adımlarının her bir piksel için tekrarlandığı durumlarda ve ayrıca hesap yoğun işlem adımlarında çok etkili ve hızlı sonuçlar verdiği görülmektedir. Özellikle ortorektifikasyon amacıyla yapılan uygulamalarda aynı donanımla CPU’ya oranla 7 kat hız farklarına ulaşılmıştır.  Sonuçlar biraz daha detaylı incelendiğinde görüntü boyutu büyüdükçe CPU’nun performansının düştüğü, GPU’nun ve GPGPU yönteminin performansının arttığı görülmektedir. Yapılan bu uygulamaların sayısı ve çeşitliliği arttırılabilir. Hızın ve hızlı karar verme sürecinin etkili olduğu, hesaplama işleminin çok yoğun olarak kullanıldığı problemler için benzer yöntemlerin uygulanabilir olduğu görülmektedir. Yapılan bu çalışma ile daha önce çeşitli platformlardan elde edilen görüntülerin ortorektifikasyonu için kullanılmamış olan bir yöntem, donanım altyapısı kullanılmış ve programlama algoritması uygulanmıştır. Çalışma içerisinde gerçekleştirilen uygulamalar ile GPGPU yöntemi kullanılarak görüntülerin çok hızlı ve donanım olarak çok daha ekonomik bir şekilde ortorektifikasyonunun yapılabileceği değerlendirilmektedir. Böylece, bu çalışmayla halen anlık karar verme ve hedef tespiti için çok önemli bir unsur olan zaman faktörünün en aza indirilmesi için bir yöntem ortaya konulmuş ve bu yöntemin geliştirilmesi için de bir başlangıç yapılmıştır.
The graphic processing units (GPU) on the graphic cards integral parts of computers are really developed today according to the last ten years. The development was the increase of the GPUs performance and capabilities. The modern GPUs are not only became powerful graphic engines and also they are high level parallel programmable processors with very fast computing capabilities and high memory bandwidth speed comparing to central processing units (CPU). The rapid development of GPUs programmability and capabilities attracted the researchers dealing with complex problems who need highly level calculation. This interest has revealed the concepts of “General Purpose Computation on Graphics Processing Units (GPGPU)” and “stream processing”. The graphic processors are powerful hardware which is really cheap and affordable. So the graphic processors became an alternative to computer processors. The graphic chips which were standard application hardware have been transformed into modern, powerful and programmable processors to meet the overall needs. Especially in recent years, the phenomenon of the usage of graphics processing units in general purpose computation has led the researchers and developers to this point. The biggest problem is that the graphics processing units use different programming models unlike current programming methods. Therefore, an efficient GPU programming requires re-coding of the current program algorithm by considering the limitations and the structure of the graphics hardware. Currently, multi-core processors can not be programmed by using traditional programming methods. Event procedure programming method can not be used for programming the multi-core processors. GPUs are especially effective in finding solution for repetition of the computing steps for many data elements when high accuracy is needed. Thus, it provides the computing process more quickly and accurately. Compared to the GPUs, CPUs which perform just one computing in a time according to the flow control are slower in performance. This structure can be evaluated for various applications of computer technology.  General purpose parallel programming can use GPUs not only for graphics but also for removing the burden of the non-graphic computational workload which is traditionally handled by a CPU. Significant computational speedups have been achieved by various researchers from different disciplines using general purpose parallel programming. Although GPU-based non-graphics computation is well suited to data-parallel tasks such as image processing kernels and matrix operations, it is also possible to accelerate many other applications by adapting existing algorithms to the general purpose parallel programming.  Therefore it seems reasonable to exploit tremendous computing power of GPUs for orthorectification, since computational power is an important concern. Real time processing of imagery data which is coming from several sensors and platforms like airborne and unmanned air vehicles is really important today. For rapid evaluating data coming from unmanned air vehicles (UAV) in military applications, for supporting rescue and security forces, and also for obtaining surveys in disaster scenarios or mass events an airborne real time image processing system is required. So the need is speed for processing orthorectification the imagery data to find the target and get true coordinates of targets from this quick orthorectified imagery.  The imagery data which is coming from several sensors and platforms size is really huge. Naturally, very powerful computers are needed to orthorectify of these images. When the various studies are analyzed, it can be seen that numerous powerful computers are used to orthorectify these imagery in real time. Such systems can be created for normal aircraft platforms mey be possible if considering the cost. However, in unmanned air vehicles, which are much smaller than regular aircrafts, it is not possible to establish that kind of multiple computer systems. At the same time it is important that the payloads on the platform as camera, navigation system etc. must be light hardware.  Existing digital aerial cameras and unmanned air vehicles imaging systems have GPS-IMU (Global Positioning System-Inertial Measurement Unit) systems. So it is possible to orthorectify images with camera calibration parameters in real time. With this direct orthorectification oppurtunity we encounter GPGPU method and it can be possible that orthorectification procedure can be done by GPGPU and CUDA (Compute Unified Device Architecture) programming language. So we can orthorectify images with cheaper hardware in a short time. For this purpose in this thesis firstly a literatur search has been done. After that, mathematical models of the methods have demonstrated. Next it is described methods to be used. After this step the method has been implemented and taken the application results. It can be seen from the studies in this thesis, the effective GPU programming requires the re-writing existing program algorithm using graphical terms again considering to hardware structure and limitations. Today, the multicore processors can not be programming using traditional programming methods. So the usage of typical event programming procedure can not be possible for programming the multicore processors. Programming model changed to stream computing and processing. In this new model for identifying the kernel functions, that apply intensive calculation each element in the flow, all the input and output data qualified as stream. There are lots of processors on the GPU that process these streams. For example Nvidia GTX580 series card has 512 unit stream processors (CUDA processors). So we can consider such as 512 computers stay side by side. The graphic cards can do multiple intensive processes with these stream processors at the same time. Data-parallel processing maps data elements to parallel processing threads. Many applications that process large data sets can use a data-parallel programming model to speed up the computations. In 3D rendering, large sets of pixels and vertices are mapped to parallel threads. Similarly, image and media processing applications such as post-processing of rendered images, video encoding and decoding, image scaling, stereo vision, and pattern recognition can map image blocks and pixels to parallel processing threads. In fact, many algorithms outside the field of image rendering and processing are accelerated by data-parallel processing, from general signal processing or physics simulation to computational finance or computational biology. In this study covers how general purpose parallel programming and computational power of the GPUs and GPGPU method can be used in photogrammetric orthorectification applications especially direct georeferencing and projective rectification. These two methods coded with CUDA programming language.  The results obtained are evaluated; the method is really suitable for image processing and photogrammetry especially if we do the same calculations to per image pixels. Also it is suitable for intensive calculation procedures. GPGPU and CUDA programming method make the calculation really fast. We can increase the number of applications which can be adapted to photogrammetry and image processing that require intensive computation and speed. Especially with orthorectification procedure with GPU is 7 times faster than CPU implementation and speedup is 7 times. The results are analyzed in detail when the image size is slightly bigger, GPGPU method and GPU performance is increase and CPU performance is decrease. In this study, a method which has not used before for orthorectification of images obtained from various platforms was implemented using programming algorithm and hardware infrastructure. By using this GPGPU method it can be possible to orthorectify images very fast and with economical hardwares. So this study is a start point for improve this method and increase the time factor for making instant decisions from images.
Açıklama
Tez (Doktora) -- İstanbul Teknik Üniversitesi, Fen Bilimleri Enstitüsü, 2016
Thesis (PhD) -- İstanbul Technical University, Institute of Science and Technology, 2016
Anahtar kelimeler
Çok amaçlı programlama ; Fotogrametri ; Ortorektifikasyon ; Paralel işlemciler ; Paralel hesaplama ; Grafik kartları üzerinde genel amaçlı hesaplama, Multipurpose programming ; Photogrammetry ; Orthorectification ; Parallel processors ; Parallel computing ; General purpose computation on graphical processing units
Alıntı