How to Generate an Artificial Book Generate a

  • Slides: 3
Download presentation
How to Generate an Artificial Book

How to Generate an Artificial Book

Generate a page of 14 -segment • Using function Generate. NPage() to generate an

Generate a page of 14 -segment • Using function Generate. NPage() to generate an image file contain alphabets of 14 -segment with polynomial distortion. • Please download segment. mat before use this function. (variable sim is provided in segment. mat) function im = Generate. NPage(N, Nr, Nc, GAP, sim, savefile) N: number of pages which you want Nr, Nc: number of rows and columns of alphabets in each page GAP: space between each alphabet (pixel) sim: required variable (Option) savefile: save file name For example, - load segment im = Generate(4, 10, 30, sim, 'pic 01'); => Generate 4 pages, each page contain 100 alphabets - im 2 = imnoise(im, 'gaussian', 0, 0. 01); - imwrite(im 2, 'pic 02. png'); %add noise

Create a whole-book image • Create an image file that contain all pages of

Create a whole-book image • Create an image file that contain all pages of a book by using function Combine 5( ). • Input images of each page of the book. function Combine 5(datasize, savefile, GAP, Nr, Nc, Size. X, Size. Y, contrast) - datasize: number of pages of the book (datasize <= Nr*Nc ) - savefile : save file name - GAP: size of null value between each page (pixel) - (Option) Nr, Nc: number of pages in row and column of a new big image - (Option) Size. X, Size. Y: size of biggest pages - (Option) contrast: use for converting colorful image to b/w image For example, - Combine 5(100, 'book 1', 50); - Combine 5(100, 'book 1', 50, 5, 20, 768, 1024, 0. 75)