Image Processing : Crack detection and restoration of old paintings Skip to main content

Image Processing : Crack detection and restoration of old paintings

Image Processing

With advancements in the digital world, technology have evolved over the years especially after the invention of computers. Digital systems are now enabling us to solve several real-life problems and with better accuracy. Several applications have now been built that can process images and make them more meaningful for us.

 

What is Image Processing?

With the advancement of technology, we can save images digitally, might be in computers or mobiles or any other digital media. Now we might need to process that image either to enhance the same image or to extract some information embedded in it using some algorithm.

The primary steps for digital Image Processing includes:

  1. Import the image.
  2. Analyze and process the image imported.
  3. Output the image after the original image has been modified to get the desired result.

Some of the fields where digital image processing include but not restricted to are -

  • Image sharpening and restoration.
  • Medical field such as X-Ray imaging, CT scan and other such applications.
  • Machine/Robot  vision.
  • Pattern recognition.
  • Remote sensing.

 

How are images stored digitally?

Data in digital media is stored in the form of Binary i.e., 0s and 1s. To store an image, it is broken down into smallest  element known as Pixel, each having a particular value at a particular location for example, the image is represented in the form 2096 X 1200 pixels.

Consider the following matrix-

 

Image Processing_digital image storage

Now, the colours are represented as 2n where 'n' is the no of bits used to represent. So if 1 bit is used (0 and 1), it can represent two colours i.e., black and white, while 8 bits can store 256 types of colours in the image and so on.

 

Cracks in old images.

Many paintings, especially old ones, suffer from breaks in the substrate, the paint, or the varnish. These patterns are usually called "cracks" and can be caused by aging, drying, and mechanical factors. Age cracks can result from non-uniform contraction in the canvas or wood-panel support of the painting, which stresses the layers of the painting. Drying cracks are usually caused by the evaporation of volatile paint components and the consequent shrinkage of the paint. Finally, mechanical cracks result from painting deformations due to external causes, e.g. vibrations and impacts. The appearance of cracks on paintings deteriorates the perceived image quality. However, one can use digital image processing techniques to detect and eliminate the cracks on digitized paintings.


There are three basic steps in above problem namely -

  •  Crack Detection and Identification.
  •  Crack classification (as a brush stroke or crack segment).
  •  Crack filling. 

 

Image Processing_cracked image


Crack detection and image restoration.

By applying digital image processing techniques, we can detect and remove the cracks in those  images. The methodology involves crack detection and removal of cracks with some filling procedure.

It involves grey scale algorithm and cracks identification and removal algorithm with the use of mathematical morphology and an effective algorithm. The technique consists of the following stages:

  1. There should be some method through which crack area in the digital image can be detected.
  2. Separation of the thin dark brush strokes, which have been misidentified as cracks.
  3. Crack filling.
  4. Notably, a certain degree of user interaction and idea, most notably in the crack detection stage is required for optimal results.

Image Processing_cracked image_restored


Crack Detection:

In most cases, cracks can be considered as being local minima with rather elongated structure. In cracks are identified by taking into account the fact that they have considerably darker grey levels compared to the background and are characterized by a uniform grey level. From a local point of view they also have a strong orientation tendency. The cracks are detected using suitable morphological operations.

This can be achieved using four ways -

  • Erosion : Erosion of an image strips away a layer of pixels from the boundaries of foreground regions.
  • Dilation : Dilation of an image adds a layer of pixels to the boundaries of foreground regions.
  • Opening : The opening of an image is an erosion followed by a dilation.
  • Closing : Closing adds foreground pixels at the boundaries of foreground regions, but is less destructive of the initial background regions than dilation.

Black Hat Transformation can then be applied which is the difference between the closing of the image and the source image.

The black top-hat returns an image, containing the "objects" that:

  • Are "smaller" than the structuring element, and
  • Are darker than their surroundings.

Image Processing_crack after Thresholding
 


Crack Identification:

After the Black Hat Transformation is applied on the original image with cracks, the cracks are identified using either "Selective Thresholding" or "Adaptive Thresholding".

This is one of the simplest and easiest method to identify the cracks clearly. This method works on grey scale images. So we have to convert the picture in to grey scale before applying the process. This method works with the intensity value of the pixel which start from 0 and ends in 255.

 

Crack Classification:

Some paintings have got certain areas where brush strokes have almost the same thickness and luminescence features as cracks. For example, hairs of a person in a portrait could be such an area. So, in order to avoid these undesirable changes to the original paintings, it is very important to separate these brush strokes from actual cracks, before carrying out the crack filling procedure. There are several crack classification procedures that can be used. Some of them are -

  • Semi-automatic crack separation
  • Hue, Saturation and Value

 

Crack filling:

Once cracks are identified and mis-classified brush strokes are separated, the final task is to restore the image using local image information (i.e., information from neighboring pixels) to fill the cracks. We can use idea of median filtering technique to fill the cracks of the image, to fill the crack using several algorithms from selecting the co-ordinate of the cracked pixel to fill those cracks by getting the approximate colour from its neighboring pixels.

In order to fill the crack pixels, a sliding window is used whose center contains the pixel to be filled and value of the other pixels in it is used for filling. It slides through the total no of crack pixels.

Image Processing_crack restoration_program

 

Conclusion:

By detecting the cracks in the old images and fill them in digitized method, it becomes easier to get an idea of how the actual image would look like and hence can be effectively used to restore the historic artifacts.

There are a lot of tools, some of which are OpenCV and Matlab, which helps to process the images by offering in-built functions. These tools can be used in major programming languages such as Java, C#, Python and others.



Hope you like this article, please do let me know if you need more insights.

Comments

Popular posts from this blog

YouTube vs TikTok: The war we are worried about... Should we?

So we have come to an era where we are fighting for or against two different apps without much of a reason because some "social influencers" are taking on each other trying to prove why they are the best!    YouTube and TikTok YouTube and TikTok are one of the leading social media platforms where anyone can create videos, upload them on the applications and share it publicly. YouTube was created in the year 2005 and pre-installed in all the Android devices while TikTok is relatively newer application created in the year 2012. YouTube has an estimated of 2 billion users worldwide, while TikTok has an estimated 800 million users. Where this "war" of the two worlds started? The world was suffering from Corona and was concentrated over it when a YouTuber Elvish Yadav suddenly thought of bringing some new idea for his content and roasted TikTok vidoes and stated them as cringe, he further added that that these videos are very easy to make since they don't really hav...

Is it time to introduce some regulations on the OTT platforms in India?

OTT platforms have emerged as a key player in the entertainment industry and are giving tough competition to the cable operators especially, these have become the favourites among youth. But over the recent months, the OTT platforms have become the center of debate due to various scenes which have raised a question mark on the content that are being presented.   The controversy of ALTBalaji and Ekta Kapoor ALTBalaji is an Indian subscription based OTT platform which is owned by the subsidiary of Balaji Telefilms ltd whose founder is Ekta Kapoor. Now ALTBalaji among its other contents, is mostly popular for its XXX web series which is primarily an adult series and is filled with sex scenes in every episode with little or zero focus on storyline. In the recently released season of the series, the Indian Army uniform was involved in a sex scene in which it was disrespectfully torn, and this sparked controversy and nationwide protests.   The Patal Lok controversy ...

Is India immune to racism?

Over the past few days, the whole of world has been discussing over the incident that took place in US which resulted in massive outbreak of protests and even few cases of violent incidents occurred. This incident did not get unnoticed in India as well and people have been supporting this movements happening in US . But in India , is racism an unknown thing?   The incident that shook the world On May 25, 2020 a 46-year old African American man named George Floyd who reportedly died after a police officer knelt on his neck for a long time while he was lying on the street handcuffed. This incident caused a massive unrest in the US and people from all the communities came in front to support the movement; there were incidents of riots as well in few cities. After this incident, several such type of videos of racism surfaced on different social media platforms that showed that this was not just a very unique incident that occurred but one of the several incidents that are taki...