Postagens

Mostrando postagens de dezembro, 2021

Classical Computer Vision: Image Segmentation with Mumford & Shah

Imagem
      The Mumford & Shah is another segmentation algorithm that is much more efficient than K-Means, that uses the following math equation to decide which pixels of an image should belong to which segment     The idea here is not to go deep under the hood for this equation, because we're not trying to implement it, but to use it.           So, lets get the example extracted from professor  Aldo von Wangenheim   (@UFSC/Brazil) for Mumford & Shah image segmentation: from ipywidgets import interact , interactive , interact_manual import cv2 , scipy from skimage import data from matplotlib import pyplot as plt # Import the M&S-equivalent Ambrosio Tortorelli Minimizer (we'll call it A&Tmin) # You have to download it before from https://github.com/jacobgil/Ambrosio-Tortorelli-Minimizer # or from my mirror (is NOT updated): https://github.com/awangenh/Ambrosio-Tortorelli-Minimizer from AmbrosioTor...

Classical Computer Vision: Image Segmentation with K-Means

Imagem
  Intro     Image Segmentation is the process of partition an image into multiple segments. The idea is to simplify the image, changing it's representation into something more useful and meaningful to analyze.    It could be applied to  product auto inspection in factories, quality control, face detection, brake light detection, locate an object in an image, machine vision etc. How to segment an image?     There are several techniques of image segmentation, starting from simple ones to more complex IA-related algorithms.      In classical computer vision, we are deliberately excluding anything IA related just for the sake of keeping things organized. So, let's first focus on classical segment algorithms. Threshold    The first one we already talked about it when we were dealing with value domain: threshold . As we saw earlier, the threshold technique allows us to exclude a portion of an image based on the pixel values, reg...