|
Total Variation Inpainting using Split Bregman
|
Generate a random inpainting mask. More...
#include <stdio.h>#include <string.h>#include "randmt.h"#include "drawtext.h"#include "imageio.h"Go to the source code of this file.
Macros | |
| #define | JPEGQUALITY 95 |
| Quality for writing JPEG images. | |
| #define | CLAMP(X, A, B) (((X) <= (A)) ? (A) : (((X) >= (B)) ? (B) : (X))) |
Functions | |
| void | PrintHelpMessage () |
| int | Dots (unsigned char *Mask, int Width, int Height, int PenRadius) |
| Fill inpainting mask with random dots. More... | |
| int | Scribble (unsigned char *Mask, int Width, int Height, int PenRadius) |
| Fill inpainting mask with a random scribble. More... | |
| void | RandomText (unsigned char *Mask, int Width, int Height) |
| Fill inpainting mask with random text about TV inpainting. More... | |
| int | Bernoulli (unsigned char *Image, int Width, int Height, double Ratio) |
| Fill inpainting mask with Bernoulli distributed pixel-wise mask. More... | |
| int | main (int argc, char **argv) |
| unsigned char * | MakePen (int PenRadius) |
| void | PutPixel (unsigned char *Image, int Width, int Height, int x, int y) |
| void | PutPen (unsigned char *Image, int Width, int Height, unsigned char *Pen, int PenRadius, int x0, int y0) |
| unsigned char | GetPixel (unsigned char *Image, int Width, int Height, int x, int y) |
Generate a random inpainting mask.
Copyright (c) 2012, Pascal Getreuer All rights reserved.
This program is free software: you can use, modify and/or redistribute it under the terms of the simplified BSD License. You should have received a copy of this license along this program. If not, see http://www.opensource.org/licenses/bsd-license.html.
Definition in file randmask.c.
| int Bernoulli | ( | unsigned char * | Image, |
| int | Width, | ||
| int | Height, | ||
| double | Ratio | ||
| ) |
Fill inpainting mask with Bernoulli distributed pixel-wise mask.
| Mask | destination |
| Width,Height | the mask dimensions |
| Ratio | masking ratio: probability that a pixel is part of the mask |
Definition at line 204 of file randmask.c.
| int Dots | ( | unsigned char * | Mask, |
| int | Width, | ||
| int | Height, | ||
| int | PenRadius | ||
| ) |
Fill inpainting mask with random dots.
| Mask | destination |
| Width,Height | the mask dimensions |
| PenRadius | the radius of the dots |
Definition at line 180 of file randmask.c.
| void RandomText | ( | unsigned char * | Mask, |
| int | Width, | ||
| int | Height | ||
| ) |
Fill inpainting mask with random text about TV inpainting.
| Mask | destination |
| Width,Height | the mask dimensions |
This routine generates a random text from several samples about TV regularized inpainting.
Definition at line 342 of file randmask.c.
| int Scribble | ( | unsigned char * | Mask, |
| int | Width, | ||
| int | Height, | ||
| int | PenRadius | ||
| ) |
Fill inpainting mask with a random scribble.
| Mask | destination |
| Width,Height | the mask dimensions |
| PenRadius | the radius of the scribble line |
This routine generates a random path and draws it with radius PenRadius. The path is generated several times and the path with the greatest variance is selected.
Definition at line 234 of file randmask.c.
1.8.3.1