Sometimes we need to select all pairs from a set, for example to calculate the distance between all point pairs. Although the built-in function nchoosek provides a convenient way to do this, in this post an alternative method is described which runs about 188 times faster in case of 1000 elements.
Dear MATLABtricks.com readers, I apologize for having not written to this blog for such a long time. The reason is that I was working on an image-processing related own project, called Imagatic. This is an online photo effect application, which requires only a modern web-browser to run, works on smartphones, tablets and PCs too. Hopefully it will have growing amount of effects as I am going to develop it further.
In a previous post the basics of the Hough transform were explained. Although we have the built-in hough function in MATLAB to do this operation, it is definitely worth to write our optimized version for study purposes. In addition this lets us to have a function meeting our needs better if needed.
As working on a fast implementation of the Hough-transform, at a given step repeating a row-vector multiple times was needed. Because there are some methods to do this task, it was worth to measure the runtime of the different approaches and choose the best one.
The Hough transform is a feature extraction technique. It is used mostly for detecting lines, but can be extended to find circles and ellipses. In this post the basics of this procedure are explained with an online demonstration to help better understanding.
In the last post a simple trick of creating two-dimensional histograms from integer coordinates was explained. As a small supplement, let us see, how to create histograms from any floating-point data. This method works for single vectors: in case of two-dimensional histograms we just have to apply the method for each individual dimension.