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

Indian Super League (ISL): Should foreigners be reduced from 5 to 4?

                                                                             Founded in the year 2013 by IMG and Reliance along with Start Sports , the Indian Super League came as a savior for Indian football, which grew hopes in every football fans and lovers across India. It is now the top league in India.   Era before ISL Prior to the entry of Indian Super League , I League was the main event of Indian Football which till this year was the main league of the country. Club giants like East Bengal, Mohun Bagan, Dempo and Churchill Brothers were the most popular teams which attracted thousands of spectators into the ground in a nation where people does not really care about any other sports than Cricket . Later came the North-Eastern clubs like Royal Wahingdoh, Shillong Lajong and others which put up a positive effect on Indian Football, few even went up to become table toppers!   The problem with I League Although some of the I League clubs being well established ( teams l

How to pass Azure Certification Exam?

With the different businesses shifting their data from self hosting to the Cloud providers' platforms, demand for the people with Cloud skills has been high in the Job market. According to a report, t he global Cloud Computing market size is expected to grow from USD 371.4 billion in 2020 to USD 832.1 billion by 2025, at a Compound Annual Growth Rate (CAGR) of 17.5% In one of our previous blog , we discussed about various Cloud technologies and their types. Although there a lot of providers in the market who provide Cloud hosting solutions for the companies, the main global competitors are - Amazon through their offering known as AWS ( Amazon Web Services ) Microsoft through their offering known as Azure . Google through their offering known as Google Cloud . As per Canalys report as of July 2020, AWS gets about 31% of market share, Azure gets a share of 20% while Google Cloud is 6%. An interesting fact that has come up for Microsoft's Azure is, due to the Cor