DOC PREVIEW
NMT EE 552 - GPU Implementation of Adaptive Median Filter

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

GPU Implementation of Adaptive Median Filter April 21, 2011 EE552 Andrew Ronquillo Ian JohnsonAbstract: An adaptive median filter is a great tool to have to remove salt and pepper noise. The problem with implementing the adaptive median filter is the amount of time it takes to perform all the necessary calculations on all the layers of the image. One method to help decrease the amount of time to complete all processes is to implement the algorithm on a GPU rather than a CPU. Results acquired show that there was an improvement in processing time, but the improvement was not as much as expected. The results show a 1.5x times increase in speed as opposed to the theoretical 10x-50x increase in speed. Introduction: The adaptive median filter was implemented using MATLab. In order to have MATLab perform at its peak performance all the code had to be vectorized. Once all the code was vectorized, GPU software was selected. The selected GPU software was Jacket by Accelereyes since the software was easy to implement with MATLab. Jacket is a GPU software package that allows the user to implement MATLab on the GPU. Jacket supports many MATLab functions and includes the image processing toolbox with pre-written MATLab functions for use. Jacket makes the transition from performing calculations on the GPU and the CPU extremely easy. To perform the processing on the GPU the key ‘g’ is put in front of most functions, i.e. gsingle() or gdouble(). Once the data is put on the GPU with Jacket, the computations are performed on the GPU until the data is transferred back to the CPU by using regular MATLab functions, i.e. single() or double(). Background: An adaptive median filter algorithm is a great tool to have to remove salt and pepper noise from images due to the simplicity of the algorithm, the robustness of the algorithm, and the conditionals that are inside the algorithm. The conditionals are simple enough to calculate quickly and easily, but each conditional calculation has to be made at each iteration in the algorithm so the overall computing cost can be quite expensive when dealing with larger images and all layers of the image. The GPU could decrease the time of overall filtering because the GPU is amazing at doing parallel computing. The GPU will calculate each loop iteration and every layer of the image simultaneously rather than the CPU which calculates everything sequentially. The algorithm used for the adaptive median filter is shown in Figure 1.Figure 1: Adaptive Median Filter Results: The first test was to compare the final results of the GPU calculations to the CPU calculations to make sure the algorithm was still being performed correctly. The final results show that there is no visual difference between the two results so the algorithm still works as it is supposed to. The filtered image results of one layer of the original image are shown in Figure 2.Figure 2: original (left); CPU (upper right); GPU (lower right) The GPU used in this experiment was on a laptop so it was not a dedicated GPU and was only single-precision. In order to get better results with the theoretical 10x-50x results, a dedicated double-precision GPU will have to be used. The algorithm will have to be completely vectorized in MATLab as well for highest potential. To get the full spectrum on the advantages and disadvantages of the GPU vs. CPU, several tests were performed. The tests were performed with one layer of the image, and then with all three layers of the image. At first the tests were proven inconclusive as shown in Figure 3. The inconclusive results were from 50 iterations of the entire algorithm and were very confusing at first.Figure 3: Inconclusive Results After some slight changes in the algorithm, some different functions were used with jacket, and more testing, conclusive results were finally recorded and are shown in Figure 4. Figure 4 shows results from 500 iteration tests. Figure 4: Total Time of Calculations Data Analysis: The results presented were acquired after many different trials and discoveries. In order for the GPU to become truly successful in dominating the CPU, all three layers of the image had to be processed. One reason for these results is due to all the constant data transition from GPU to CPU which takes up a lot of time. The time differences shown in the results are when the laptop used went to sleep therefore allowing the GPU to be completely dedicated to calculations. The difference between the 1-D (single color plane) and 3-D (three color plane) analysis completely makes sense. The double line of the GPU time is the result when the laptop is not asleep and still having to process information to send to the monitor, etc.In the 1-D analysis, the GPU is generally slower due to the constant switching of CPU calculations and GPU calculations. The reason for the constant processing switching is due to the Jacket unable to support break in loops, nested for loops, and other functions used in MATLab. The reason for the lack of support is due to the GPU processing all the for loop iterations simultaneously and the conditionals of the adaptive median filter rely on other calculations of the for loop. In the 3-D analysis the GPU starts to show its teeth and begins to dominate the CPU. The CPU time is exactly three times as long to complete one iteration of the algorithm and the GPU shows less than a 3x increase allowing the time decrease to increase immensely. The GPU is able to process all three layers of image at once decreasing the time by at least one third and the for loops are then calculated in parallel as well, decreasing the processing time even more. Conclusion: In conclusion, Jacket is great software to use for GPU processing and has much potential. The reason why this experiment did not produce the results claimed by Accelereyes (10 to 20 times speedup) is because a GPU that was used was not a dedicated device for processing data. It was the general GPU for the entire computer. Also, the way the filter was implemented required sending data back to the CPU for computation before continuing on the GPU. This data transferring cost a lot of process time on the GPU, if we could implement all the functions on the GPU, eliminating the data transfer problem, the process would be much faster. Overall, the GPU is faster at producing similar results to the CPU due to its ability to process several algorithms


View Full Document

NMT EE 552 - GPU Implementation of Adaptive Median Filter

Download GPU Implementation of Adaptive Median Filter
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view GPU Implementation of Adaptive Median Filter and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view GPU Implementation of Adaptive Median Filter 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?