In digital image processing, there is a group of transformations which receive the coordinates of a pixel as input, and return the new coordinates where the pixel should be placed; so that, when computing these transformations for all the pixels of an image, a new image is obtained.
Here, we are going to focus on one kind of these transformations, the affine transformations, which preserve collinearity (points and straight lines, planes, etc.). Affine transformations map points into new points by applying a linear combination of translation, rotation, scaling and skewing operations.
In the previous post we explained how an image can be represented as a matrix of pixels, where each pixel is expressed as a three-dimensional vector, composed by the amount of red, green and blue of the color. In this post, we are going to give some examples about the use of linear algebra in the digital image processing.
One kind of image processing are the filters. Among the most used there are: adjustment of brightness, contrast and colors, grayscale conversion, color inversion (negative), gamma correction, blur and noise reduction.
When most of us think about Linear Algebra, the first idea that comes out from our mind is a system of linear equations that needs to be solved, or its graphical variant, a Cartesian plane with two lines, in order to solve the problem of finding the intersection point; but what probably most of people don't know is that tools like Photoshop or libraries like OpenGL or DirectX make an extensive use of linear algebra for most of their functionalities.
It this series of posts we will discuss some basic concepts of the application of Linear Algebra in Image Processing. In the first post we will focus on its applications and how an image can be represented as a matrix, in the second and third one we will explore matrix operations on an image, and in the last one we will show some practical examples in JavaScript.
In the previous part of this article we formulated the Einstein's riddle in terms of matrices, and presented three matrix operations that will be the base for an algorithm to solve the riddle. In this part we'll be talking about this algorithm, and a JavaScript implementation which will allow solving this riddle and any other grid riddle similar to this one.
There are some programming languages as Prolog, designed to work with logic facts, where you can deal with logical problems in a natural way. By using the matrix formulation we can use any programming language to deal with this kind of riddles. Here we provide the implementation, in JavaScript, of the matrix object with the three basic operators used to solve the riddles. The selection of JavaScript is not arbitrary, it allows to show the effectiveness of the algorithm in this same post.
There are several logical grid puzzles you can find on the internet, but undoubtedly, one of the most popular known is the Einstein's riddle. Although it's attributed to Einstein, there's no evidence to back up that claim. It's rumoured that only 2% of the world can solve it, but it's really not so hard, all one needs is logic and deduction. In this article we are going to present a method based entirely on matrix operations to solve this riddle and any other similar.
There are five houses in five different colours in a row. In each house lives a person with a different nationality. The five owners drink a certain type of beverage, smoke a certain brand of cigar and keep a certain pet. No owners have the same pet, smoke the same brand of cigar, or drink the same beverage. The question is: Who owns the fish?