O'Reilly logo

Computer Vision for the Web by Foat Akhmadeev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Advanced image processing

We talked about filters a lot, but they usually require only some sort of a matrix kernel and that is it. If you think that there should be more cool stuff in image filtering, you are totally right! First, we will see how to apply edge detection and how it works. In the final part, we will review the histogram equalization algorithm, which you probably use a lot if you have Photoshop.

The Canny edge detector

Let's be curious; what if we threshold an image after the Sobel filter? Thresholding is done by iterating over all pixels of a grayscale image and checking whether the value exceeds the threshold value:

for (var i = 0; i < arr.length; i++)
    arr[i] = arr[i] > threshold ? 255 : 0;

This is what the threshold looks like. Just ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required