Posts tagged ‘Tutorial’


This tutorial will focus on giving you working knowledge to implement and test a convolutional neural network with torch. If you have not yet setup your machine, please go back and give this a read before starting. Continue reading ‘An Intro to Convolutional Networks in Torch’ »

The most important thing you need to develop an OpenCL application is to be able to compile and run your code. If that is what you need to know, then you’re in the right place! Unlike the CUDA development platform, OpenCL is an open standard and is supported on various devices. Anything from multi-core CPUs to integrated GPUs, to dedicated GPUs, and even some more exotic devices like DSPs and FPGAs. Because of this diversity, the development environment is a bit fragmented. There are OpenCL SDKs available from various vendors including Intel, AMD, and NVIDIA. What to do! Continue reading ‘Setting up OpenCL’ »

Vertex transformations are an extremely common operation for both 2d and 3d programs. A transformation can include translation, rotation, scaling, or any combination of the three. While it is beyond the scope of this article to elaborate on fine details of vertex transformations, it all boils down to a matrix multiplication. A 3d vertex can be represented as a 1×4 matrix, [x, y, z, w] where w is usually 1, and the transformation is represented as a 4×4 matrix. To get the translated vertex, you simply need to multiply the vertex by the transformation matrix, where the result is also a convenient 1×4 matrix. For a more detailed explanation, you can read about the transformation matrix here. Continue reading ‘CUDA Tutorial – 3d vertex transformations’ »

When performing image transformation and manipulation techniques, it is often necessary to employ some sort of interpolation or filtering in order to obtain a good image quality. For example, if you scale an image, you can determine the final color of each pixel by either some basic nearest neighbor method, or a more advanced interpolation method. However, an interpolation method will invariably offer better final image quality. In this tutorial, we’ll be writing a function to rotate an image, using bilinear interpolation. This tutorial also demonstrates how to perform a high quality image rotate transformation, however, that is not the focus of this tutorial, but rather the example transform being performed. Continue reading ‘Coding Bilinear Interpolation’ »

In a previous article about image processing with SSE, we used some basic SSE intrinsics to perform a very easy image manipulation routine, removing all blue from an image. This task was easy, since each pixel was 8 bits per component, with 4 components (ARGB). However, for more advanced image processing functions such as 2D convolution, it is preferable to work with each color component as a 32-bit floating point number rather than an 8-bit unsigned integer. Continue reading ‘Advanced Image Processing with SSE’ »

CUDA is great for any compute intensive task, and that includes image processing. In this tutorial, we’ll be going over why CUDA is ideal for image processing, and how easy it is to port normal c++ code to CUDA. Continue reading ‘Intro to image processing with CUDA’ »

Understanding the basic memory architecture of whatever system you’re programming for is necessary to create high performance applications. Most desktop systems consist of large amounts of system memory connected to a single CPU, which may have 2 or three levels or fully coherent cache. Before you get started with CUDA, you should read this to understand the basic memory hierarchy of modern CUDA capable compute devices. Continue reading ‘CUDA Memory and Cache Architecture’ »

Searching is a common task in computer science, and fortunately, it is also perfectly suited for CUDA. For this article, we’re talking about searching through an unsorted text file for a specific word or phrase. For example, if you have a 50 megabyte text file open in Microsoft Visual Studio, you’re sure to notice that searching for a word can take several seconds, which is more than any person wants to wait just to find a word in a document. This article will demonstrate a simple kernel which can perform simple string matches.

Continue reading ‘Search algorithm with CUDA’ »

Taking an image and making it look like an oil painting is not only visually impressive, but also easy, from an algorithmic point of view. This page will show you how to write code to achieve the oil painting effect.

Continue reading ‘Oil Painting Algorithm’ »

Image convolution is the most vital image processing algorithm available. Using simple 2-D convolution, you can blur, sharpen, emboss, and even detect edges in an image. Not only is convolution so powerful, but it is also very easy to perform. Simply put, the value of a modified pixel is determined solely by it’s original value summed up with weighted values of it’s neighboring pixels. After the weighted sum is completed, a division takes place to normalize the value of the pixel, usually so that the brightness of the image remains the same. Sometimes, an offset can be added after the normalization for certain effects. Continue reading ‘Image Convolution with GDI+’ »