Let’s look at some simple monadic functions such as type conversion, brightness and contrast adjustment, inversion and posterisation and the effect they have on an image.
Search Results for: pixel type conversion
MATLAB normally deals with matrices of floating point numbers. An image is typically represented by an array of small integer values, pixel value or greyscale values, which have a limited dynamic range and special rules for arithmetic.
Most of us have lots of digital images captured using cameras or phones. Each image comprises millions of picture elements or pixels. The images are stored in files, typically in JPEG format, and we’ll see what’s inside one of these files.
We run into problems when we take all of the pixels in a box around an input pixel and that pixel is close to one of the edges of the image. Let’s look at some strategies to deal with edge pixels.
We can use MATLAB to display a profile of brightness along a line in the image.
We can describe the relationship between a 3D world point and a 2D image plane point, both expressed in homogeneous coordinates, using a linear transformation – a 3×4 matrix. Then we can extend this to account for an image plane which is a regular grid of discrete pixels.
So far we have taken a linear combination of pixels in the box around the input pixel, but non-linear operations like sorting and ranking the pixel values also prove to be very useful. We look at the median filter which is much better at removing salt and pepper noise from image than simple smoothing.
If we want to process images the first thing we need to do is to read an image into MATLAB as a variable in the workspace. What kind of variable is an image? How can we see the image inside a variable? How do we refer to to individual pixels within an image.
When a camera moves in the world, points in the image move in a very specific way. The image plane or pixel velocity is a function of the camera’s motion and the position of the points in the world. This is known as optical flow. Let’s explore the link between camera and image motion.
The linear algebra approach we’ve discussed is very well suited to MATLAB implementation. Let’s look at some toolbox functions that can simulate what cameras do. If you are using a more recent version of MVTB, ie. MVTB 4.x then please change>> cam.project(PW ‘Tcam’, transl(0.1, 0, 0)) to >> cam.project(PW ‘pose’, transl(0.1, 0, 0)).