Automatic Certificate Generation Using MATLAB
Aim:
Automatic Certificate Generation Using MATLAB
Significance of your project:
- This program is used for generating certificates collecting participants' data from excel sheets.
- This program can help save time and hustles and can arrange and manage certificates in an orderly manner.
- Analysis and presentation of large data sets is a tedious task in applications such as Big Data, IoT, and sensors-actuators modeling. The project presented here can be extended and customized for analysis and reports generation in these applications.
- certificates generated by the program can be saved in a folder with a unique filename
Module and libraries used:
xlsread(reads the first worksheet in the Microsoft® Excel® spreadsheet workbook namedfilename)filenameand returns the numeric data in a matrix.imread(reads the image from the file specified byfilename)filename, inferring the format of the file from its contents. Iffilenameis a multi-image file, thenimreadreads the first image in the file.insertText(returns a truecolor image withI,position,text)textinserted. The input image,I, can be either a truecolor or grayscale image.- Etc
Procedure:
- Read an Excel sheet containing details. Text is read from the file
- seperately from numbers
- Read blank certificate image
- Obtain topics from the txt variable which are in 3rd column
- combine names and topics
- obtain positions to insert on the image, MSPaint or any image editor
- Provide parameters for function inserttext
- Font size is 22 and opacity of box is 0 means 100% transparent
- generate and save files with .png extension
MATLAB Code:
clc
clear all
close all
filename = 'Registration_Details.xls';
[num,txt] = xlsread(filename)
% Read Excel sheet
% seperately from numbers
len=length(txt)
blankimage = imread('1.png');
% Read blank certificate image
for i=1:len
for j= 2:2
text_names(i,j)=txt(i,j)
end
end
% Obtain names from the txt variable which are in 2nd column
for i=1:len
for j= 3:3
text_topic(i,j)=txt(i,j)
end
end
% Obtain topics from the txt variable which are in 3rd column
%Ignore first row which is heading
for i=2:len
text_all=[text_names(i,2) text_topic(i,3)]
% combine names and topics
position = [100 258;120 416];
% obtain positions to insert on image, MSPaint or any image editor
RGB = insertText(blankimage,position,text_all,'FontSize',28,'BoxOpacity',0,'TextColor','white');
%Provide parameters for function insertText
%Font size is 22 and opacity of box is 0 means 100% transparent
figure
imshow(RGB)
%Obtain and display figure in color
y=i-1
filename=['Certificate_Topic_' num2str(y)]
lastf=[filename '.png']
saveas(gcf,lastf)
% generate and save files with .png extension
end
Provided Inputs :
- Excel sheet of registration Details .
- Blank certificate image
Output:
- Generated Certificates .
- Workspace.
- Command Window.
Errors And Difficulties:
- Typing mistakes were observed.
- Using Image Processing tools were hectic.
- errors in input arguments were found due to being unfamiliar with new functions.