View full-text article in PMC Sensors (Basel). 2017 Jan 22;17(1):207. doi: 10.3390/s17010207 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2017 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1 Split Bregman for color-flattening. 1:procedure COLORFLATTEN(ϵ,λp) 2: Initial: z0=zin; d0,b0=0; 3: while ||zk−zk−1||22>ϵ do 4: A=βI3n×3n+λpLTL 5: v=βzin+λpLT(dk−bk) 6: Update zk+1 by solving Azk+1=v 7: dk+1=Shrink(Lzk+1+bk,1λp) 8: bk+1=bk+Lzk+1−dk+1 9: k=k+1 10: end while 11: return zk 12:end procedure 13:procedure SHRINK(y,γ) 14: return y||y||×max(||y||−γ,0) 15:end procedure