We are now ready to explain the main function, which loads the input image and predicts the objects that appear inside it. We are going to use something like the following picture as the input image. Here, multiple different objects appear in the image. We did not have the labels or names of these, but the computer must be able to identify them:
As with all training images, we have to load and pre-process the input image, as follows:
- First, we load and convert the image into gray color values.
- Then, we apply the pre-processing tasks (as we learned in Chapter 5, Automated Optical Inspection, Object Segmentation, and ...