Patch-Transform-Application

所属分类:图形图像处理
开发工具:matlab
文件大小:526KB
下载次数:44
上传日期:2011-08-26 14:41:40
上 传 者tearscoco
说明:  这是MIT一个专门研究图像处理的教授团队做的关于patch transform研究的源代码程序,讲述了其在图像拼接,图像重组方面的应用,工程浩大,但是价值非常高。
(This is a MIT professor specializing in image processing team to do research on the patch transform the source code of the program, described in the image mosaic, image re the application, a huge one, but the value is very high.)

文件列表:
Patch Transform Application\blendPatch2Im_mod.m (4947, 2008-04-21)
Patch Transform Application\computeBeliefsWConst.m (948, 2008-03-11)
Patch Transform Application\computeClrAffinity.m (411, 2008-02-25)
Patch Transform Application\computelocalEvid.m (451, 2008-03-14)
Patch Transform Application\computeMsgFactorToMe.m (362, 2008-03-11)
Patch Transform Application\computeMsgToFactor.m (915, 2008-03-11)
Patch Transform Application\cutImintoPatchRGBOverlap.m (546, 2008-01-11)
Patch Transform Application\evidenceGenerate.m (1398, 2007-12-01)
Patch Transform Application\evidenceGenerateOverlap.m (1522, 2008-07-04)
Patch Transform Application\filtered_write.m (125, 2008-02-11)
Patch Transform Application\getConvMat.m (864, 2007-11-05)
Patch Transform Application\getRasterNeighbors.m (837, 2007-10-02)
Patch Transform Application\ginputMine.m (7069, 2008-07-12)
Patch Transform Application\initBPMessagesWConst.m (779, 2008-03-13)
Patch Transform Application\initialIm.jpg (495171, 2008-03-13)
Patch Transform Application\initMRFPatchWConstRemove.m (11424, 2008-03-14)
Patch Transform Application\initPatchToNodeWFixVar.m (2293, 2008-02-27)
Patch Transform Application\initPatchToNodeWFixVarRemove.m (3158, 2008-04-15)
Patch Transform Application\marginals2image.m (316, 2008-03-14)
Patch Transform Application\mincut.m (1587, 2008-04-22)
Patch Transform Application\oneIterBPDampWConst.m (3235, 2008-03-11)
Patch Transform Application\oneIterBPDampWConstMod.m (3689, 2008-03-11)
Patch Transform Application\patchTransform.fig (11151, 2008-04-15)
Patch Transform Application\patchTransform.m (47902, 2008-07-12)
Patch Transform Application\poisson_solver_function_neumann.m (1209, 2008-03-11)
Patch Transform Application\rgb2ntscMine.m (282, 2007-11-06)
Patch Transform Application\roughReconstIm.m (1171, 2008-03-14)
Patch Transform Application\seamEnergy.m (4003, 2008-01-13)
Patch Transform Application\seamEnergyCompute.m (552, 2008-03-11)
Patch Transform Application\seamGradCompatibility.m (1508, 2008-03-11)
Patch Transform Application\seamRemoval.m (1469, 2008-04-14)
Patch Transform Application\toneMatching.m (620, 2007-11-06)
Patch Transform Application\blendPatch2Im.m (4969, 2008-04-21)
Patch Transform Application (0, 2011-08-02)

% readme.txt % April 15 2008, Taeg Sang Cho To cite this work, please use the following bibtex: @INPROCEEDINGS{CHO_CVPR2008, author = {Taeg Sang Cho and Moshe Butman and Shai Avidan and William T. Freeman}, title = {The patch transform and its applications to image editing}, booktitle = {IEEE Conference on Computer Vision and Pattern Recognition}, year = {2008}, owner = {Taeg Sang Cho}, timestamp = {2008.04.22} } This is an demo of an extended version of the patch transform algorithm presented at CVPR 2008. A detailed description of the algorithm used in this demo will appear in an extended version of this paper. The main difference from the CVPR 2008 work is that each patches are allowed to be overlapped with neighboring patches, and the compatibility between the patches is defined as the seam energy (please refer to Shai's Seam carving paper for seam energy). The patches are then "quilted" to synthesize the final image. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Demo instruction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% To run this demo, first run MATLAB, and type patchTransform. Then a pane will pop up. The initial image is only a background, so start by loading the image. Before loading, check whether you want to compute the compatibility, or use the precomputed compatibility. Compatibility computation takes about a minute. Then the image will load. The program will initialize and precompute some variables so it may take a while. Once the reconstructed image also initializes to the image you loaded, the initialization is completed. Then, you need to choose which patches to move, which patches to remove, which patches to favor and which patches to use twice. Before you press the Patch Select button, choose whether you want to move the patches you select, or you want to fix the patches you select, or you want to remove the patches you select, or you want to double count the patches you select, or you want to favor the patches with similar colors to the one you select. Once you turned on the correct radiobutton, click on patch select. Let's suppose you selected "Move patches" option. Then the top image will become active. To select the patches, click once on the top-left, once at the bottom right corner of the region on the top image. Once that's done, the image will pop up again. This time, click on the top-left corner region at which the selected patches will be placed. The moved patches will appear as green region. To fix/remove/add patches, click once on the top-left, once at the bottom right corner of the region, within the top image, you want to manipulate. Then, click on runNew, and image will be reconstructed. During computation, the demo will show how the patches are being organized in real time. At the end of image reconstruction, an image with overlaid seams will pop up just for reference. 50 iterations of BP takes about 15 seconds on my machine, but this should vary based on the machine's performance. If you want to change the number of BP iterations, or the K (the number of possible patch placements at each node), or the sigma of the local evidence term, change the parameters accordingly. If you want to view the high resolution output, click on the High res output button. If you want to run the BP on the current result, click on Run More. If you want to start over again, click Refresh. If you have any questions, please feel free to email me at taegsang_@_mit_._edu (please remove all _ in this address). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Some tips to improve image quality %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1. You can vary the variance of the Local Evidence (Set LE button) to modify how much the reconstructed image mimicks the original image. If you notice that the output image mimicks the original image too much, you can increase the the variance of the Local Evidence using the "Set LE" input. If you notice that the output image does not resemble the original image as much as you'd like it to, you can decrease the the variance of the Local Evidence using the "Set LE" input. 2. When you remove patches, the algorithm works better when you "add" a few patches that may be placed in the region you just discarded. The algorithm works the best if the total number of patches is similar or greater than the original number of patches (in this demo, the total number of patches is fixed as 192 for all images.) 3. When the algorithm struggles to find a correct neighboring patch, you can play around with the K number with "Set K" button. If you decrease K, there's more probability that the algorithm will find the correct match, but at the same time the algorithm does not explore all possible space of plausible images. 4. Also, when the algorithm struggles to find a correct neighboring patch, you can "add" a patch that may be used at that location. This tends to improve the resulting output a lot. 5. Try not to place patches at absurd locations. For example, in image 1.jpg, do not place the girl at the top of the dome because that will definitely not work. Placing the patches at plausible and reasonable locations works much better! Acknowledgments: The authors would like to thank Christopher Decoro for initial version of the mincut.m, and Amit Agarwal for Poisson blending code. Copyright (c) 2008 Taeg Sang Cho CSAIL, MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

近期下载者

相关文件


收藏者