1 Introduction

CFCs are a popular type of material with excellent strength and stiffness-to-weight ratios, making them perfect for usage in aerospace, automotive, and other sectors [1,2,3]. Due to their remarkable strength-to-weight ratio, CFC materials are a clear improvement over conventional metal [4, 5]. This implies that a certain quantity of composite material may be both lighter and stronger than a corresponding amount of metal, enhancing performance and fuel efficiency in a variety of applications. When compared to metals, CFC materials can sometimes offer a strength-to-weight ratio that is up to 20% better [6]. This is especially true for the aerospace sector, where lowering weight is essential for improving aircraft performance and cutting fuel use [7]. CFC requires diverse materials with complementary features, including high-strength fibers and lightweight resins, which contribute to achieving these privileges [8, 9]. However, these materials are prone to flaws such as voids and delamination, which can weaken the structure and threaten the material’s integrity. As a result, developing accurate and efficient methods for defect identification and characterization in CFC is critical to ensuring their safe and effective usage in a variety of applications. X-ray radiography, ultrasonic testing, acoustic emission, and thermography are common techniques for finding defects in CFC panels [10]. The process of X-ray radiography involves transmitting X-rays through a substance and recording the resultant picture on a detector [11]. The resulting picture may expose internal flaws. This approach, however, is restricted in its capacity to detect faults that do not have a considerable variation in density from the surrounding material [12]. Another non-destructive (ND) technique that employs high-frequency sound waves to find imperfections in CFC materials is ultrasound testing [13]. To determine the position and magnitude of internal faults, the approach includes passing an ultrasonic wave through the material and detecting the reflected signal. Small flaws can be found via ultrasonic testing. However, it is constrained by its sensitivity to fiber orientation and the challenge of identifying surface-perpendicular flaws [14]. Defects like fiber breakage and matrix cracking may be located using the acoustic emission approach [15]. Its limitations, however, include its inability to find minor flaws and sensitivity to noise interference [16]. The CFC material’s surface is heated in order to measure the heat distribution as it cools down using infrared (IR) thermography [17, 18]. Defects like vacancies and delamination can be seen in the final picture. The method’s sensitivity to surroundings, however, places certain restrictions on it [19,20,21]. The use of HSI for the identification and characterization of flaws in CFC materials has therefore gained increasing attention. This ND imaging technology offers high-resolution spectral data regarding a composite’s material characteristics and structure, which can aid in more accurately identifying and characterizing faults and other irregularities. It captures images of a scene at many wavelengths spanning the electromagnetic spectrum, often from visible light to near-IR [22]. The resultant hyperspectral (HS) picture is a 3D data cube with the spatial dimensions of the scene represented by the x and y dimensions and the spectral dimension represented by the z dimension. Indirect contact with the material reduces the chance of damage during examination. There are a few drawbacks to HSI, though, which must be taken into consideration. HSI produces an abundant amount of data, and its analysis may be difficult and time-consuming [23]. In the realm of defect detection in industrial processes, numerous studies have employed diverse computer science approaches to identify and address challenges. Previous research, such as those highlighted in references [24,25,26], have explored various methodologies to enhance defect detection across different domains. These studies collectively contribute to the evolving landscape of computer science applications in defect identification, paving the way for innovative solutions. Building upon this rich foundation, our current work seeks to make a valuable addition and can be seamlessly integrated with cube images into this body of knowledge. For HS imaging, a simpler alternative like k-mc might be more direct to implement. K-means clustering is a well-established method for image segmentation, including HS images. It groups pixels with similar spectral characteristics, making it relatively simple and interpretable.

In this study, a method for automated characterization of CFC using HSI and k-mc is proposed. Therefore, initial advancements in experimental work towards the establishment of a physical laboratory setting for images obtained with an HS imager have been made. The halogen bulb was simulated as a point source with a Gaussian angular distribution that emanates light behind the HS camera. With the suggested arrangement, the diffusely reflected spectra from the investigated CFC were able to be recorded. The proposed k-mc algorithm is an iterative method that partitions a dataset into k clusters based on their similarity [27, 28]. It works by randomly selecting k points in the dataset as the initial centroids, then iteratively assigning each data point to the closest centroid and updating the centroid of each cluster based on the mean of the data points assigned to it [29]. The proposed k-mc approach offers several advantages [30,31,32], particularly when dealing with large HS datasets. Its simplicity and computational efficiency make it well-suited for handling substantial amounts of data. The clusters generated by k-mc are not only easy to visualize but also straightforward to analyze, enhancing interpretability. In the realm of ND evaluation of CFC materials, k-mc proves valuable for grouping faults identified through HSI. The approach enables effective defect identification and classification by classifying comparable flaws based on their spectral properties. This may result in a decrease in the amount of time and money needed for inspection while also increasing the reliability of flaw identification in CFC materials.

By merging HSI with k-mc, the suggested technique for automated characterization of CFC has the potential to offer a more automated and objective way of flaw identification. This unique combination of HSI and k-mc represents a valuable contribution to the field, offering an efficient strategy for defect detection in CFC materials. This can be especially helpful in manufacturing environments where it is necessary to quickly and accurately evaluate lots of CFC parts. Additionally, the technique can lessen the need for humans to analyze HS pictures, improving efficiency and lowering human error. Our proposed method has the potential to progress the creation of CFC-automated defect detection systems, enhancing their performance and safety in a variety of applications.

2 Materials and methods

For our characterization, two sheets of CFC made from polyacrylonitrile (PAN) materials, specifically HexTow® AS4 CF were utilized. The production of this CFC involves a controlled heating process at high temperatures, carried out in the composite material laboratory within the Aircraft Mechanics Department (MTC, Egypt). This process results in the formation of the composite, comprising thin, thread-like filaments predominantly composed of carbon atoms. The first one is used to calibrate our proposed imaging method, followed by comparing the investigation results with a gold-standard method to assess our technique. Our HIS setup captures regions of interest on this sheet. The first area (A#1) is a clean one without any defects, while the other (A#2) is defected with five straight lines made by us using a wide blade cutter (sub-millimeter slits), as shown in Fig. 1a. These two regions (A#1 and A#2) on this sheet were evaluated using a portable 3D scanner-handy scan (HandySCAN BLACK™|Elite, Creaform Inc., Canada), as depicted in Fig. 1b. The scanner scanned the two areas (A#1 and A#2) and measured the man-made silts at A#2 to be about 0.516 mm. A second CFC sheet, exhibiting irregular and varied cracks due to incorrect manufacture, was employed for evaluation using our suggested approach, following the findings of the first CFC sheet evaluation, which will be presented in the next section. In the evaluation of the second CFC panel, a spectrum of irregularities was encountered, each contributing to the overall characterization of the material. Deep tracks, identified as grooves penetrating the material’s surface, were observed at various locations across the panel. These tracks exhibit varying depths, ranging from sub-millimeter to more pronounced features, providing insight into the material’s structural integrity. These irregular cracks, displayed in diverse sizes and shapes, could compromise the mechanical properties of the composite. Near-surface defects, manifested as subtle deviations in the material’s composition, were also identified during our inspection. Furthermore, surface scratches were present on this panel, representing superficial imperfections that could impact the material’s aesthetics and potentially serve as precursors to more severe damage. The amalgamation of these irregularities in the second CFC panel highlights the need for a comprehensive and precise inspection methodology, such as the one proposed in this study, to effectively identify and characterize a diverse range of defects in CFC materials. Six samples from the second CFC panel (S-1 to S-6) were chosen for characterization, as displayed in Fig. 2a and b.

Fig. 1
figure 1

CFC panel setup for our HSI examination study. a The initial CFC sheet featuring two designated areas for imaging calibration, marked with five straight reference lines in Region A#2. b Implementation of the standard 3D handy scan technique precedes the application of our proposed method

Fig. 2
figure 2

a, b The second defected CFC panel with six regions to be examined (S-1 to S-6) using our HSI setup with the k-mc approach

Next, the contribution of our study is highlighted, utilizing a specialized image processing technique for the collected cube pictures to categorize and group the defective regions according to their signatures. An HS imager with a spectral range of 0.4–1.0 microns, featuring 520 pixels per line in line-scanning mode, a spatial resolution of less than 40 microns, and an average of 696 lines per cube, was employed to capture detailed HS cube pictures for the fault’s lines or spots in the two investigated CFC panels. The schematic representation of the imaging system is depicted in Fig. 3.

Fig. 3
figure 3

Schematic depiction of the HIS arrangement for CFC panel characterization

The SOC710 imager from Surface Optics Manufacturer, USA was employed, featuring a spectral resolution of approximately 5 nm and capturing 128 frames, each representing a distinct wavelength for our visible to near-infrared research. The Schneider Xenoplan optical lens used had a 10° field of view and a 35 mm focal length, positioned at a distance of approximately 40 cm. This distance ensured that both the HS camera and the CFC samples under study produced sharp images. For precise diffuse reflection spectra, a broad-spectrum light source (20 Watt) with a wavelength range of 0.4–1 micron (Derungs, 20 P SX, Germany) was employed. This light source, known for its uniformity, proved suitable for our assessed HS imager. Positioned nearly 0.5 m away from the optical workbench and at a 45-degree angle from the HS imager, the light was focused on the two investigated CFC sheets, as illustrated in Fig. 4. The Lab setup, depicted in the figure, outlines our CFC characterization process for detecting defective regions in the second CFC sheet, involving six regions based on the proposed k-mc approach using HS images.

Fig. 4
figure 4

The HSI benchtop arrangement used for the second CFC panel characterization

Figure 5 illustrates the image processing flowchart that led to our insightful results, evaluation, and key conclusions. The laptop-based system in our experimental setup, operating HS-Analysis TM Data Analysis, played a pivotal role in controlling the linear scanner’s motors, adjusting exposure settings, and gathering information on the diffuse reflection characteristics. Furthermore, this laptop-based system facilitated the application of our advanced image automatic inspection for CFC flaws. This involved an advanced combination of image preprocessing techniques with a clustering algorithm based on the k-mc method. This comprehensive approach ensured enhanced defect detection and characterization in CFC materials.

Fig. 5
figure 5

Block diagram of the image processing technique used in this work using the HSI system

For optimal signal-to-noise ratio results, calibration of the HS pictures is essential before commencing our experimental work on characterization. A spectral image captured from a white reference sheet with a high reflectivity standard is used to calculate the background response. A dark, non-reflective lid is placed over the whole camera lens to give an appearance that it is black. Using these two collected reference pictures, the formula below is then utilized to determine the relative reflectance for the captured photos [33, 34].

$${I}_{{\text{fc}}}=\frac{{I}_{{\text{oc}}}-{I}_{{\text{Dc}}}}{{I}_{{\text{Bc}}}{-I}_{{\text{Dc}}}}$$
(1)

where Ifc is the corrected spectra response, Ioc is the raw spectra response, IDc is the dark recorded picture, and IBc is the white recorded picture. The visible-NIR F/1.9 lens of the SOC710 HS line scan camera was initially focused on scanning the six studied regions (S-1 to S-6) of the second CFC sheet. After the final line of scanning was finished, the references in black and white were recorded down. According to the light theory of interaction with matter, when a CFC sample is exposed to light, the remaining reflection is either absorbed, dispersed by the microscopic surfaces of the molecules, or transmitted through the sample’s surface and into the composition of the cell. Our imaging strategy took into account diffuse reflectance, which happens when light entering an object is reflected in several directions. The data gathering process for CFC samples examined the photons’ intensity, or how it fluctuates with wavelength [35, 36]. Following HS picture calibration, as depicted in Fig. 5, we employed histogram statistics to examine the distribution of pixel intensities across all spectral bands. Simultaneously, we could identify any potential data problems or artifacts that might impact the clustering outcomes. Analyzing the intensity values of pixels in a captured image allowed us to gain insights into the qualities and features of the CFC panel picture. By undertaking this study beforehand, we ensured that the normalization procedure was based on accurate and reliable data. Additionally, this process enabled us to determine the optimal number of clusters for the k-mc phase and gain a deeper understanding of the overall distribution of the data. The captured cube image preparation involved intensity normalization for the values of all pixels in the output data as well as equating the most bright and dark pixels that belonged to a certain material. To compare the findings of our analyzed materials’ diffused reflectance spectra, any dark or shining patches in the image are also removed, and lighting differences are deleted. However, because of the inadequacies in the image collection techniques, the calibrated acquired images are prone to a variety of errors, demanding further processing. As a result, we employed a method that combines picture normalization and enhancement for our analysis. This involved using a widely recognized technique called 8-bit normalization, where the intensity values of each pixel are scaled to an 8-bit range (0–255), aligning with the standard RGB image range. Our choice of this technique, compatible with our processing tool (DADiSP 6.5), contributed to improved data visualization and analysis capabilities. This phase played a crucial role in ensuring that all spectral bands received equal weight in the subsequent clustering analysis, thereby minimizing the impact of variability and noise in the collected data. Following these image preparation stages, we successfully extracted spectral information from each part of the picture, enabling us to pinpoint the ideal wavelength for the automated characterization of CFC panels. To improve the accuracy of our computations, we used histogram equalization and moving average (MA) filtering in our pre-processing imaging modalities. The histogram equalization method’s fundamental principle is to disperse the image’s intensity values over a wider range to make the features in darker areas more obvious. In order to further denoise and reconstruct the image, the following formula was applied to our MA filtering in the following phase [37, 38]:

$$F\left(x,y\right)= \frac{1}{n \times m}+ {\sum }_{(k,z)\in w}^{\infty }NI(k,z)$$
(2)

where the operation is performed via a size of “n × m”, the recovered image is denoted by F(x,y), NI is the noisy image, and “z” and “k” stand for the window’s “w” column and row coordinates, respectively. The last step was to segment the image using k-mc contour mapping, which was developed to measure and analyze differences in the HS characteristics of the tested CFC surface and could provide an immediate evaluation for the panel under investigation. The goal of k-mc is to create k centers—one for each cluster. Typically, in order to increase the identification rate and reduce the probability of false signals, they should be positioned as far apart as is practical. The next step is to link each point in a specific collection of data to the closest cluster center. Each category will have a center point in this method, and as iterations increase, the result becomes increasingly consistent, signifying that they have come to a point of agreement. Using our histogram calculations for the investigated CFC panels, we used k-mc to the normalized HS picture data with k = 8, a choice determined as the best compromise between accuracy and output speed. The fundamental steps in the k-mc algorithm for selecting clusters are described in Eqs. (3) and (4) [39,40,41]. The optimal solution, J*(V), is first minimized by this approach utilizing:

$${J}^{*}(V)=\sum\nolimits_{i=1}^{m}\sum\nolimits_{j=1}^{{m}_{i}}{\left(\Vert {z}_{{\text{i}}}-{ce}_{{\text{j}}}\Vert \right)}^{2}$$
(3)

where “||zi – cei||” is the Euclidean distance between zi and cei, m is the number of cluster centers, mi is the number of data points in ith clustering, Zi is the collection of data sets to be clustered, and cej is the set of d-dimensional centroids. The formula for the minimum-distance classifier is used to generate the new cluster centroid, cei:

$${ce}_{j}=\frac{1}{{m}_{i}}{\sum }_{j=1}^{{m}_{i}}{z}_{i}$$
(4)

The suggested k-mc allowed us to separate pixels with comparable spectral properties into distinct groups. This enabled us to accurately and swiftly identify the faulty spots in the investigated CFC due to the clusters that were produced. The DADiSP 6.5 tool suite (DSP-Development Corporation, USA), which was used for the assessment of the cluster maps and the application of the contour mapping mask overlay over the defective regions, served as the foundation for the majority of the image processing algorithm sequence.

3 Results and analysis

These studies are intended to show that the HSI method can detect and categorize defects in CFC panels based on their reflectance spectra. The two CFC sheets were illuminated by a source of white polychromatic bulbs (0.4–1 µm). After imaging setup calibration, the HSI investigation included two regions (A#1 and A#2) for the first investigated sheet, and the other included six test regions (S-1 to S-6). Each test was run at least twice in order to guarantee reliability. Every CFC region provided HS images, which were collected. The spectra of both normal surface and defective CFC areas were compared using intensity analysis of the spectrum data. Based on intensity measurements, we could detect the CFC cracks based on the k-mc approach after applying histogram computations. The average of all the tested diffused spectra characteristics of both panel surface and crack for the eight test CFC areas are explained in Fig. 6a and b. Figure 7a and b depicts our imaging approach’s ability to obtain descriptive statistical measures in histogram, mean, and standard deviation (SD) for the tested CFC regions.

Fig. 6
figure 6

The HS computations outcomes for the two CFC sheets. a The obtained diffused spectra characteristics of the CFC normal surface panel. b The obtained diffused spectra characteristics of the CFC defects (relative units to the white recoded picture [R.U.])

Fig. 7
figure 7

Hyperspectral analysis outcomes for the two CFC sheets. a Average composite of the computed histogram. b Average composite of the computed mean. c Average composite of the computed standard deviation (SD) for both the normal surface and defected regions of the CFC sheets

Figure 6a and b shows that the CFC sheets’ peak variability in the dispersed reflectance bandwidth for both normal surface and defective sections is always higher in the range of more intense contrast from 440 to 600 nm. Given that the two spectral signatures are similar throughout the tested CFC panels, signal intensity may be able to provide further differentiation for both CFC normal surfaces and defects. The intensity value at a wavelength of 445 nm was observed to be approximately 42 (R.U.) for the defective CFC areas, while it is equal to about 150 (R.U.) in the case of normal surface CFC. The highest intensity for the CFC normal surface occurred at the 546 nm and 585 nm wavelengths, with an intensity of about 510 (R.U.) compared to only 90 (R.U.) for the cracked CFC. In the meantime, we utilized a histogram analysis for recorded cube image inspection, which enables us to assess whether we could distinguish between the tested normal and defective CFC based on their spectral signature, which could then be clustered using our proposed k-mc approach as shown in Fig. 7a. Our statistical computations for mean and SD, which are illustrated in Fig. 7b and c, are 0.34 and 0.33 for the CFC normal surface, respectively, while they are about 0.43 and 0.29 for the CFC crack. The clear variance outcomes in mean and SD enable us to get precise clustering between normal and defective CFC using our methodology based on the k-mc approach. Figure 8 shows the results of applying our proposed technique to the first tested CFC sheet with the normal area (A#1) and the defective area with straight slits (A#2) using (k-mc) at the 445 nm HS image.

Fig. 8
figure 8

The 445 nm HS images classification with instant CFC characterization using our proposed computations for the two areas of the first CFC panel (A#1 and A#2)

As illustrated in Fig. 8, our proposed imaging approach could detect the man-made slits in the tested A#2 of the first CFC using the 450 nm spectral image taken by the SOC710 HS imager. These outcomes have been assessed with the standard method taken by the portable 3D scanner shown in Fig. 1. Due to the HSI foundation of our imaging technology, we were able to use a flexible approach to track several layers of the CFC panel under study that were associated with various wavelengths. To measure the fracture penetration depths in each area under examination (S-1 to S-6), we selected spectral signatures at 445 nm, 546 nm, and 585 nm as our optical markers, since the variance in the diffuse reflected spectra intensity is achieved clearly at these wavelengths. Figure 9 displays the HS pictures associated with the selected spectral frequencies for sample #1 (S-1) of the second investigated CFC.

Fig. 9
figure 9

HS images at specific wavelengths (445 nm, 546 nm, and 585 nm) captured during the automated characterization of the CFC specimen S-1. The unique spectral information at these wavelengths aids in the precise identification and classification of defects

To validate the reliability of our data results and to analyze the spectral responses at selected wavelengths (445 nm, 546 nm, and 585 nm) for defects in the CFC region, we employed our proposed optical diagnosis strategy. Our approach involves the systematic application of image preparation techniques to enhance the quality of HS images and facilitate accurate characterization of different layers of the CFC panel. Specifically, Fig. 10 illustrates the outcomes after applying both histogram equalization and MA filtering (with a kernel size, K, set to 10) through our imaging preprocessing algorithm on specimen S-1. Histogram equalization is employed to enhance the overall contrast of the images by redistributing pixel intensities, ensuring a more balanced representation of the spectral information. This operation contributes to the improved visibility of subtle features and defects within the CFC panel. Simultaneously, MA filtering, with a chosen kernel size of 10, is applied to suppress noise and enhance the clarity of the images. The selection of K = 10 is justified based on a careful consideration of the trade-off between noise reduction and the preservation of relevant details. A larger K value tends to smooth the image more aggressively, potentially leading to the loss of critical information, while a smaller K may not effectively suppress noise. Therefore, the choice of K = 10 strikes a balance, allowing for noise reduction while preserving important spectral details. This tailored combination of histogram equalization and MA filtering optimizes the quality of the HS images, ensuring that subsequent analyses, such as defect characterization, are performed on images with enhanced clarity and fidelity.

Fig. 10
figure 10

Computational outcomes after applying the proposed image preparation methodology on CFC specimen S-1. a Processed image at 445 nm. b Processed image at 546 nm. c Processed image at 585 nm. The preprocessing enhances the quality of the HS images for subsequent analysis

In demonstrating the efficacy of our image preprocessing technique for identifying panel fractures using selected spectral signatures on specimen S-1 (Fig. 10), we observe the nuanced details revealed by our approach in capturing CFC panel defects. Building upon these preprocessing outputs, we employ a clustering strategy utilizing k-mc to automatically group defects at various layers within the examined specimen. This approach is demonstrated in Fig. 11a, b, and c for the chosen spectral images at 445 nm, 546 nm, and 585 nm. In the k-mc approach applied to our HSI analysis, the threshold value plays a pivotal role in distinguishing and categorizing various defect types within the CFC specimen. The proposed algorithm partitions the dataset into k clusters based on the similarity of data points. The choice of the threshold value is crucial because it determines the level of similarity required for data points to be assigned to the same cluster. In our case, a threshold value of ≥ 0.66 indicates that data points with a high degree of similarity, represented by a similarity measure above the specified threshold, will be grouped together within a cluster. By setting the threshold value at ≥ 0.66, we aim to ensure that data points within each cluster share a substantial degree of spectral similarity, indicating that they correspond to a specific defect category. This thresholding operation enhances the precision of defect delineation, contributing to the accuracy and reliability of our automated defect classification. Once defects are identified and classified, the final outcomes from the processed images are overlaid onto the segmented HS picture captured by the SOC710 imager. Figure 12 illustrates the overlay of the identified CFC cracks based on our final outcomes from the three processed pictures onto the HS picture. This overlay serves a dual purpose. Firstly, it provides a visual representation of the spatial distribution and categorization of defects within the CFC panel. Secondly, the overlay serves as a validation of the accuracy and effectiveness of our image preprocessing and clustering approach in capturing and classifying defects at different layers. This detailed analysis, facilitated by our combined preprocessing and clustering strategy, contributes to a more nuanced understanding of the structural integrity and defect distribution within the CFC panel.

Fig. 11
figure 11

Final outcomes after performing the k-mc approach on CFC specimen S-1 with a threshold value ≥ 0.66. a Resultant image at 445 nm after k-mc for delineating CFC surface scratches. b Resultant image at 546 nm after k-mc for delineating the CFC panel near-surface defects. c Resultant image at 585 nm after k-mc for delineating the bottom of cracks. The k-mc approach, with a specified threshold value, aids in accurately delineating various defect types based on spectral properties

Fig. 12
figure 12

Utilizing a contour mapping mask to highlight defective CFC regions based on the selected threshold in the segmented images (depicted by black color spots). This contour mapping enhances the visibility and delineation of identified defects within the CFC specimen

Figure 11 demonstrates our capability to characterize and cluster defective CFC regions with different depths relative to the normal surface. This was achieved through our experimental setup using an HS imager with a halogen lamp source (400–1000 nm) and the application of our imaging approach based on the k-mc technique. The contour delineation approach was applied to the three selected HS images according to the diffuse reflection spectra outcomes (445 nm, 546 nm, and 585 nm), which were chosen as our optical characterization markers. As shown in Fig. 12, we were able to overlay a contour mapping mask based on the same given threshold for the instant grouping of imperfect CFC regions. Our findings might help inspectors make instant and automatic preliminary estimates before CFC production.

4 Discussion

CFC materials are widely employed in a variety of sectors due to their high strength, low weight, and good durability. These make them ideal for use in different applications where weight reduction is critical. Using CFC with defects can compromise the mechanical properties and structural integrity of the component, potentially leading to failure or reduced performance.

Our proposed imaging approach based on HSI can be used as an inspection method for detecting defects in CFC components during manufacturing, which can provide detailed information about their material properties and structure. This method offers a number of potential applications in the field of ND examination of composite materials. It may be used to detect and classify flaws in composite materials, such as delamination, voids, and fractures. Furthermore, because it is an automated and ND process, this approach has the potential to minimize the time and cost of the examination.

Thermography has various drawbacks when compared to HSI. Thermal signals of flaws, which may differ from their optical features, can be detected. As a result, it may be less efficient in detecting faults, such as small gaps that do not generate large temperature fluctuations. On the other hand, the availability of high-quality HS pictures is one constraint of this strategy. Various elements, like lighting, camera settings, and image processing techniques, can all have an impact on image quality. Multiple benefits come with the proposed k-mc; large datasets may be handled with ease thanks to its simplicity and processing efficiency. As a result of the clusters that are produced being simple to visualize and analyze, they are also very interpretable.

Longer-wavelength light can propagate farther than shorter ones [42,43,44]. Based on our imaging setup and the 128-frame 3D picture obtained by the HSI camera, our diffuse reflection spectra calculation at the three wavelengths (445 nm, 546 nm, and 585 nm) with our suggested k-mc technique with contour delineation could successfully trace the CFC imperfections at different depths of the studied specimens. Our proposed approach using the k-mc algorithm and associated HSI could build a 3D reconstruction for the investigated CFC specimen S-3, as shown in Fig. 13.

Fig. 13
figure 13figure 13

Comprehensive results following the implementation of the k-mc approach on the S-3 specimen. a Segmented image captured by SOC710 HS imager, indicating cracks (white arrows) and scratches (red arrows). b The final processed picture after k-mc application, featuring a contour mapping mask for delineating the CFC imperfections at different depths (defects are automatically highlighted with black color spots). c Automated characterization of CFC defects using the clustering approach; scratches and near-surface defects are highlighted in red and green, while relatively deep cracks are depicted in black. Deep cracks are visualized with the use of blue light. d The 3D imaging outcomes based on our k-mc computations at the specified wavelengths (445 nm, 546 nm, and 585 nm)

In addition to detecting defects in CFC components, the proposed HSI approach, coupled with the k-mc algorithm, offers a robust defect classification capability. The k-mc algorithm categorizes defects based on their distinctive spectral properties, allowing for the differentiation of flaws such as delamination, near-surface voids, and deep fractures. The ability to classify defects is crucial in ensuring a more comprehensive understanding of the material’s condition. Figure 13 illustrates the autonomous characterization of a CFC specimen (S-3) through our proposed approach. The segmented picture, processed using k-mc with contour delineation, showcases the categorization of imperfections at different depths. The 3D imaging outcomes at selected wavelengths (445 nm, 546 nm, and 585 nm) further highlight the effectiveness of our approach in providing not only flaw detection but also detailed defect classification. Figure 14b illustrates another explanation for the automated characterization of CFC defects for the specimen (S-4) shown in Fig. 14a, which was achieved through the clustering approach, where scratches and near-surface defects are represented by red and green colors, relatively deep cracks are indicated by black, and deep cracks are visualized with the use of blue light.

Fig. 14
figure 14

a The segmented picture taken by the SOC710 HS imager for the specimen S-4. b Automated classification of defects in the CFC specimen S-4 employing the clustering methodology

After applying the proposed automatic characterization and inspection technique to the original captured image of specimen S-4, as depicted in Fig. 14a, a comparison with the output image in Fig. 14b reveals promising results. In the output clustered image, scratches and near-surface defects are highlighted in red and green colors, respectively, while relatively deep cracks are indicated in black. The visualization of deep cracks is facilitated by the use of blue light. This classification capability is particularly advantageous in industrial applications where rapid and accurate inspection of vast volumes of composite components is essential.

5 Conclusion

In conclusion, our study demonstrates the effectiveness of hyperspectral imaging (HSI) with our proposed k-means clustering (k-mc) approach for ND characterization and inspection of carbon fiber composites (CFC). Utilizing a halogen lamp within the spectral range of 400–1000 nm, we successfully crafted a diffuse reflectance spectra signature. This signature enabled the differentiation between two groups: normal surface CFC and its defective regions, encompassing scratches, near-surface cracks, and deep cracks. Our methodology included feature selection to identify the optimal spectral signature for discriminating between these two groups (normal surface and imperfections), which was found to be from 440 to 600 nm. Furthermore, our clustering results were meticulously evaluated by comparing them with the segmented images captured by the HS imager. This assessment was conducted for the investigated CFC regions, specifically at the three chosen wavelengths (445 nm, 546 nm, and 585 nm). Our results showed that our proposed approach effectively grouped CFC defects and applied contour delineation to their locations. By using our imaging method in conjunction with our processing strategy based on the k-mc technique with contour delineation, investigators would have the ability to do automatic characterization of the CFC remotely and instantaneously, potentially resulting in a higher objective inspection of the CFC panels. Additionally, our approach could build 3D imaging for the inspected panel with good differentiation of the defect type at different depths. Overall, this approach offers a quick and non-contact method for recognizing and diagnosing CFC panels, which can ultimately lead to increased efficiency in production and fewer maintenance costs.