Skip to main content
. 2024 Feb 7;24(4):1092. doi: 10.3390/s24041092
Algorithm 1 Wavelet Feature Extraction from Images
  • 1:

    procedure WaveletFeatureExtraction

  • 2:

        Define root folders and classes for image datasets        ▹ for 5 drills and 3 classes

  • 3:

        Create imageDatastore instances for each dataset and classes

  • 4:

        for each dataset combination (1 through 5) do

  • 5:

            Combine training sets from other four datasets

  • 6:

            Assign corresponding labels to the combined training set

  • 7:

            Set aside one dataset as the testing set

  • 8:

            Extract wavelet features for both training and testing sets

  • 9:

            Assign labels to the training and testing sets

  • 10:

        end for

  • 11:

        Save all wavelet features and labels to a file

  • 12:

    end procedure

  • 13:

                                          ▹

  • 14:

    procedure getWaveletScattering2(ImageDatastore)

  • 15:

        Read all images from the datastore

  • 16:

        Define wavelet scattering for ImageSize=[224 224]

  • 17:

        Initialize empty array for all features

  • 18:

        for each image in the datastore do

  • 19:

            Extract wavelet features using defined wavelet scattering

  • 20:

            Compute the mean of the features

  • 21:

            Append the features to the features array

  • 22:

        end for

  • 23:

        return features array

  • 24:

    end procedure