色恒常性仮説に基づく色補正ライブラリcolorcorrect / 2015-01-31-kantocv27

色恒常性仮説に基づく色補正ライブラリcolorcorrect / 2015-01-31-kantocv27

@関東CV勉強会 2015/01/31

6e8d1cd646b7cc589fdd5bdea0fd9bf1?s=128

shunsukeaihara

January 30, 2015
Tweet

Transcript

  1. colorcorrect ৭߃ৗੑԾઆʹجͮ͘৭ิਖ਼ϥΠϒϥϦ Gunosy inc Shunsuke Aihara

  2. ࣗݾ঺հ • ҄൧ݪढ़հ (http://argmax.jp) @shunsukeaihara • GunosyͷϚωʔδϟʔ • ޿ࠂ഑৴γεςϜͷ։ൃશମͱR&DܥΛ୲౰ •

    ઐ໳: ܭࢉݴޠֶ • Pythonͱඇಉظ෼ࢄγεςϜΛ޷Ή • DNN੠࣭ม׵ͱ͔झຯͰ΍ͬͯΔ • ը૾ॲཧɾԻ੠৴߸ॲཧ౳Ͱ͍Ζ͍ΖϥΠϒϥϦ࡞ͬͯΔ • https://bitbucket.org/aihara
  3. ͜Ε͸ը૾ೝࣝ౳ͷͨΊͷ ஍ຯͳલॲཧͷ࿩Ͱ͢

  4. colorcorrect

  5. ৭߃ৗੑ/໌Δ͞߃ৗੑͷԾઆʹج͖ͮ ม৭ɾwhite baranceͷζϨΛࣗಈิਖ਼

  6. ը૾ͷޫݯ৭ͱϗϫΠτόϥϯε ͸࣮σʔλͰ͸όϥόϥ • ৭Λ༻͍ͨ෺ମೝࣝΛߦ͓͏ͱ͢Δͱɺֶशσʔληοτͱ৭͕ͣΕ͍ͯΔͱ൑ఆਫ਼౓͸ མͪΔ • ৭৘ใΛ༻͍ͨBag-Of-Keypointܥͷख๏Ͱ͸݁ߏ৭ิਖ਼͕ޮ͍ͯ͘Δ • ྨࣅը૾ݕࡧ /

    ܠ؍ը૾͔Βͷ෺ମݕग़ͱ͔࡞ͬͨ࣌ʹ૬౰ϋϚͬͨ • Deep Learningͱ͔͍Ζ͍Ζظ଴ͯ͠Δ͚Ͳɺ࣮ࡍʹ࢓ࣄͰֶशσʔληοτूΊΔͱ ͳΔͱ͍ΖΜͳࡱӨ৚݅ͷը૾ूΊΔͷ݁ߏେม • ෳ਺র໌৚݅ʹର͢ΔData AugmentationΑ͘Θ͔Βͳ͍ • ͋ͱɺը૾ͷݟͨ໨ΩϨΠʹ͍ͨ͠ͱ͔͍Ζ͍Ζ͋Δ • ͳΜͱָ͔͔ͨͬͨ͠ͷͰิਖ਼ख๏ͷ࿦จͱ͔͍Ζ͍Ζௐ΂ͨ
  7. ༻్ • ม৭ͨࣸ͠ਅͷิਖ਼ • ઃఆϛεͬͯࡱͬͨࣸਅͷमਖ਼ • ίϯσδͰઃఆؒҧ͑ͯࡱͬͨࣸਅͱ͔ • ෺ମೝࣝ౳ͷલॲཧ •

    ద౰ʹެ։͓͍ͯͨ͠ΒCVPR2013ͷ࿦จͰ࣮ ࡍʹ࢖ΘΕͨʂ
  8. ͋ͱ᧙৭ը૾Λ໭͔ͨͬͨ͠ ͜Ε͸৭ͷ৘ใ͕ࣦΘΕ͍ͯΔͷͰͲ͏΍ͬͯ΋ϜϦ

  9. pip install colorcorrect

  10. ৭߃ৗੑ (Color Constancy) ໌Δ͞߃ৗੑ (lightness constancy)

  11. • র໌ޫͷεϖΫτϧ͕มԽͯ͠΋ɺ෺ମ৭ͷ ೝ஌͸େ͖͘มԽ͠ͳ͍(ݩͷ৭͕ೝࣝͰ͖Δ) ৭߃ৗੑ

  12. νΣοΧʔγϟυʔࡨࢹ ໌Δ͞ͱਓ͕ؒೝ஌ͨ͠΋ͷͱҟͳΔ ྡ઀෦ҐͷίϯτϥετʹӨڹΛड͚ͯҟͳΔೝ஌ 'SPN8JLJNFEJB$PNNPOT

  13. ৭ͷ஌֮ͷ؆୯ͳϞσϧ • ໨ʹೖࣹ͢Δޫ͸ޫݯޫͱର৅ͷ෼ޫ൓ࣹ཰Ͱܾ· Δ • ৭߃ৗੑ͸ೖࣹޫ͔ΒޫݯޫΛਪఆͯ͠ɺ෼ޫ൓ࣹ ཰Λਪఆ͢Δ໰୊ͱఆٛग़དྷΔ S( ) =

    I( ) · R( ) • S(λ) ೖࣹޫ • I(λ) ޫݯޫ • R(λ) ෺ମͷ෼ޫ൓ࣹ཰
  14. ৭߃ৗੑԾઆͷ؆୯ͳ෺ • փ৭Ծઆ • ന৭ޫݯԼͷ৔߹ɺࢹ֮಺ͷ৭ͷฏۉ஋ΛऔΔͱփ৭ (127,127,127)ʹͳΔ͸ͣͳͷͰͦͷζϨΛิਖ਼͢Δ • ً౓ - ৭૬ؔ

    • ࢹ֮಺ͷ৭ʹภΓ͕͋Δ৔߹͸փ৭ԾઆͰ͸߃ৗੑΛ୲อग़ དྷͳ͍ͷͰɺً౓ͱ৭ͷ૬͔ؔΒ৭ͷภΓ͕ޫݯʹΑΔ͔ݩ ͷ෺ମ৭ʹΑΔ͔ਪఆͯ͠ิਖ਼ • ͜ΕΒΛϕʔεʹ༷ʑͳΞϧΰϦζϜ͕ఏҊ͞Ε͍ͯΔ
  15. Algorithms

  16. ࣮૷ͨ͠৭߃ৗੑΞϧΰϦζϜ • gray world • max white • stretch •

    retinex, retinex with adjust • weighted grey world • standard deviation weighted grey world • luminance weighted gray world • standard deviation and luminance weighted gray world • automatic color equalization • ->௒ώϡʔϦεςΟΫε͚ͩͲิਖ਼ྗ͕͍͢͝
  17. Implementation

  18. ࣮૷ • PythonʹΑΔ࣮૷(2ܥ) • PIL • Numpy • ଎౓͕ඞཁͳ෦෼͸C++ͷϥΠϒϥϦΛ numpy.ctypesͰϥοϓ

    • pip install colorcorrectͰར༻Մೳ
  19. DEMO http://colorcorrect.argmax.jp/

  20. ·ͱΊ • खܰʹը૾ͷ৭ิਖ਼͕ग़དྷͯศརͳͷͰ࢖ͬͯΈ ͍ͯͩ͘͞ • Python3ܥ + PillowରԠ΋ͦΖͦΖ͠·͢ • Ի੠ͷલॲཧϥΠϒϥϦͱ͔΋ެ։ͯ͠·͢

    • https://bitbucket.org/aihara/pyssp • Gunosyʹ͸෺ମೝࣝɾը૾clipͷ࢓ࣄ͋Γ·͢