website : https://dcoeurjo.github.io/OTColorTransfer/
@David Coeurjolly, CNRS, Université de Lyon, LIRIS
Color Transfer via Optimal Transport
Home Page: https://dcoeurjo.github.io/OTColorTransfer/
License: BSD 2-Clause "Simplified" License
website : https://dcoeurjo.github.io/OTColorTransfer/
@David Coeurjolly, CNRS, Université de Lyon, LIRIS
Hi,
I saw there is uncorrected git conflict pushed in CMakeList :
<<<<<<< HEAD
cmake_minimum_required(VERSION 3.12)
=======
cmake_minimum_required(VERSION 3.9)
>>>>>>> 8e4646fa93495df73f7bf4fdd394e6f838ed0bba
did you try?
LAB , processing whole lab, but transferring only AB:
import numpy as np
from numpy import linalg as npla
import cv2
def CTSOT(src,trg, steps=10, batch_size=5, reg_sigmaXY=16.0, reg_sigmaV=5.0):
"""
Color Transform via Sliced Optimal Transfer, ported by @iperov
src - any float range any channel image
dst - any float range any channel image, same shape as src
steps - number of solver steps
batch_size - solver batch size
reg_sigmaXY - apply regularization and sigmaXY of filter, otherwise set to 0.0
reg_sigmaV - sigmaV of filter
return value - clip it manually
"""
if not np.issubdtype(src.dtype, np.floating):
raise ValueError("src value must be float")
if not np.issubdtype(trg.dtype, np.floating):
raise ValueError("trg value must be float")
if len(src.shape) != 3:
raise ValueError("src shape must have rank 3 (h,w,c)")
if src.shape != trg.shape:
raise ValueError("src and trg shapes must be equal")
src_dtype = src.dtype
h,w,c = src.shape
new_src = src.copy()
for step in range (steps):
advect = np.zeros ( (h*w,c), dtype=src_dtype )
for batch in range (batch_size):
dir = np.random.normal(size=c).astype(src_dtype)
dir /= npla.norm(dir)
projsource = np.sum( new_src*dir, axis=-1).reshape ((h*w))
projtarget = np.sum( trg*dir, axis=-1).reshape ((h*w))
idSource = np.argsort (projsource)
idTarget = np.argsort (projtarget)
a = projtarget[idTarget]-projsource[idSource]
for i_c in range(c):
advect[idSource,i_c] += a * dir[i_c]
new_src += advect.reshape( (h,w,c) ) / batch_size
if reg_sigmaXY != 0.0:
src_diff = new_src-src
new_src = src + cv2.bilateralFilter (src_diff, 0, reg_sigmaV, reg_sigmaXY )
return new_src
Hi! I know that the repo is not active from a while, but somewhere exists an example of a ct sot with GPU?
Hello, what is the main reference for this project? I want to learn it theoretically. I saw that you recently added python code. I tried to test but it failed. Can you add some test interfaces for some beginners to learn? Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.