Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rubyで画像ファイルから様々なオブジェクトを検出する / ruby-opencv-heiseirb-2

Rubyで画像ファイルから様々なオブジェクトを検出する / ruby-opencv-heiseirb-2

Tomoki Ishimaru

March 14, 2019
Tweet

More Decks by Tomoki Ishimaru

Other Decks in Programming

Transcript

  1. RubyͰը૾ϑΝΠϧ͔Β ༷ʑͳΦϒδΣΫτΛݕग़͢Δ 2019/03/14 ฏ੒.rb #2 @MedPeer, Inc. Tomoki Ishimaru /

    @thom_i40
  2. ࣗݾ঺հ • Tomoki Ishimaru • GMO AD Marketing Inc. •

    ϑϩϯτΤϯυ / αʔόʔαΠυ • झຯ͸Իָͱࣸਅͱ૸Δ͜ͱ @thom_i40
  3. ࠓ೔࿩͢͜ͱ • ը૾ॲཧϥΠϒϥϦʮOpenCVʯͷ֓ཁ • ruby-opencvͷ֓ཁ • ruby-opencvΛ༻͍ͨ෺ମೝࣝ • ruby-opencvΛ׆༻ͨ͠੒Ռ෺

  4. ࠓ೔࿩͞ͳ͍͜ͱ • ಈըͷೖग़ྗ΍੍ޚ • ػցֶशͱOpenCV • ruby-opencvͷ࢓૊Έ • ίϯϐϡʔλϏδϣϯͷ࢓૊Έ

  5. None
  6. • Πϯςϧ͕։ൃ • Φʔϓϯιʔεͷը૾/ө૾ॲཧϥΠϒϥϦ • ΫϩεϓϥοτϑΥʔϜࢦ޲Ͱઃܭ • C++, Java, Python,

    MATLABΛαϙʔτ • ༷ʑͳόΠϯσΟϯά͕ଘࡏ OpenCV
  7. ruby-opencv • Ruby༻ͷOpenCVϥούʔ • Ruby 2ܥ / OpenCV 2.4.13Λαϙʔτ •

    RubyDoc.infoͰυΩϡϝϯτΛఏڙ
 https://www.rubydoc.info/gems/ruby-opencv/frames
  8. ؀ڥߏங(OS X) • HomebrewͰOpenCVΛΠϯετʔϧ • gem install Ͱ ruby-opencv Λಋೖ

    https://github.com/ruby-opencv/ruby-opencv
  9. ࠓճ঺հ͢Δػೳ • إݕग़ • ԁݕग़ • ௚ઢݕग़ • ୅දతͳը૾ॲཧػೳ •

    ςϯϓϨʔτϚονϯά
  10. άϨʔεέʔϧ / ೋ஋Խॲཧ src = CvMat.load('Sailboat.bmp') gray = src.BGR2GRAY bin

    = gray.threshold(128, 255, :binary)
  11. ԁݕग़

  12. ԁݕग़

  13. Haar෼ྨثʹΑΔإݕग़

  14. Haar෼ྨثʹΑΔإݕग़

  15. Haar෼ྨثʹΑΔإݕग़ ͨͬͨ਺ߦͰ࣮૷Մೳ

  16. ௚ઢݕग़

  17. ௚ઢݕग़

  18. ςϯϓϨʔτϚονϯά

  19. ςϯϓϨʔτϚονϯά

  20. ࠓճ࡞ͬͨ੒Ռ෺

  21. ָේը૾͔ΒϝϩσΟΛநग़

  22. ָේը૾͔ΒϝϩσΟΛநग़

  23. ָේը૾͔ΒϝϩσΟΛநग़

  24. ࢖ͬͨػೳ

  25. ೋ஋Խॲཧ

  26. ௚ઢݕग़

  27. ςϯϓϨʔτϚονϯά

  28. ϝϩσΟΛநग़

  29. ·ͱΊ • OpenCVʹ͍ͭͯ঺հͨ͠ • ruby-opencvΛ༻͍ͨ෺ମݕग़ʹ͍ͭͯ঺հͨ͠ • ָේը૾͔ΒϝϩσΟΛநग़͢ΔγεςϜΛ࡞ͬͨ • RubyͰ΋جຊతͳը૾ೝ͕ࣝͰ͖Δ͜ͱ͕Θ͔ͬͨ

  30. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ @thom_i40