MATLAB-developed software that finds the edge of a specimen in a tensile strength test, computes the angle of the tilted specimen, and crops the image with user parameters.
This software is ideal when used in an environment where specimens are tested using the same parameters and conditions. For optimal results, it's good to have a background with a uniform color and texture.
DEVELOPERS: Mr. Antonio Mejia, Computer Science, University of Michigan | Dr. Minh Hoang Nguyen, Aerospace Engineering & Computer Science, University of Michigan
INPUT: .JPG image
USER-DEFINED PARAMETERS: Calibration image, Series of images to be cropped, Cropping length (as a percentage of the width of the specimen), and name of the folder in which the new cropped images will be stored.
The software is composed of 4 segments: Image Processing, Edge Detection, Angle Computation and Image Cropping
Image Processing: Only one calibration image will be used to detect edges and the cropping vector of all the images. The software accesses an image's metadata and also copies the image in a 2D array converting the image from RGB to Grayscale. The images will are all transformed into horizontal
Edge Detection: Using standard deviation and some offsets previously calculated, the point in the image that starts to contain specimen pixels can be calculated. Four points at different horizontal values are taken for a total of 8 edges detected (4 in & 4 out). Using these points the width of the specimen is also calculated.
Angle Computation: Using the edge points detected a sample of four vectors is made and then the average of the four vectors turns into the final vector which then gets compared to a Basis horizontal vector. Using the cosine law with the final vector and the basis vector the angle of the image can be calculated.
Image Cropping: The image is then rotated to the correct angle for it to be completely horizontal. The image is then cropped with an adjustable height that the user determines according to the specimen's width. At the end, a series of completely horizontal images are cropped up until the width of the specimen plus some added width (both top and bottom).