Images that need correction

We will use the following code to combine the 25 images and then plot them:

# Combine and plot images
trainx <- combine(mypic)
str(trainx)
Formal class 'Image' [package "EBImage"] with 2 slots ..@ .Data : num [1:128, 1:128, 1:3, 1:16] 0.04435 0 0.00357 0.05779 0.05815 ... ..@ colormode: int 2
trainx <- aperm(trainx, c(4,1,2,3)
par(mfrow = c(4,4), mar = rep(0, 4)) for (i in 1:16) plot(as.raster(trainx[i,,,]))

Here, we save the data involving all 25 images after combining them into trainx. Looking at the structure of tranix, we can see that, after combining the image data, the dimensions now become 128 x 128 x 3 x 16. In order to change this to the required format of 16 x 128 x 128 x 3, we use the aperm function. Then, we plot all 25 images. Note that if the images are plotted with rotation, they can be adjusted to the correct orientation very easily on any computer. The following are the 25 pictures, with a black line across all the images:

The autoencoder model in this application will use these images with a black line as input and will be trained so that the black lines are removed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset