What is Metrology Part 15: Inverse Filtering

Signal Processing

Signal processing is the name of the game that must be played in order to do image processing. Image processing is such a fascinating subject that I am excited to expand upon it.  It has amazing cross sectionality within various fields such as metrology, 3D printing, biomedical industries, and any industry that uses imaging as its main technology. Today we will be taking a look into inverse filtering as a specific method within signal processing. Signal processing is a general domain of expertise that can be applied in different settings. For the purposes of where we are in our metrology series, we will only focus on image processing.

imagerestoration.gif

Inverse Filtering

Inverse filtering is a method from standard signal processing. For a filter g, an inverse filter h is one that where the sequence of applying g then h to a signal results in the original signal. Software or electronic inverse filters are often used to compensate for the effect of unwanted environmental filtering of signals. Within inverse filtering there is typically two methodologies or approaches taken: thresholding and iterative methods. The point of this method is to essentially correct an image through a two way filter method. Hypothetically if an image is perfect, there will be no visible difference. The filters applied will correct a majority of errors within an image.

When we know of or have the skill to create a good model for a blurring function of an image, it is best to use inverse filtering. This is because having a model, or let’s say algorithm, allows us to efficiently and succinctly apply mathematical constraints to data in an instantaneous manner. The inverse filter is typically a high pass filter. 

ECG high-pass filter

A high-pass filter (HPF) is an electronic filter that passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. In physics, attenuation is the continuous loss of flux intensity through an object. Flux is a rate of flow through a surface or substance in physics. For instance, dark glasses attenuate sunlight, lead attenuates X-rays, and water and air attenuate both light and sound at variable attenuation rates. The amount of attenuation for each frequency depends on the filter design. A high-pass filter is usually modeled as a linear time-invariant system. It is sometimes called a low-cut filter or bass-cut filter. If the cutoff frequency is lower than the cutoff frequency, our image will not allow for certain features to be shown in the next image transformation. This efficient method is great for low frequency signals, but the world and image data is not low frequency.  The outputs from the world are typically noisy. The linear time-invariant system of a high pass filter is needed in order to constrain the outputs one receives from the universe. When time is added as a variable for a signal, wild things can happen in terms of frequency. In order to conduct an inverse filter we have two techniques: thresholding and the iterative procedure. 

Thresholding

The word threshold can be defined as a level, point, or value above which something is true or will take place and below which it is not or will not. Thresholding in image processing refers to setting a value limit on the pixel intensity of an image. This threshold can be thought of in terms of our earlier discussion on filters. The image processing method is able to create a binary image. This technique is usually applied to grayscale images, but it can be applied to color images as well. We are able to dictate the level of intensity that we want to have our transformed image at. Pixels that are below this value are converted to black – this is the value of zero in binary code. Pixels above the threshold value are then converted to white – this is the value of one in binary code. 

The iterative method within inverse filtering is more of a mathematical guess and check solution. The goal is to guess what the original image was in terms of image processing.  With each mathematical guess, a user is able to build a better fitting model to represent a digital image. This method is more of a brute force algorithm method. This method is not as efficient as the thresholding method, but it does have the advantage of better stability when dealing with noise. We do not need to be time invariant when dealing with this method. 

Overall, this is only one of the many examples of image processing techniques. As a follow up to this article, I will do some interactive code and I’ll showcase some of the power of these methods when we are taking a look at these problems through the lens of computer science and engineering.

The post What is Metrology Part 15: Inverse Filtering appeared first on 3DPrint.com | The Voice of 3D Printing / Additive Manufacturing.

What is Metrology Part 14: Image Restoration

Art Restoration and 3D Printing

Through this metrology series, I hope readers are making this realization: We as humans have faulty perception, and we try to understand our world as precisely as we can. The tools we use to measure items within our world are prone to error, but they do the best they can to reveal the essence of reality. The common adage is that a picture says a thousand words. If one has a blurry or weak picture, the words said are mostly confusing. Devices that take images can be used for metrology purposes as we have discussed earlier. The data that we capture in forms of images is necessary for high resolution and precise metrology methods. How do we make sure that images are giving us words of clarity vs. confusion?

Image restoration is the operation of taking a corrupt or noisy image and estimating the clean, original image. Corruption may come in many forms such as motion blur, noise, and camera misfocus. Image restoration is different from image enhancement in that the latter is designed to emphasize features of the image that make the image more pleasing to the observer, but not necessarily to produce realistic data from a scientific point of view.

Certain industries are heavily reliant on imaging. An example of the interdisciplinary nature of imaging and metrology is found in the medical sector. Biomedical imaging techniques need to be extremely precise for accurate measurements of internal organs and structures. Size, dimensionality, and volume are items that need high precision due to their affect on human life. Without proper images of these items, doctors and physicians would have a difficult time in giving proper diagnoses. Another important caveat to remember is the ability to replicate these structures through the use of 3D printing. Without accurately measured dimensions from 2D images, there would be a lack of precision within larger 3D models based off of these 2D images. We have talked about image stitching and 3D reconstruction previously. This is especially important within the medical field in the creation of 3D printed phantoms.

One can apply the same concept and thought process to the automotive industry. The automotive industry is all about standardization and replicability. There needs to be a semi-autonomous workflow ingrained within the production line of a vehicle. 3D scans are taken of larger parts that have been fabricated. With these original scans, replicability within production is possible. There still lies a problem of precision within an image. There are a lot of variables that may cause a 3D scan to be unreliable. These issues include reflective or shiny objects, objects with contoured surfaces, soft surfaced objects, varying light color, opaque surfaces, as well as matte finishes or objects. It is obligatory that a 3D scan is done in an environment with great lighting. With all of these issues, image restoration is essential with any scan because it is nearly impossible to have a perfect image or scan. Within the automotive industry, the previous problems are very apparent when scanning the surface of an automotive part. 

There are 4 major methods to image restoration that I will highlight here, but will expand upon within further articles.

Inverse Filtering

Inverse filtering is a method from signal processing. For a filter g, an inverse filter h is one that where the sequence of applying g then h to a signal results in the original signal. Software or electronic inverse filters are often used to compensate for the effect of unwanted environmental filtering of signals. Within inverse filtering there is typically two methodologies or approaches taken: thresholding and iterative methods. The point of this method is to essentially correct an image through a two way filter method. Hypothetically if an image is perfect, there will be no visible difference. The filters applied will correct any errors within an image though.

Wiener Filter

In signal processing, the Wiener filter is a filter used to produce an estimate of a desired or targeted random process through linear time-invariant filtering of an observed noisy process, assuming certain conditions are constant such as known stationary signal and noise spectra, and additive noise. This is a method that is focused on statistical filtering. This necessitates time-invariance because adding time into this process will ultimately cause a lot of errors. 

Wavelet-based image restoration

Wavelet-based image restoration is applying mathematical methods that allow for an image and its data to be compressed. With this compression, the ability to process and manipulate an image becomes a bit more manageable. Transient signals are best for this type of method. A transient signal refers to a short-lived signal. The source of the transient energy may be an internal event or a nearby event. The energy then couples to other parts of the system, typically appearing as a short burst of oscillation. This is seen in our readily available ability to capture a picture or image within a specific time frame. 


Blind Deconvolution

Blind deconvolution is a technique that permits recovery of the target scene from a single or set of “blurred” images in the presence of a poorly determined or unknown point spread function(PSF). The point spread function (PSF) describes the response of an imaging system to a point source or point object. A more general term for the PSF is a system’s impulse response, the PSF being the impulse response of a focused optical system. Regular linear and non-linear deconvolution techniques utilize a known PSF. For blind deconvolution, the PSF is estimated from the image or image set, allowing the deconvolution to be performed. 

We will be taking a deeper dive into this subject matter soon. As one can tell, there lies a vast amount of information and interesting technology and knowledge to be further understood. Through writing and experimentation with code, hopefully, I can show these things as well. 

The post What is Metrology Part 14: Image Restoration appeared first on 3DPrint.com | The Voice of 3D Printing / Additive Manufacturing.

What is Metrology Part 8: Complex Analysis, Optics, and Metrology

The field of metrology is interesting for me as it integrates a lot of what I enjoy in physics and technology. The field from the outside seems very bland, but when you delve into the background, it becomes a more colorful picture. The field is reliant on the physics behind optics and image processing. These are areas of extreme interest to me. Visualization and capturing visualization data is essential for the field. A lot of this data is difficult to interact with as well because the data must be interpreted as a function that can be manipulated for reconstruction purposes from point cloud data. The mathematics behind this is what can be referred to a complex analysis. Today I will give some basic insight into these advanced concepts of physics and how they open us to learning more about metrology and 3D scanning. 

Let’s first talk about the field of optics. Optics is the branch of physics that studies the behaviour and properties of light, including its interactions with matter and the construction of instruments that use or detect it. Optics usually describes the behaviour of visible, ultraviolet, and infrared light. Because light is an electromagnetic wave, other forms of electromagnetic radiation such as X-rays, microwaves, and radio waves exhibit similar properties.

Optical science is studied in many related disciplines including astronomy, various engineering fields, photography, and medicine. Practical applications of optics are found in a variety of technologies and everyday objects, including mirrors, lenses, telescopes, microscopes, lasers, and fibre optics, as well as metrology practices.


Yes Imaginary Numbers are useful

I personally have a strong fascination with the field of optics. Firstly, I wear glasses and my glasses help me “see” more. The field of optics quickly takes a dive into metaphysical thought processes on human perception as well as what we actually see. Optics is the center of how most of us “see” the world. When we are in the field of metrology we are relying on man-made technology to measure what we see as humans. The realization that we as humans are measuring reality and physical dimensions is a bit mind-boggling. We do not necessarily know what reality is, but we use metrology to measure for us what is within our “grasp”.

Here is where it starts to become a bit more interesting. What defines the system we are in as humans who are measuring within their current state of reality? There must be a larger system that allows for this to occur. This is where complex analysis comes into play. Complex analysis, traditionally known as the theory of functions of a complex variable, is the branch of mathematical analysis that investigates functions of complex numbers. It is useful in many branches of mathematics, including algebraic geometry, number theory, analytic combinatorics, applied mathematics; as well as in physics. As a differentiable function of a complex variable is equal to the sum of its Taylor series (that is, it is analytic), complex analysis is particularly concerned with analytic functions of a complex variable (that is, holomorphic functions).

Complex Analysis 3D Function

For those of you intimidated by math, I will explain the meaning behind the math. Complex analysis is the branch of mathematics that is trying to understand the imaginary or complex plane of the universe we are confined to. We are working within 3 degrees of freedom or 3-dimensionality within our universe. The system of the universe is not determined by what is seen in the 3-dimensional world. Our perception is not what easily moves the universe. The forces that work on our 3-dimensional universe are applied through the fourth dimension or the complex plane of the universe. For all those who want to learn more physics be sure to enjoy immense philosophical implications. So why is all of this relevant to metrology and optics? Think about this. The signals or data we receive from viewing images is distorted by the complex realm. If it was not, there would be extremely high resolution images taken on a consistent basis. That tiny bit of blur in a photo, for example, is a byproduct of the complex world interacting with the physical realm we are within. This is what typically creates a noisy signal typically in physics. In signal processing, noise is a general term for unwanted (and, in general, unknown) modifications that a signal may suffer during capture, storage, transmission, processing, or conversion. Noise reduction, the recovery of the original signal from the noise-corrupted one, is a very common goal in the design of signal processing systems, especially filters. The mathematical limits for noise removal are set by information theory, namely the Nyquist–Shannon sampling theorem.

The data we are collecting, or information, is prone to noise. We live in the 3rd dimensions and the complex plane consistently is interacting with our signals or data. Thus we use filters to help with noise cancellation. This is the basis of image processing and digital image reconstruction. The algorithms being created currently for photogrammetric filters are extremely vital for the future of 3D reconstruction. These filters will rely heavily on the field of complex analysis to build better filters. Then we will have very clean 3D reconstructions from our metrology practices. For all those who are intrigued, I will continue to explain different items within the 3D metrology field.

The post What is Metrology Part 8: Complex Analysis, Optics, and Metrology appeared first on 3DPrint.com | The Voice of 3D Printing / Additive Manufacturing.