SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
Scala can do this, too
Matic Potocnik @ Scala Slovenia, 08.09.2016
Overview of Projects
Projects we’ll look at today
• IRC Bot
• OCR Optimization
• Digital Art Installation
• Color Correction
1
IRC Bot - Overview
The usual bot features
• Greeting new users
• Passing messages to offline users
• Wordplay and telling jokes
• Posting to social media
• ...
2
IRC Bot - Scala
• String interpolation
s"Hello, $toGreet!" ⇒ Hello, World!
• Parser combinators
c"[Hi|Hello] {there}, $toGreet{!|.}" ⇒ Hi there, World!
c"[Hi|Hello] {there}, $toGreet{!|.}" ⇒ Hello, World.
c"[Hi|Hello] {there}, $toGreet{!|.}" ⇒ Hello there, World
c"[Hi|Hello] {there}, $toGreet{!|.}" ⇒ ...
3
IRC Bot - Scala
• Regex + Pattern matching
val cmd = "@([a-z]+) (.*)".r
input match {
case cmd("msg", message) =>
/*handle message*/
case cmd("retweet", url)
if (url.matches(Regexes.URL)) =>
/*handle url*/
/*more cases*/
}
4
OCR Optimizer - Context
Scanning books and documents
OCR is hard in general... but easier for e.g. a single scan job
Preprocessing
Thresholding, removing stains, rotating, ...
⇒
5
OCR Optimizer - Design
MCQBIG
INPUT
ImageMagick OCR MLQBIG
OUTPUT
Comparator
(LEVENSHTEIN)
Parameter generator
(GENETIC ALGORITHMS)
-sigmoidal-contrast 1x78% -black-treshold 90% -negate
6
OCR Optimizer - Scala
• Futures
The next talk will tell you more...
I mostly used them to spawn processes,
and misused Await for process timeout
• Process
As easy as: s"tesseract-ocr $image".!!
Also supports pipes, redirects, &&, ||, ...
Better libraries such as lihaoyi/Ammonite exist
• rockymadden/stringmetric
String and phonetic similarity metrics
7
Digital Art Installation - Overview
Liminoid
by Sasa Spacal & Matic Potocnik
produced by: LJUDMILA
8
Digital Art Installation - Context
Software development in art
Frameworks and libraries exist for lots of stacks
I opted for Scala and LWJGL (plain OpenGL library)
Worked better than past projects (C++, VVVV, Python)
Art in software development
Very different process than developing software by spec,
not much attachment to already written code or style,
playing with code is important for project progress
9
Digital Art Installation - Animation
Animation player
A moving particle mandala proved too hard for video codecs,
and the player was rigid and hard to integrate with OpenGL,
so we wrote a player, which handled sequences of PNG files
10
Digital Art Installation - Performance
Performance Optimization
Hard to avoid noticeable pauses in VR
-XX:MaxGCPauseMillis to get frequent short GC pauses
Tried to keep variable scope and allocations to a minimum
Precomputing some things and reusing them
Future
Looking forward to improvements in 2.12 and Scala Native
11
Color Correction - Context
Color in the context of geology
Cheaply simplify and improve accuracy
0
5
10
15
Brez korekcije Premik Uteženo povpre je
Linearna kombinacija Linearna kombinacija II
12
Color Correction - Computer Vision
JavaCV
ASIFT algorithm to detect the color chart
13
Color Correction - GUI
Scala Swing
It’s nicer than Java Swing, if that counts
Terse nested syntax, some reactive features
Moved out of stdlib and deprecated now ⇒ ScalaFX exists
14
Color Correction - Conclusion
Why else Scala?
Color library easier to write with expressive type system
Making code parallel and fast is simple (tnx scala-blitz)
All Java libraries still available (Jrawio, JavaCV, ...)
Numeric math is easier to get right (tnx Breeze, tnx Linter ;))
15
Conclusion
16
Conclusion
17
Conclusion
18
Scala can do this, too
Questions?
• IRC Bot
• OCR Optimization
• Digital Art Installation
• Color Correction
19

Weitere ähnliche Inhalte

Was ist angesagt?

Extracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationExtracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationJônatas Paganini
 
Designing and coding for cloud-native applications using Python, Harjinder Mi...
Designing and coding for cloud-native applications using Python, Harjinder Mi...Designing and coding for cloud-native applications using Python, Harjinder Mi...
Designing and coding for cloud-native applications using Python, Harjinder Mi...Pôle Systematic Paris-Region
 
Intuitive CLIs for gRPC - GoSV Jan '19
Intuitive CLIs for gRPC - GoSV Jan '19Intuitive CLIs for gRPC - GoSV Jan '19
Intuitive CLIs for gRPC - GoSV Jan '19Noah Dietz
 
Replacing Rails asset pipeline with Gulp
Replacing Rails asset pipeline with GulpReplacing Rails asset pipeline with Gulp
Replacing Rails asset pipeline with GulpTomasz Bak
 
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflowSheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflowPaul Richards
 
Python 4 Arc
Python 4 ArcPython 4 Arc
Python 4 Arcabsvis
 

Was ist angesagt? (10)

Extracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationExtracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated application
 
Designing and coding for cloud-native applications using Python, Harjinder Mi...
Designing and coding for cloud-native applications using Python, Harjinder Mi...Designing and coding for cloud-native applications using Python, Harjinder Mi...
Designing and coding for cloud-native applications using Python, Harjinder Mi...
 
Intuitive CLIs for gRPC - GoSV Jan '19
Intuitive CLIs for gRPC - GoSV Jan '19Intuitive CLIs for gRPC - GoSV Jan '19
Intuitive CLIs for gRPC - GoSV Jan '19
 
gRPC
gRPC gRPC
gRPC
 
Beautiful Parrot
Beautiful ParrotBeautiful Parrot
Beautiful Parrot
 
Cling c++
Cling c++Cling c++
Cling c++
 
Replacing Rails asset pipeline with Gulp
Replacing Rails asset pipeline with GulpReplacing Rails asset pipeline with Gulp
Replacing Rails asset pipeline with Gulp
 
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflowSheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
Sheffield_R_ July meeting - Interacting with R - IDEs, Git and workflow
 
Circuit Simplifier
Circuit SimplifierCircuit Simplifier
Circuit Simplifier
 
Python 4 Arc
Python 4 ArcPython 4 Arc
Python 4 Arc
 

Ähnlich wie Scala can do this, too

mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentDavid Galeano
 
SC20 SYCL and C++ Birds of a Feather 19th Nov 2020
SC20 SYCL and C++ Birds of a Feather 19th Nov 2020SC20 SYCL and C++ Birds of a Feather 19th Nov 2020
SC20 SYCL and C++ Birds of a Feather 19th Nov 2020rodburns
 
Computing Without Computers - Oct08
Computing Without Computers - Oct08Computing Without Computers - Oct08
Computing Without Computers - Oct08Ian Page
 
Future Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsElectronic Arts / DICE
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 uploadDebnath Sinha
 
Villar presentation.pdf
Villar presentation.pdfVillar presentation.pdf
Villar presentation.pdfEugenio Villar
 
Scala services in action
Scala services in actionScala services in action
Scala services in actionUnderscore
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Eugene Yokota
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraLINAGORA
 
Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Johan Andersson
 
Capstone Project Final Presentation
Capstone Project Final PresentationCapstone Project Final Presentation
Capstone Project Final PresentationMatthew Chang
 
TestUpload
TestUploadTestUpload
TestUploadZarksaDS
 
Cincom Roadmap ESUG2014
Cincom Roadmap ESUG2014Cincom Roadmap ESUG2014
Cincom Roadmap ESUG2014ESUG
 
C++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserC++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserAndre Weissflog
 
Bits of Advice for the VM Writer, by Cliff Click @ Curry On 2015
Bits of Advice for the VM Writer, by Cliff Click @ Curry On 2015Bits of Advice for the VM Writer, by Cliff Click @ Curry On 2015
Bits of Advice for the VM Writer, by Cliff Click @ Curry On 2015curryon
 
From Flat to Stacked - Alicia C Newberry - City of Milton
From Flat to Stacked - Alicia C Newberry - City of MiltonFrom Flat to Stacked - Alicia C Newberry - City of Milton
From Flat to Stacked - Alicia C Newberry - City of MiltonAlicia Newberry
 
State of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceState of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceOSCON Byrum
 

Ähnlich wie Scala can do this, too (20)

mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
 
SC20 SYCL and C++ Birds of a Feather 19th Nov 2020
SC20 SYCL and C++ Birds of a Feather 19th Nov 2020SC20 SYCL and C++ Birds of a Feather 19th Nov 2020
SC20 SYCL and C++ Birds of a Feather 19th Nov 2020
 
Computing Without Computers - Oct08
Computing Without Computers - Oct08Computing Without Computers - Oct08
Computing Without Computers - Oct08
 
Future Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-Graphics
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 upload
 
Villar presentation.pdf
Villar presentation.pdfVillar presentation.pdf
Villar presentation.pdf
 
Scala services in action
Scala services in actionScala services in action
Scala services in action
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
#Webperf Choreography
#Webperf Choreography#Webperf Choreography
#Webperf Choreography
 
Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)
 
Capstone Project Final Presentation
Capstone Project Final PresentationCapstone Project Final Presentation
Capstone Project Final Presentation
 
TestUpload
TestUploadTestUpload
TestUpload
 
Cincom Roadmap ESUG2014
Cincom Roadmap ESUG2014Cincom Roadmap ESUG2014
Cincom Roadmap ESUG2014
 
C++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browserC++ on the Web: Run your big 3D game in the browser
C++ on the Web: Run your big 3D game in the browser
 
Bits of Advice for the VM Writer, by Cliff Click @ Curry On 2015
Bits of Advice for the VM Writer, by Cliff Click @ Curry On 2015Bits of Advice for the VM Writer, by Cliff Click @ Curry On 2015
Bits of Advice for the VM Writer, by Cliff Click @ Curry On 2015
 
From Flat to Stacked - Alicia C Newberry - City of Milton
From Flat to Stacked - Alicia C Newberry - City of MiltonFrom Flat to Stacked - Alicia C Newberry - City of Milton
From Flat to Stacked - Alicia C Newberry - City of Milton
 
State of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceState of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open Source
 
Shashank Burigeli
Shashank BurigeliShashank Burigeli
Shashank Burigeli
 
Old code doesn't stink
Old code doesn't stinkOld code doesn't stink
Old code doesn't stink
 

Kürzlich hochgeladen

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Kürzlich hochgeladen (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Scala can do this, too

  • 1. Scala can do this, too Matic Potocnik @ Scala Slovenia, 08.09.2016
  • 2. Overview of Projects Projects we’ll look at today • IRC Bot • OCR Optimization • Digital Art Installation • Color Correction 1
  • 3. IRC Bot - Overview The usual bot features • Greeting new users • Passing messages to offline users • Wordplay and telling jokes • Posting to social media • ... 2
  • 4. IRC Bot - Scala • String interpolation s"Hello, $toGreet!" ⇒ Hello, World! • Parser combinators c"[Hi|Hello] {there}, $toGreet{!|.}" ⇒ Hi there, World! c"[Hi|Hello] {there}, $toGreet{!|.}" ⇒ Hello, World. c"[Hi|Hello] {there}, $toGreet{!|.}" ⇒ Hello there, World c"[Hi|Hello] {there}, $toGreet{!|.}" ⇒ ... 3
  • 5. IRC Bot - Scala • Regex + Pattern matching val cmd = "@([a-z]+) (.*)".r input match { case cmd("msg", message) => /*handle message*/ case cmd("retweet", url) if (url.matches(Regexes.URL)) => /*handle url*/ /*more cases*/ } 4
  • 6. OCR Optimizer - Context Scanning books and documents OCR is hard in general... but easier for e.g. a single scan job Preprocessing Thresholding, removing stains, rotating, ... ⇒ 5
  • 7. OCR Optimizer - Design MCQBIG INPUT ImageMagick OCR MLQBIG OUTPUT Comparator (LEVENSHTEIN) Parameter generator (GENETIC ALGORITHMS) -sigmoidal-contrast 1x78% -black-treshold 90% -negate 6
  • 8. OCR Optimizer - Scala • Futures The next talk will tell you more... I mostly used them to spawn processes, and misused Await for process timeout • Process As easy as: s"tesseract-ocr $image".!! Also supports pipes, redirects, &&, ||, ... Better libraries such as lihaoyi/Ammonite exist • rockymadden/stringmetric String and phonetic similarity metrics 7
  • 9. Digital Art Installation - Overview Liminoid by Sasa Spacal & Matic Potocnik produced by: LJUDMILA 8
  • 10. Digital Art Installation - Context Software development in art Frameworks and libraries exist for lots of stacks I opted for Scala and LWJGL (plain OpenGL library) Worked better than past projects (C++, VVVV, Python) Art in software development Very different process than developing software by spec, not much attachment to already written code or style, playing with code is important for project progress 9
  • 11. Digital Art Installation - Animation Animation player A moving particle mandala proved too hard for video codecs, and the player was rigid and hard to integrate with OpenGL, so we wrote a player, which handled sequences of PNG files 10
  • 12. Digital Art Installation - Performance Performance Optimization Hard to avoid noticeable pauses in VR -XX:MaxGCPauseMillis to get frequent short GC pauses Tried to keep variable scope and allocations to a minimum Precomputing some things and reusing them Future Looking forward to improvements in 2.12 and Scala Native 11
  • 13. Color Correction - Context Color in the context of geology Cheaply simplify and improve accuracy 0 5 10 15 Brez korekcije Premik Uteženo povpre je Linearna kombinacija Linearna kombinacija II 12
  • 14. Color Correction - Computer Vision JavaCV ASIFT algorithm to detect the color chart 13
  • 15. Color Correction - GUI Scala Swing It’s nicer than Java Swing, if that counts Terse nested syntax, some reactive features Moved out of stdlib and deprecated now ⇒ ScalaFX exists 14
  • 16. Color Correction - Conclusion Why else Scala? Color library easier to write with expressive type system Making code parallel and fast is simple (tnx scala-blitz) All Java libraries still available (Jrawio, JavaCV, ...) Numeric math is easier to get right (tnx Breeze, tnx Linter ;)) 15
  • 20. Scala can do this, too Questions? • IRC Bot • OCR Optimization • Digital Art Installation • Color Correction 19