Industrial Application of Surface Crack Detection in Sheet Metal Stamping Using Shift-and-Add Speckle Imaging

The sheet metal surface crack detection during manufacturing is an essential issue because of both the product quality and process productivity. Development of solutions to eliminate defective products during the metal forming process is crucial for the smooth production and for developing an appropriate tool geometry in the initial phase of the process. Currently, the methods of surface crack detection used in the industry are mostly related to visual inspection. These are methods that require operators of industrial facilities considerable attention and effort to capture emerging discontinuities on the sheet metal surface. Also, this situation results increase in the duration of the specific operations of stamping and significantly reduces productivity. Therefore, an industrial application of a non-contact laser technique that simultaneously provides the results of the speckle imaging is presented. The authors demonstrate a specially designed machine vision system along with experimental tools for the stamping operation. Proposed solution uses the phenomenon of speckle pattern that appears in the image of the investigated sheet surface produced by the laser beam emission. In this method, coherent laser light is emitted to the surface, where a speckle pattern is generated due to scatter reflection from the sheet metal surface and then, shift-and-add technique and image processing is applied. The proposed measurement technique consists, initially, of making a sequence of images of the tested object for the moving surface of the sheet. Secondly, the object’s displacement quantity in each image is determined, and the position is corrected. The test object in each image is moved to the starting position, and all images are superimposed. It allows to obtain a high-quality image with visible surface defects. Finally, the dynamically changing speckle pattern intensity is evaluated using Gaussian-of-Laplacian edge detection to investigate a surface crack location due to the surface discontinues and light scattering. This process is recommended for machine vision imaging of distant objects, which works well in industrial conditions as well as online analysis. Also, from the speckle size measurement, an experimental procedure is employed to verify the best condition for vision system resolution.


INTRODUCTION
In the production environment, searching for new essential elements of technology development is often necessary.Technological improvement leads to an increase in the production capacity of companies, giving new opportunities to meet future 'challenges from clients.These challenges include, above all, a higher quality of products obtained in the production process.However, these activities require resources, which in the case of enterprises include human and financial capital, but above all, know-how, i.e., knowledge, ideas, and innovative solutions.Therefore, commercialisation processes should be modelled and analysed from the point of view of implementing activities within individual stages [1].Such an example of industrial challenges is sheet metal forming, one of the most commonly used production processes.It is expected that shortly, this manufacturing process will be effectively improved thanks to the achievements of the industrial revolution at every stage of manufacturing technology, including in particular in the field of quality control [2].The stamping process is a metal forming technology that includes bending and stretching the metal using presses and dies (Figure 1a,b).The authors propose a technique for surface crack inspection using an automated vision system during industrial auto body sheet stamping (Figure 1c).Compared to casting, forging, or machining, stamping allows one to shape light products with complex shapes quickly.In the case of mass production, formed components, such as car body panels, can be produced at high speed and low cost.Each part is made by placing a metal sheet between the upper die (or stamp) and the lower die, which are the geometric negatives of each other.The press pushes the two dies together, forming the metal sheet into shape (Figure 2a).The essential elements are a stamp, a die, and a set of clamping fixtures (blank holders).The stamp presses the initial sheet, forming the desired shape, while the blank holders control the delivery of sheet metal to the die area [3].The two main qualitative factors in the sheet forming process are formability (e.g., wrinkling caused by excessive local compression and cracking caused by undue local stress see Figure 2b) and dimensional accuracy (e.g., spring-back caused by regeneration of elasticity) -see Figure 2b.
In addition, consistency (i.e., minimizing dimensional changes caused by lubrication, material properties or thickness changes) is a crucial requirement in mass production.Therefore, this technology is in widespread industrial use, especially in the automotive industry [4].However, stamping is restricted by the risk of defective products being formed due to an incorrect forming mechanism.This mechanism is based on the concept of forming, which follows the so-called forming limit diagram [5].Very narrow tolerances imposed by contractors (caused by a highly complex product geometry) can make the occurrence of slight changes in tool geometry, lubrication conditions, or process parameters lead to surface defects, such as cracking or wrinkling (Figure 2).Therefore, the problem of detecting defective products is a critical issue for maintaining the quality and performance of the industrial processes being conducted.The proper development of a solution enabling the elimination of faulty products during the shape forming process seems crucial not only for the efficient running of the production process but also for the development of correct tool geometries in the development phase of the technological process.Currently, visual inspection is one of the main methods used in industry for surface crack detection.Such methods require operators of industrial facilities to pay considerable attention and effort to detect emerging discontinuities on the surface of the sheet metal.Also, this process increases the duration of stamping operations and significantly reduces productivity.Therefore, the authors of this paper present an industrial application of the proposed non-contact measurement method, which would provide simultaneous results for surface cracks during the sheet metal stamping process.
The developed solution concerns using coherent light instead of white light to illuminate the tested surface, which works well in industrial conditions.The lack of space around the devices and difficult production conditions are a big challenge for today's vision devices.However, laser light allows for operating at a considerable distance from the tested product without significant influence of external lighting.However, the proposed lighting has its limitations.A speckle pattern consisting of light and dark fields is created by illuminating a metallic surface with a coherent laser light source.It significantly reduces (compared to traditional lighting) the legibility of the surface.The process of coherent light illumination results from interference and significant laser light scattering.The speckle phenomenon is known in astronomy, where layers of the atmosphere distort images of distant stars.This phenomenon is used in the mechanics of testing materials to study defects and surface quality due to the non-uniform refractive index of light incident on a metallic surface [6].In order to increase the effect of speckle formation, the test surface is given movement.During this movement, the so-called dynamic speckle effect arises, caused by changing the configuration of the rough surface settings relative to the incident coherent light.Through such particle scattering, the interference caused by the coherent light will lead to changes in intensity, and the areas with scattered particles will appear blurry, which increases the readability of the recorded image.Using this phenomenon in a mathematical sense allows a statistical method to process many images of speckle patterns.By averaging individual values, it is possible to reduce the variability in the sample.As a result of averaging the values for individual pixels, the final signal-to-noise ratio should be increased by the square root of the number of images.The presented solution requires an effective packing of images algorithm, commonly called "imagestacking" [7].Completing this process, image analysis for edge detection begins.The effectiveness of edge recognition is closely related to image quality and determines the final effectiveness, accuracy and quality of crack detection of the proposed numerical method.Therefore, apart from the utilitarian goal, which is to run a vision system to control cracks in the stamping technology, it is also planned to determine the effectiveness of the proposed numerical solutions.
The presented research is laid out over four sections in this paper.First, a quick literature review of developments in sheet stamping process control methods to identify defects is presented.A broad overview of the current measurement technologies, contact and non-contact, is take into account.Next, a simple overview of industrial stamping characteristics, including a short description of inspected cracks and mechanisms for sheet metal forming is shown.Finally, the authors present the proposed concept of measurement using vision technology.Detailed information about the apparatus is given and the laser speckle procedure and digital image processing analysis are demonstrated.Calculations were presented to check the effectiveness of the proposed algorithms, both in terms of the image assembly method and edge detection.

LITERATURE REVIEW
Due to the substantial importance of forming stampings, several authors are currently doing increasing work to develop industrial applications to analyse the components.One of these methods is to measure the height of wrinkles, which is achieved by pressing in a closed loop by using a combination of two opposing displacement converters placed in the upper and lower dies.The displacement of two transducers can be used to measure the actual height of wrinkles.This type of contact wrinkle measurement, which uses sensors, has its limitations in industrial applications due to the endurance of the devices.This is due to friction at the end of the sensor, which is in contact with the sheet, and because the locations of wrinkles cannot be known a priori [8].
The most well-known methods include measuring and analysing acoustic signals generated during cracking [9].This approach uses acoustic emissions and is a comparative method that uses amplitude distribution between cracked and non-cracked parts.Since broken parts from the stamping process in the automotive industry release low elasticity energy, a filter set to a specific frequency adjustment range were used.The first sound appears when the sheet is attached to the die.The second sound appears when the press applies pressure to the sheet.The third sound occurs when the press stops and the sheet panel is released.In this process, it was possible to clearly distinguish between a cracked state and a normal state without much data processing.However, no parameters for the detected cracks were given, which may determine the usable range of the solution.The varied nature of the emerging surface defects should be noted.This variety includes all deficiency levels from roughness through local sheet thinning and microcracks up to long tears in the material [9].Defect detection with the use of neural networks is an increasingly common method in the identification of incorrect courses of product manufacturing technology.The presented solution shows the computational process carried out in off-line mode, not only detecting defects but also indicating potential causes of their formation.The approach is original because it assumes the use of data related to the product manufacturing process, i.e. measurement signals from devices, and not data describing the finished product, i.e. images [10].
Another group of techniques already allows identifying strictly defined types of defects, such as cracks above 5 mm long [11].Induction thermography (or induction heating) is based on the induction of eddy currents from an Energy source, such as an examination probe.An induction coil with a short electrical pulse (usually from 50 ms to 1 s) is used without contact with the object, thus generating eddy currents on the surface.Active thermography with induction excitation is a reliable method of controlling magnetic particles on steel car parts.Ferreira's research concerns the control of components in which typical superficial cracks (with a length > 5 mm) and specific orientations are detected using induction thermography.Various sequences of thermal images are analysed and processed to obtain a base image for detecting cracks.Image acquisition begins before induction excitation (cold image), then an induction impulse is generated, and an increase in the temperature in the crack is immediately observed.However, this technique requires additional steps, which can include heating, which may affect the material's properties.In addition, a big challenge is for the operator to detect actual crack locations while dealing with the numerous temperature changes in the image [11].
More optimised and efficient methods using eddy current testing were used to detect structural faults in formed body components.In conjunction with multivariate analysis methods, eddy current techniques have been used to detect cracks and thinning material during deep drawing processes.The procedure was successfully used for offline crack detection.Also, the results show (in some cases) a significant correlation between electromagnetic signals and material thinning.
Furthermore, different materials will cause different responses.Therefore, an advanced learning algorithm must provide the right self-fitting system [12].Non-destructive magnetic research methods include the magnetic flux leakage (MFL) method and the residual magnetic field technique [13], using a magnetic sensor based on a new generation of magneto resistors.The magnetic flux leakage method [14] is the most common and cost-effective non-destructive magnetic testing technique.This method is based on measuring the magnetic leakage field on the surface of the test sample near minor defects, such as cracks.In MFL measurement, it is necessary to visualise the magnetic fields of surfaces being tested with high precision and care.
Another group of methods are based on vision measurements using additional lighting sources.The first is infrared lighting, which due to better reliability, can be used for automatic control of defect recognition thanks to numerous images for each lighting zone taken from different directions [15].This allows increased reliability when assessing detection results.In addition, for better penetration of the examined area, the vision system can be mounted on a robotic arm, which moves over the parts produced on the sheet metal production line [16].The second group of solutions includes many methods that use the dynamic spots effect.This group uses the dynamic laser speckle phenomenon method to analyse laser speckles registered on images captured by a camera.Dynamic laser speckle is called laser speckle imaging and refers to the digital image processing of the scatter pattern applied to a rough surface, usually under deformation.After numerical analysis using autocorrelation, complete characteristic scatter points on the laser speckle activity graph can be plotted.Therefore, it is possible to indicate the moment of cracking and fracture [17].Jasinski's method involved the analysis of images of the speckle effect caused by the emission of coherent light onto the surface of the sheet metal being examined.The phenomenon of the speckle effect is commonly associated with the invention of the laser (in the early 1960s).However, the first mention of this topic was recorded more than 100 years earlier [18].Contemporary speckle metrology plays an important role in optical measurements categorised as direct speckle photography (DSP) and spot interferometry [19].The numerous applications for the measurements and analysis of phenomena in mechanics include the possibility of measuring the roughness of metal surfaces (first concept [20]), the measurement of displacements and deformations [21], surface geometry [22] and recently, study of surface roughness [23].More recently, advanced measurement of surface defects detection under deformation, including crack propagation, has been conducted [24].Another work also obtained displacement and deformation fields by analysing the development of a random pattern of spots captured in the images of the samples subjected to stretching.Numerical image processing in the form of DIC (correlation) was ultimately used to determine the displacement [25].
As for vision studies based on the analysis of the image of the examined surface [26], industrial conditions mean that the proposed solutions must take into account the unstable nature of the measurement environment, such as noise, limited measuring space, the need to make inline measurements, dynamically changing lighting conditions, etc.Therefore, the constantly occurring restrictions in the proposed solutions, such as the appearance of disturbances as a result of microcracks caused by small particles located on the surface between the sheet and the die (tool), the emission of a wave of similar frequency to the material, or the loss of images as a result of light reflections on the sheet surface of the sheet [27] or difficulties in accessing the measurement space due to the limited operation of research devices.This means that more perfect solutions are constantly sought after.
The methods currently used by the industry for identifying cracks appearing on the component's surface can be boiled down to the visual verification of defective products.These solutions require industrial operators to pay significant attention and effort in capturing the resulting discontinuities on the sheet's surface.However, in some cases, defective sheet metal components might be recognised using light passing through or visible through cracks [27].Therefore, visual observation of a component could be accomplished with additional, automatically running notifications, relieving the user.That system automatically detects cracks in the components produced by a stamping process using uniform backlighting.In this solution, the master image is compared to the pictures taken for the inline measurement.In addition, the growing expectations of improving quality leads to quality control on every element taken from the machine.This increases the implementation time of individual forming operations and reduces performance.Newman and Jain [28] proposed a solution using a vision system to control stamped products' quality.Recently, these techniques are rapidly entering the automotive industry, making them the most valuable implementation among all sectors, confirmed by statistical market analysis.In turn, among a large group of vision technology, quality control is the second most crucial factor in the growth of vision innovation.
From the perspective of the descriptions presented above, the authors propose a solution to inline measurement of defects that will allow a complete 100% control of flaws and full assessment of the manufacturing technology.At the same time, industrial process tasks are carried out, which enters the contemporary concept of industry 4.0.

EXPERIMENTAL APPARATUS AND PROCEDURE
Typical defects during the industrial stamping process include cracks resulting from material hardening due to exceeding strain limits.The less visible effects of reaching the material's critical deformation phase can be the location of the deformations, which takes the form of local sheet thinning (Figure 3).This leads to the phenomenon of microcracks immediately preceding the moment of the material's final separation.In turn, the formation of microcracks takes three forms: the formation of new microcracks (as the initial stage of the agglomeration of a phenomenon), the microcracks (creation of clusters), and the growth of individual microcracks.As seen from the abovesimplified description, the cracking phenomenon results from a growing front of deformation.It isn't straightforward to predict in real time because of its local nature and development speed.Therefore, in industrial practice, a typical defect is assumed to be the condition of the sheet, where the resulting discontinuity of the material can be seen, even though local thinning itself in the form of advanced clusters of microcracks disqualifies the usefulness of the drawpiece for further technological operations.Figure 3 presents the image of the surface crack that has been investigated.The crack's geometrical topography has been measured using a 3D laser scanning microscope, where the width and depth are approximately 100 mm, and the length is 1 mm.Another group of factors that hinder the detection of defects is the difficulty accessing the surface of the sheet to be tested due to the die geometry in industrial conditions.Therefore, the typical methods of component quality control proposed in this area are carried out after forming operations have ended, outside the working space, often for a selected statistical group of parts, leading to significant material losses.However, assuming the possibility of implementing measurements in the functional space of the press, the essential factors delaying measures include short measurement time (about 3 seconds), demanding access to the examined surface due to the working space, and unfavourable environment (noise, vibrations, unstable lighting, human interference).
The solution proposed by the authors is based on the images captured and their numerical analysis.As lighting, a laser light source was presented in the infrared wave.Combining these two automatic measuring techniques allows for realtime measurements, away from the press, without concern for the negative impact of external lighting.The limitation of the proposed solution is the need to determine the examined area, which in the case of the industrial forming of body components is the corners of the stamping.That is why the proposed number of vision systems is ultimately the same as the number of potential places for cracks.Also, it needs to be point out that at this level of investigation, the proposed method is limited to the surface crack detection only.
The proposed measuring system is an integrated vision system and a lighting system mounted on a tripod using fastening components (Figure 4).The vision system consists of two cameras and prisms set in a special housing.Cameras allow the capture of two images of the same area simultaneously.The lighting system consists of a laser device emitting infrared light (not visible to the human eye) and a lens that increases the diameter of the beam falling on the test surface, as seen in Figure 4.In addition; the camera system uses a filter system that allows observation of the image in daylight and in infrared.For camera no. 1, a wavelength filter above 815 nm was used, permitting only daylight observation of the test surface.In turn, camera no. 2 uses a filter that only allows infrared light emitted by the laser to pass through.The vision part of the measuring system sends the received images to the computer's memory via the Gigabit-Ethernet interface, where they are saved and subjected to further numerical analysis.The implementation of control and communication tasks between the computer and the vision system is provided by the Matlab/Simulink environment.The proposed solution allows simultaneous The following step must be performed to complete the proposed measurement procedure.First, the laser light should be pointed at the potential crack area.One measuring system should be assigned to one measuring area.There are no restrictions on the distance between the measuring system and the component.The properties of laser light and vision system let the user adjust a considerable distance from the sheet metal part that must be tested (since laser light is highly directional).Also, the visible light conditions in the measurement area do not affect the final results (since infrared light has wavelengths longer than those of visible light).Secondly, capturing the last few seconds of the final product relocation and generating laser speckle imaging should be possible.After the acquisition, the cumulative image is computed for the dynamically changing speckles.Further calculations take place automatically and include digital image processing.The advantage of this measurement system is that the user can easily verify the results generated immediately after finishing loading images.Therefore, for the possible errors (e.i.recalibration of the optical system), it is possible to adjust the measurement system quickly.Figure 5 shows a schematic of obtaining laser scatter patterns resulting from the dispersion of the incident coherent laser beam irradiating the test surface.For the static system, this image does not change.Only during changes in surface geometry, a dynamic effect of change in intensity appears.The solution proposed by the authors improve upon their 'earlier solution [29] for static measurements of laser spots.In the new approach, the dynamic spotting effect is analysed.During the inline industrial part of the process (immediately after the stamping process), when the die reveals the surface of the sheet, images of the surface illuminated by the laser are captured.Then a set of speckle images are recorded (during a slight movement of the surface of the sheet being tested) and finally accumulated into one image.A phenomenon was used here, in which changes such as cracks on the sheet's surface reflect laser spots back with poor intensity or not at all.The dynamic laser speckle effect, which provides many images with variable intensity of the same area, is the key to obtaining a better contrast of defects against the background of the rest of the surface.In the next step, a fundamental digital image processing procedure is demonstrated to characterize automatic surface crack.The proposed solution includes edge detection that identify pixels location at which the speckle image brightness changes sharply.

SHIFT-AND-ADD SPECKLE IMAGING ALGORITHMS
The proposed method to improve the image quality has been utilised in astronomy since the middle of the last century when the CCD was first developed [30].Therefore, this method is often called Shift-and-Add (SAA).This solution captures several images of the dynamically changing speckle with short exposure times and varying image shifts.Finally, a single image output is generated with high quality as a result of compiled images.It has been shown that the quality of images reconstructed using SAA with which they are created depends on the algorithm by which the images are shifted and added [31].
Therefore, these activities have been given numerous solutions determining the final results, among which we can distinguish [32]: central-of mass, iterative weighted, self-deconvolution, continuous convolution, and cross-correlation.However, incorrect shifting of the images or their summing can lead to numerous changes in the spatial reconstruction, significantly increasing the background noise in the image.Therefore, concerning the calculation of shifts between the images, a different method was used, based on edge detection (described in detail in the literature [33] and implemented in the Matlab environment under the name "image stabilization").For this purpose, the camera's movement was removed by locating a characteristic point (arbitrarily selected) and moving it relative to the first image.Tracking a defined object allows one to determine in each subsequent video stream frame how much the target has moved relative to the previous frame.
Based on this information, the program calculates the displacement vector Vt between the target object and its original position (Fig. 6).
As a result of the measurements of displacements, a vector of displacements of individual frames of the recorded animation was obtained.The authors have described and compared two image composition algorithms in detail, i.e., averaging and maximizing pixel values.In the first algorithm, the displacement vector represents the following form: (, , ) = This information was then used to remove camera movement and generate stabilized video, i.e., shifting each frame to remove camera movement from the video stream.Hence, the cumulative image resulting from summing the intensity values of individual pixels (averaging) for individual frames of the movie will be represented by the following form: (, ) = where: I i (x,y) is a i th speckle image and N represent the number of images.
The summary of the averaging results shows the final image in the enlarged crack area (Figure 7).In addition, to better illustrate the averaging effect, the result of a single cross-section (2D) is shown in the zoomed image as a white line.The averaging results (green line) indicate the flattening of the intensity values, leading to their averaging relative to the initial image (red line).In the second algorithm, the process of replacing pixels with a lower intensity value was provided according to the mathematical description: (, ) = max ∈   ( −   ,  −   ) (3) Figure 8 demonstrates the original (red line) and the improved data (green data) together with of the surface view and zoomed area of the crack.

ESTIMATION OF STATISTICAL PARAMETER
In order to quantitatively assess the quality of the images obtained using the SAA technique (before the filtering process), supplementary calculations were performed for the two proposed algorithms for image assembly, i.e. averaged and pixel maximised.For comparison, the calculations were also performed for a series of recorded images without any displacements or assembly.The image quality index was assumed to be the signal-to-noise ratio (SNR) in the calculations.The estimation of this coefficient shows the noise level, where the size of the coefficient is inversely proportional to the amount of noise [34].Brighter areas have a stronger signal due to more light, resulting in a higher overall SNR.The SNR is expressed in decibels and is defined as follows: where: σ 2 g -the variance of the image relative to which the reference image is determined, σ 2 e -the variance of the error (between the reference image and the noisy image).The composite of all images for two methods was taken as a reference image.Also giving SNR results for the originl images without any additional calculation (Figure 9).
The obtained two characteristics (blue -pixel maximization, green -averaging) illustrate the impact of the image composition algorithms on the final image quality.It can be seen that both methods lead to an increase in the final quality of images compared to the characteristic of single images (red line).Then, in order to select a better solution (algorithm) from the averaging and maximization method, the two images were compared with the image obtained in white light (Figure 9a).The calculations were carried out for the selected area covering the crack (Figure 9b,c,d) and after normalizing the images to the same brightness level.The SNR ave =8.3 was obtained for comparison of the original images with the averaging technique, and SNR max =7.6, respectively, for comparison with the image obtained from maximization.Therefore, finally an averaging algorithm was used for further calculations, due to smaller fluctuations in brightness levels (as shown in the Figure 10)

IMAGING FILTERING
A less noisy image still reduces contrast and leads to difficulties performing image processing operations such as edge detection and segmentation.Difficult-to-detect details (cracks) require further processing.For this purpose, band-pass filtering and edge-detection procedure was utilised spatially.Its isotropy allows the adoption of the same edge detection criteria regardless of the direction.Unlike other operators, it does not require the creation of an algorithm for connecting pixels forming the edge of the so-called chain code.It only requires action to determine the location of pixels, the so-called zero-crossing [36] (Figure 11).In order to present the second derivative, the discrete interpretation of the first derivative and its differential form were used: (1) Hence, based on the graphical description (Figure 11), it can be written: finally obtaining the following form: (  ,  +1 ) = { 1,    >    +1 <     <    +1 >  0, ℎ.
So, one can use the simple operator [1, −2, 1] to approximate the second derivative in one dimension.In order to obtain a two-dimensional record, changes in the other direction must be taken into account: which is an operator realizing changes of the second derivative in two directions, leading to the following discrete form.
Zero-level image binarization can be used to find edges.However, keep in mind that the Laplacian operator is sensitive to noise.This sensitivity of the operator is due to the sensitivity of the zero crossings and the differentiation method.In general, the higher the derivative, the more sensitive the operator.However, using a second filter (Gaussian smoothing) can avoid such problems, which leads to a complex form of notation.Hence finally the basis of the proposed cracks detection method is a modified filter called Laplacian of Gaussian (LoG).However, to approximate the results of LoG and reduce the computational costs Difference of Gaussians function (DoG) is commonly used [35].This valuable numerical First, the effect of Gaussian smoothing is applied to blur an image in the following form: with: -∞ < x,y < , and σ > 0; where: σ -the standard deviation and σ 2 is the variance.Next, the edges of variable-contrast objects are determined using the second derivative as follows: The filter characteristic (3) is mainly defined by the size of the sigma factor (σ). Therefore, it is possible to smoothly adjust the sensitivity of defect detection and let the user determine the level of sensitivity at which he accepts defects.Next, spatial filtering was used in the edge detection calculations, which involves the discrete convolution operation typical of image processing operations [32].In this calculation, three design parameters are chosen experimentally (sigma values, the accuracy of defect determination -first parameter, kernel interval -second parameter and grid step -third parameter), as shown in Figure 12.Finally, after the convolution computation, the edge of the defect is recognised by using the "zero cross" detector [37].In this calculation, in contrast to the commonly used solution, it was proposed to increase the cut-off level to an experimentally determined value other than zero, referred to as the sensitivity of the method.This modification of the above filter (3) introducing an additional parameter (T) to the numerical procedure.The parameter (T) let the user to change the sensitivity of defect detection.In this method two continuous samples are compared to see if there is a (T) level, as describe:  (11) (  ,  +1 ) = { 1,    >    +1 <     <    +1 >  0, ℎ.
The (T) parameter is consider as amplitude high of the zero-crossing line level.The advantage of this solution is to save a computation time, less sensitive to the noise and most important, additional parameter, that is rresponsible for the sensitivity of defect detection.
The presented result of the image processing for the analysed defective part demonstrates a recognised crack.First, the captured image was denoised through the lower-pass filter smoothing the original image (Figure 13a).In contrast, the edges of the cracks are strengthened through the high-pass filter (Figure 13b).An additional effect of strengthening the rupture edge line in a filtered image was obtained through multiplication with the original image.The final stage of numerical processing of the image includes zero-crossing edge detection.Finally, morphological operations carried out on the binary image were used to graphically present the geometric features of the resulting rupture (Figure 13c).

IMAGE RESOLUTION
The method's sensitivity can be considered in two ways: physical (resulting from the resolution of the measurement system, including optics and CCD) and technological (resulting from the type or size of the crack.Concerning resolution, the limit will be the number of pixels per speckle and pixels per crack.In the first case, it is directly related to the type of lighting and the measurement technique that uses the dynamic speckle effect to recognize a crack when assembling the images, and in the second case, to the static visibility of the crack (the slightest crack visible in the image should be at least the size of a speck).
For this purpose, speckle size was calculated by determining the normalized autocovariance function obtained in the observation plane, corresponding to the intensity autocorrelation function.It has a zero base, and its width allows the measurement of the "average width" of the cl spot [38].The c I (x, y) value is calculated from the intensity distribution of the recorded image or series of images (average value) according to the following relationship: (  ,  +1 ) = { 1,    >    +1 <     <    +1 >  0, ℎ.(14) where: FT is the Fourier transform, FT-1 is the inverse Fourier transform, 〈I(x,y)〉 is the average image intensity, c_ I (x,0) and c_ I (0,y) are, respectively, horizontal and vertical profiles for the values c_ I (x,y).
In the implementation of measurements, it is essential that the size of the spot is significant to the size of the pixels, which will enable the observation of appropriate intensity changes during dynamic image transitions [39].As a result of the calculation of the 2-D Fourier transform of the image data and the normalization of the values with the shift of the zero frequency component to the centre of the graph, the waveform of changes in the average speckle sizes for different magnifications was obtained (Figure 14).The setting parameters in the calculations result in six pixels in speckle diameter.As the magnification is further reduced, this number decreases to four.In the calculations for smaller images, a significant effect of noise and difficulties in correct crack recognition was noticed (Fig. 1).Hence, a minimum speckle size and a minimum crack size of 6 pixels in both cases is prescribed.Determination of the speckle parameters (size, contrast, intensity) is also a valuable source of information about the scattering conditions, i.e. surface quality.The use of dynamic structure analysis becomes a valuable tool in the measurement of not only cracks but also the measurement of material roughness [40].Therefore, the current limitation of measurements only in the field of cracks can be successfully extended.They use this technique to identify earlier stages of destruction, such as thinning or wrinkling of the surface.

CONCLUSIONS
A method of detecting surface cracks in industrial forming -stamping -of car body parts was presented in this paper.A unique research experiment was developed to verify the proposed algorithms, enabling real-time measurements.The Matlab/Simulink environment was used for the proposed solution to implement digital image analysis and control the vision system.For dynamically changing speckle pattern were collected and analysed for images of surface crack.This analysis uses the fact that the geometric irregularities in the defect area are reflected in changes in the intensity of the spots.In the presented study, two SAA algorithms were verified.The SNR statistical parameter of these solutions were measured (i.e.averaging and maximizing pixel values) for a sequence of captured images.The calculations were compared with images without signal amplification, demonstrating increased final image quality.Two types of filters have been applied: smoothing and edge detection.As a result, the output is represented as two images: an actual image of the measured area and an analysed image for necessary verification.The performed calculations and experiments imply certain conclusions depending on the adopted assumptions and analyzed lighting settings and conditions prevailing in the industrial process: the concept of coherent lighting at long measuring distances from the metal surface and difficult industrial conditions was verified.Where incoherent light does not work, laser lighting provides the opportunity to obtain sufficient image quality for further digital image analysis; the results indicate that the proposed solution allows the implementation of crack-detecting tasks in specific areas of the sheet metal, taking into account difficult industrial conditions, impossible to achieve by other techniques; an important conclusion emerges from the analysis of the sources dealing with defect detection.A vast majority of the systems applied these days possess many limitations when applied to automated mass production lines (e.g., fast production speeds, challenging lighting conditions, vibration and noise, pollution and dust or accessibility because of the nature of the closed shaping process); the vision system proposed by the authors and digital image processing based on laser speckle imaging is a simple, quick, and reliable solution.Application of the proposed method extends the traditional limitation, which is a time-consuming computation that always leads to offline analysis.Since, for the industrial technology it's also necessary to detect the initial phase of the sheet metal forming (such as necking or strain localization), it is planned to develop additional computation algorithm to recognized other levels of the final product quality using speckle size analysis.