{"id":13419556,"url":"https://github.com/YuanhaoGong/CurvatureFilter","last_synced_at":"2025-03-15T05:31:36.034Z","repository":{"id":33919300,"uuid":"37638959","full_name":"YuanhaoGong/CurvatureFilter","owner":"YuanhaoGong","description":"Curvature Filters are efficient solvers for Variational Models","archived":false,"fork":false,"pushed_at":"2019-04-09T03:20:26.000Z","size":35308,"stargazers_count":378,"open_issues_count":2,"forks_count":106,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-10-04T21:45:09.109Z","etag":null,"topics":["curvature","curvature-filters","differential-geometry","image-processing","itk","matlab","opencv","optimization-algorithms","python"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YuanhaoGong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-18T05:20:41.000Z","updated_at":"2024-09-25T05:34:13.000Z","dependencies_parsed_at":"2022-07-29T19:19:22.737Z","dependency_job_id":null,"html_url":"https://github.com/YuanhaoGong/CurvatureFilter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuanhaoGong%2FCurvatureFilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuanhaoGong%2FCurvatureFilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuanhaoGong%2FCurvatureFilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuanhaoGong%2FCurvatureFilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YuanhaoGong","download_url":"https://codeload.github.com/YuanhaoGong/CurvatureFilter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221306381,"owners_count":16795302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curvature","curvature-filters","differential-geometry","image-processing","itk","matlab","opencv","optimization-algorithms","python"],"created_at":"2024-07-30T22:01:17.652Z","updated_at":"2024-10-26T14:32:16.123Z","avatar_url":"https://github.com/YuanhaoGong.png","language":"C++","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"readme":"### Curvature filters are efficient solvers for variational models.\nThese curvature filters are developed by Yuanhao Gong during his PhD. MC filter and TV filter are exactly the same as described in the paper. But the GC filter is slightly modified. Please cite following papers if you use curvature filter in your work. Thank you!\n\n:books: **\u003ca href=\"http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=7835193\" target=\"_blank\"\u003eThe Paper\u003c/a\u003e**. The general theory is in Chapter **Six** of **\u003ca href=\"http://e-collection.library.ethz.ch/eserv/eth:47737/eth-47737-02.pdf\" target=\"_blank\"\u003ePhD thesis\u003c/a\u003e** (downloaded **17,000+**)\n\n:closed_book: Presentation of Gaussian Curvature Filter: **\u003ca href=\"http://www.slideshare.net/YuanhaoGong/a-fast-implicit-gaussian-curvature-filter\" target=\" blank\"\u003eLinkedIn\u003c/a\u003e**, **\u003ca href=\"https://www.dropbox.com/s/ax73park0popi4x/GCFilter_small.pdf?dl=0\" target=\"_blank\"\u003eDropbox\u003c/a\u003e** or **\u003ca href=\"https://pan.baidu.com/s/1geS2EXH\" target=\"_blank\"\u003eBaidu\u003c/a\u003e**. \n\n:blue_book: Poster of Bernstein Filter can be found **[here](images/BernsteinFilter.pdf)**. \n\n:gift: a short introduction in Chinese (中文): **\u003ca href=\"https://zhuanlan.zhihu.com/p/22971865\" target=\"_blank\"\u003eZhihu(Editors' Choice)\u003c/a\u003e** or this **\u003ca href=\"http://www.zhihu.com/question/35499791\" target=\"_blank\"\u003eZhihu\u003c/a\u003e**\n\n:trophy: **source code** in **C++** and **Java** can also be found from **\u003ca href=\"http://mosaic.mpi-cbg.de/?q=downloads/curvaturefilters\" target=\"_blank\"\u003eMOSAIC group\u003c/a\u003e**\n\n:bell: The kernels summary and one example how to get the kernel can be found **[here](images/CF_Kernels.pdf)**.\n\n:e-mail: gongyuanhao@gmail.com or join the **\u003ca href=\"https://groups.google.com/forum/?hl=en#!forum/curvaturefilter\" target=\"_blank\"\u003eCurvature Filter Forum\u003c/a\u003e**\n***\n```text\n@ARTICLE{gong:cf, \n    author={Yuanhao Gong and Ivo F. Sbalzarini}, \n    journal={IEEE Transactions on Image Processing}, \n    title={Curvature filters efficiently reduce certain variational energies}, \n    year={2017}, \n    volume={26}, \n    number={4}, \n    pages={1786-1798}, \n    doi={10.1109/TIP.2017.2658954}, \n    ISSN={1057-7149}, \n    month={April},}\n\n@phdthesis{gong:phd, \n    title={Spectrally regularized surfaces}, \n    author={Gong, Yuanhao}, \n    year={2015}, \n    school={ETH Zurich, Nr. 22616},\n    note={http://dx.doi.org/10.3929/ethz-a-010438292}}\n\t\n@article{gong:gc,\n    Author = {Yuanhao Gong and Ivo F. Sbalzarini},\n    Journal = {Intl. Conf. Image Proc. (ICIP)},\n    Month = {September},\n    Pages = {534--538},\n    Title = {Local weighted {G}aussian curvature for image processing},\n    Year = {2013}}\n```\n***\n## Curvature filters' philosophy \n\nTraditional solvers, such as gradient descent or Euler Lagrange Euqation, start at the total energy and use diffusion scheme to carry out the minimization. When the initial condition is the original image, the data fitting energy always increases while the regularization energy always reduces during the optimization, as illustrated in the below figure. Thus, regularization energy must be the dominant part since the total energy has to decrease. \n\nTherefore, **Curvature filters focus on minimizing the regularization term,** whose minimizers are already known. For example, if the regularization is Gaussian curvature, the developable surfaces minimize this energy. Therefore, in curvature filter, developable surfaces are used to approximate the data. **As long as the decreased amount in the regularization part is larger than the increased amount in the data fitting energy, the total energy is reduced.**\n\n![image](images/phs.PNG)\n\n***\n## Features\n| Theoretical  | Practical |\n| ------------- |:-------------:|\n| **Generality**: handle arbitrary data fitting term (BlackBox) ![ image ](images/box.png) | **Efficient**: three or four order of magnitude faster than traditional solvers ![ image ](images/fast.jpg) |\n| **Convergence**: theoretically guaranteed ![ image ](images/theory.png) | **Implementation**: 40 lines in Matlab and 100 lines in C++ ![ image ](images/easy.png) |\n\n***\n## Faster and Faster \n| Filter       | Bilateral Filter | Guided Filter | Guided Filter | MC Filter | GC Filter | Bernstein Filter |\n| ------------- |:-------------:|:-------------:|:-------------:|:-------------:|:-------------:|:-------------:|\n| Lang.      | C++ | Matlab | C++ | C++ | C++| C++|\n| MilliSec.      | 103 | 514 | 130 | 8 (or **327 MPixels/sec**) | 11| 7|\n\nRunning time with 10 iterations on 512X512 Lena image. Matlab version is R2015a and GCC version is 5.1. All tests are on a Thinkpad T410 with i7-620M core CPU (2.6GHz). We take the time for 100 iterations and divide it by 10. On average, curvature filters take 1 millisecond per iteration.\n\nOn my new taptop(Thinkpad T470p, NVIDIA GeForce 940MX, 384 CUDA cores), GPU version of MC filter can achieve **2500 MPixels/Second** with shared memory and single precision. \n\nOn the TITAN Xp card, MC filter can achieve **33.2 Giga Pixels/Second** with shared memory and single precision. On the Tesla K40c card (2880 cores), MC filter can achieve **8090 MPixels/Second** with shared memory and single precision. \n\n***\n## Example Applications\n### 1) Denoising\n![image](images/denoise.PNG)\nThe noise free test image can be downloaded **[here](images/developable.png)**\n### 2) Only minimize the regularization \nGC = Gaussian Curvature, MC = Mean Curvature, TV = Total Variation\n![image](images/curvatureFilters.png)\n### 3) Minimize a variational model, showing the line profile\nWe show three lines' profiles during minimizing a mean curvature regularized model (MC filter used). \n\n| ![ image](images/Lena_three_lines.png)      | ![image ](images/MC_line1_small.gif) |\n| ------------- |:-------------:|\n| ![image ](images/MC_line2_small.gif)      | ![image ](images/MC_line3_small.gif) |\n### 4) Cartoon Texture Decomposition\n![image](images/decomposition.png)\n### 5) Registration\nfrom left to right: original reference image, distorted source image, registered results by TV filter, MC filter and GC filter.\n![image](images/lena_circ.png)\n***\n## On Triangular Meshes (preliminary results, p.195 in the thesis)\noriginal mesh (left) and processed mesh (right), the energy profile is shown in the middle.\n![image](images/GC_mesh.jpg)\n***\n## FAQ:\n1) Why dual mesh (DM) structure is needed?\n\nThere are two reasons. First, these four sets guarantee the convergence. Second, \nwe can use the updated neighbors for current position. Therefore, it is more computational efficient.\n\n2) What is the difference between these three filters?\n\nIn general, GC filter is better in preserving details, compared with the other two. And\nTV filter is better in removing noise as well as details. MC filter is between these two.\n\nThese three filters are correspond to three types of variational models. User should decide\nwhich prior is to be assumed about the ground truth. \n\n3) What is the difference between split and nosplit scheme?\n\nIn general, splitting the image into four sets and looping on them is computational faster.\nHowever, in some cases like deconvolution, we need to merge the four sets after every iteration.\nSo, it is better do nosplit scheme.\n\nThese two lead to exactly the same result. The split code is just more cache friendly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYuanhaoGong%2FCurvatureFilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYuanhaoGong%2FCurvatureFilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYuanhaoGong%2FCurvatureFilter/lists"}