Encoder-Decoder Model for Grayscale to RGB Conversion

This script demonstrates creating and training an encoder-decoder model using random overlapping image patches.
5 téléchargements
Mise à jour 29 mai 2024

Afficher la licence

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: