220 likes | 369 Views
OLYMPUS (Nesher) Matlab Coder user story. Nikolay Skarbnik- algorithms Eng. Olympus Medical Nesher. Agenda. Introduction About Olympus Medical Why Matlab Coder? Research to product: the way it usually works Research to product: the way we would like it to be Olympus Nesher user story
E N D
OLYMPUS (Nesher) Matlab Coder user story Nikolay Skarbnik- algorithms Eng. Olympus Medical Nesher
Agenda • Introduction • About Olympus Medical • Why Matlab Coder? • Research to product: the way it usually works • Research to product: the way we would like it to be • Olympus Nesher user story • Demo to product plan • Project I- video enhancement • The issue • Project II- video denoising • Conclusions
About Olympus ~42%!
Olympus Medical • Olympus develops innovative capabilities in medical technology, focusing on early detection of diseases and minimally invasive ways to treat them. • Olympus delivers the diagnostic and therapeutic technologies: endoscopes, laparoscopes, video and imaging systems, electro-surgical devices, electronic medical records and accessories.
Olympus Medical Nesher • Olympus Surgical Technologies America’s Israel facility, serves as Global Research Center for Olympus Medical. • Founded in 1999, this facility originally developed and manufactured miniature distal tip video endoscopes. • The site employs ~40 employees specializing in the research of imaging algorithms and new concepts for surgical tools.
Why did we purchase the Matlab Coder? • To make things: • better! • faster! • cheaper! • Did it work? • You will have to wait 20 minutes to find out…
Research to product: the way it usually works (1) • Algorithms Eng : • Research (Signal/Image processing) • Algorithms selection • Algorithms analysis • Proof of concept/ simulation • Algorithms implementation (inMatlab) • Software Eng : • Hardware oriented implementation • OOP • Real Time • Implementation in: C, C++, DSP, C#, iOS, Java etc… Usually verbal /email explanation. SOW- well documented algorithm, if lucky. State flow charts. Rarely so… Software Eng. /programmer Algorithms Eng. Issues- questions, complaints, misunderstandings (up to verbal violence )…
Research to product: the way it usually works (2) An algorithms eng. working Vs. programmer. The pros: • Good software quality. • Parallel software and algorithms development The cons: • Matlab code hardy resembles the C code. • Updates and bug fixes are a mess. Proper documentation is science fiction. • Ping-pong and inter-personal issues occur. • Company must have algorithms team and software team.
Research to product: my personal experience Company 5 2 3 Algorithms Software
Research to product: the way it usually works- alternatives An algorithms eng.with good programming skills. The pros: • No communication or inter-personal issues. The cons: • Such a silver bullet is rare & usually costly. • Matlab code still differs from the C code. • Bug fixes and features rarely propagate to the Matlab code. • Product development rate naturally decreases. • Well, forget about any documentation- all is in the genius head.
Research to product: the way it should work An algorithms eng. equipped with good code generator The pros: • Programmers time is saved. • Easy & fast update (bug fix, new features etc.. ). • Almost 100% demo ↔ product compatibility. The cons: • The Matlab code should be strict & Coder compatible (both good & bad). Demands form Coder: • Should be cost effective (it is not free to say the least). • The Coder should be really good: • Efficient code • Readable code
Matlab Coder work flow defined in Olympus Nesher Environment MEX Regular Matlab code Coder ready Matlab code Matlab Coder C Visual Studio VS compilation & results C code + Open-CV Bug fixes Product compilation & results Adapt C code for TI Bug & HW demand fixes Embedded TI
Project I- video signal enhancement Algorithm in a nut-shell • Frames decomposition • Frame image data is divided to several sub feature space images. • Relevant feature elements are extracted from each sub-image • Frames fusion • Multiple sub-images extracted feature are analyzed. • Features data fused to an image where hardly visible details of interest become notable. Product requirements: • VGA image: 1024x768 • Real time: ~30 [fps] • Quick development ~2 month, with part time DSP eng.
Project I- video signal enhancement • Result • Working product: • Quick demo-to-product development time (~1 month). • Row-wise processing issue took ~30% of the time. • Initial product result available promptly (~2 weeks). • Fully aligned with the demo (validation & verification ). • Software Eng. Time: ~2 hours per release (mostly technical work). • Additional HW related optimizations (multi core, optimized functions etc…) coded manually.
Project II- “BM3D like” video denoising • Result • Coder based development was abandoned due to the issue pushing project time limits. • Working product via regular development path: • Slow (4 work month) demo-to-product development. • 75% DSP eng. Time was devoted to this project, 25% to mine . • Fine tuning (sub-image operations) required several weeks. • Matlab code has no direct connection to C code. • Product results were available only at project end. • Worries & gray hair whether it will work remained till the end.
The issue • Memory management- row major Vs. column major. • Worked fine while algorithm was applied to whole image. • Row-vise implementation presented artifacts in VS, while worked fine in Matlab and MEX. • Apparently caused by memory access conflict. • No solutions or user complaints were available. • Forced us to perform time consuming debugging.
The issue: indexing ↔ access Matlab C 1 1024 1 768* 1023+1 768 2 1025 767* 1024+1 1024 768* 1024 768* 1024 768 The issue 1024 767* 1024+1 Input image 1 2 768 1024*2
The issue: phenomena demonstration REPMAT case Input image Resulting images Expected image: REPMAT(inImg, 6, 6) Matlab coder C code
Conclusions • We have found Matlab Coder to fit our needs. • It’s utilization is not plug & play. Having invested 3-4 weeks of product evaluation we were ready to buy & work. • We are confident our experience will further improve, as we will become more proficient. • We hope the product will be further improved: • More supported functions. • Code readability (variable names etc…) • Olympus future product algorithms development will rely on Matlab Coder utilization.
Fin Questions? Questions?