Encoder-Decoder Model for Grayscale to RGB Conversion
Version 1.0.0 (6,42 ko) par
Michael Alvarez
This script demonstrates creating and training an encoder-decoder model using random overlapping image patches.
This script demonstrates how to create random overlapping patches of an image to train an encoder-decoder model that converts grayscale images to RGB images.
Some steps:
- reading an example image (`peppers.png`)
- call the function `image2patch_randperm_overlap` wiht the parameter
clc
clear
close all force
X = imread('peppers.png') ;
figure, imagesc(X), title('Example')
imageOut = mat2gray( X ) ;
imageIn = rgb2gray( imageOut ) ;
deltaX = 32 ;
deltaY = 32 ;
overlap = 8 ;
per = .8 ; % percent to train
seed = 1 ; % to control the random numbers
make_plot = 1 ;
[patchs] = image2patch_randperm_overlap( ...
imageIn , imageOut , deltaX , deltaY , overlap , seed , per , make_plot) ;
- to visualizate the Train and Test data: