colorization_code
所属分类:图形图像处理
开发工具:C/C++
文件大小:565KB
下载次数:0
上传日期:2021-03-20 09:55:18
上 传 者:
Ankoven
说明: 对给定色彩区域进行上色的C++代码,可以打印出上色后的图片
(The C + + code for coloring a given color area can print out the picture after coloring)
文件列表:
colorization_code\colorization_code\cheapUI.m (2979, 2004-08-06)
colorization_code\colorization_code\colorize.m (980, 2004-08-05)
colorization_code\colorization_code\colorizeFun.m (890, 2004-08-06)
colorization_code\colorization_code\defs.h (184, 2004-08-01)
colorization_code\colorization_code\example.bmp (254454, 2004-08-01)
colorization_code\colorization_code\example_marked.bmp (254454, 2004-08-01)
colorization_code\colorization_code\example_res.bmp (245814, 2004-08-01)
colorization_code\colorization_code\fmg.cpp (1170, 2020-11-13)
colorization_code\colorization_code\fmg.h (940, 2004-08-01)
colorization_code\colorization_code\getColorExact.m (1810, 2004-08-05)
colorization_code\colorization_code\getVolColor.cpp (3488, 2020-11-11)
colorization_code\colorization_code\getVolColor.dll (61440, 2004-08-01)
colorization_code\colorization_code\getVolColor.mexglx (193723, 2004-08-01)
colorization_code\colorization_code\mg.cpp (11006, 2004-08-01)
colorization_code\colorization_code\mg.h (8873, 2004-08-01)
colorization_code\colorization_code\tensor2d.cpp (11302, 2004-08-01)
colorization_code\colorization_code\tensor2d.h (2142, 2004-08-01)
colorization_code\colorization_code\tensor3d.cpp (26915, 2004-08-01)
colorization_code\colorization_code\tensor3d.h (2513, 2004-08-01)
colorization_code\original\cheapUI.m (2979, 2004-08-06)
colorization_code\original\colorize.m (980, 2004-08-05)
colorization_code\original\colorizeFun.m (890, 2004-08-06)
colorization_code\original\defs.h (184, 2004-08-01)
colorization_code\original\example.bmp (254454, 2004-08-01)
colorization_code\original\example_marked.bmp (254454, 2004-08-01)
colorization_code\original\example_res.bmp (245814, 2004-08-01)
colorization_code\original\fmg.cpp (1170, 2020-11-13)
colorization_code\original\fmg.h (940, 2004-08-01)
colorization_code\original\getColorExact.m (1810, 2004-08-05)
colorization_code\original\getVolColor.cpp (3488, 2020-11-13)
colorization_code\original\getVolColor.dll (61440, 2004-08-01)
colorization_code\original\getVolColor.mexglx (193723, 2004-08-01)
colorization_code\original\mg.cpp (11006, 2004-08-01)
colorization_code\original\mg.h (8873, 2004-08-01)
colorization_code\original\tensor2d.cpp (11302, 2004-08-01)
colorization_code\original\tensor2d.h (2142, 2004-08-01)
... ...
This package contains an implementation of the image colorization approach described in the paper:
A. Levin D. Lischinski and Y. Weiss Colorization using Optimization.
ACM Transactions on Graphics, Aug 2004.
Usage of this code is free for research purposes only.
Please refer to the above publication if you use the program.
Copyrights: The Hebrew University of Jerusalem, 2004.
All rights reserved.
Written by Anat Levin.
Please address comments/suggestions/bugs to: alevin@cs.huji.ac.il
---------------------------------------------------------------------
General:
The package provides colorization implementation using two optional
solvers:
1)An exact solver using the matlab "\" operator.
This solver is guarantee to provide the global optimum, but running
time can be slow, especially for large images.
2)Multi Grid solver. Fast and efficient, but not always accurate.
This solver is written in C++ and links to matlab as a mex function.
Compilation:
Compiled version for Windows(using Visual C++ 6.0) and Linux are included in this package, but you might need to recompile on your machine.
To compile, type from within matlab:
>>mex -O getVolColor.cpp fmg.cpp mg.cpp tensor2d.cpp tensor3d.cpp
Usage:
You can either use your favorite image editing program
to scribble, or we provide a rudimentary user interface with the function
called (appropriately) cheapUI.m;
Here is an example:
im1=imread('example_res.bmp');
im1=double(im1/255); % images should be double between 0 and 1
cheapUI(im1);
You will see three Matlab figures. The first contains the input
image. You can click on the mouse in this figure to mark points
that define a scribble and then press 'c' to choose a color for
the scribble. You choose a color by clicking in figure 2 on
the color chooser. If the input image is a color image, you
can press 'd' to have the color of the scribble be defined
by the colors in the original image. Pressing 'a' will run
the multigrid algorithm and display results in figure 2.
Pressing 'A' will run the direct solver.
If you prefer to use your favorite image editing program
(e.g. Photoshop, gimp) you need to save two images to
the disk.
1) The original B/W image. The image needs to be saved in an RGB (3 channels) format.
2) The B/W with colors scribbled in the desired places. Use your favorite paint program (Photoshop, paint, gimp and each) to generate the scribbles. Make sure no compression is used and the only pixels in which the RGB value of the scribbled image are different then the original image are the colored pixels.
To run the program define the desired solver and the input file names in the head of the 'colorize.m' file. Then just call the 'colorize' script from within matlab.
An example images pair is included in this package.
近期下载者:
相关文件:
收藏者: