APPLICATION OF MATLAB & CODER - MathWorks · Why MATLAB & Coder •Pros + Fast development speed +...
Transcript of APPLICATION OF MATLAB & CODER - MathWorks · Why MATLAB & Coder •Pros + Fast development speed +...
Maung Han
Alpine Electronics Research
May 2016
APPLICATION OF
MATLAB & CODER FOR
AN AUTOMOTIVE VISION PROOF OF CONCEPT
Alpine Electronics Research of America 1
Outline• Why Detect Ground?
• Our Project Goals
• Why MATLAB &Coder
• Development Process
• Results
• Conclusion
• Acknowledgements
Alpine Electronics Research of America 2
Alpine Electronics Research of America 3
Why Detect Ground?• Traditional automotive camera systems can detect pedestrians, cars
and some other objects.
• Trade off between distance sensitivity and object sensitivity.
Dis
tan
ce s
en
siti
vity
Object sensitivity
• Current approaches will take too much computational resources to attain both.
Alpine Electronics Research of America 4
Why Detect Ground?Detection Technology
Method Target (Results)
Sonar sensor Sound waves Accurate distance.Does not know what the object is.
Object recognition
Computer vision Pedestrians, cars, other “trained” objects. Poor distanceaccuracy.
Movement detection
Moving object against background
Anything that moves. Does not detect otherwise. Poorer distance accuracy.
If we know the ground, we can detect both objects and their distances!
Our Project Goals• Detect ground areas in backup camera images
• Recognize various types of ground patterns
• “Un-recognize” various non-ground objects and patterns
• Performance targeted to be near real-time
• At or above 10fps will be considered acceptable
• Less than 500 ms delay
Alpine Electronics Research of America 5
Alpine Electronics Research of America 6
What Does Ground Look Like?
Alpine Electronics Research of America 7
Are These Ground?
Alpine Electronics Research of America 8
Our Definition of Ground• Fairly Smooth (Drivable)
• Even textured
• Discernable from the surrounding
• May have irregular but common imperfections
Why MATLAB & Coder• Alternative choices
• Native C/C++ development
• OpenCV, OpenVX, PCL
• Other open platform alternatives
Alpine Electronics Research of America 9
Why MATLAB & Coder• Pros
+ Fast development speed
+ Familiarity of engineers with the toolboxes
+ Quick turn around time for iterative development
+ Great support from the professional team
+ Direct conversion from MATLAB code to C/C++ code
+ Seamless integration with C/C++ code (SIL)
+ A rich collection of libraries and published material
• Cons- Language not available in embedded environment
- Lack of automated build process for building target code
- Slower performance compared to native development
Alpine Electronics Research of America 10
Alpine Electronics Research of America 11
Sample Images – Imperfections
Alpine Electronics Research of America 12
Sample Images – Light interference
Alpine Electronics Research of America 13
Sample Images - Pedestrian
Selection of test cases
Train system with sample sets
Perform segmentation
Classification of ground segments
Stabilization and marking
Evaluation
Development Process
Improve
Evaluate
Alpine Electronics Research of America 14
Alpine Electronics Research of America 15
Development Process – Test Cases• Ten different test cases covering:
• Parking lots
• Parking roads
• Ramps
• Gates
• Bushes
• Shadows
• Cars
• Pedestrians
Results - Accuracy• Achieved high recognition rates in our test cases.
• Median recognition rate on ten test cases: 99%
• Outliers at the low end due to “no ground” in view
• Slightly high false positive with a 23% median.
• Non-ground being recognized as ground
Alpine Electronics Research of America 16
0
200
400
600
800
1000
1200
1400
Nu
mb
er
of
imag
es
Recognition rate (recognized ground area/total ground area)
Results - Performance• Near real-time performance with ~10fps in SIL mode for “pure” algorithm
in Coder generated C.
• Achieved the delay target of ~500ms.
• Performance significantly dropped to ~5fps after removing all MATLAB dependency (e.g. data type dependency).
• Slowdown in converted C is attributed to:• Extra data type conversions or castings between functions
• Less efficient memory management (compared to MATLAB)
• Loss of multi-threading model from MATLAB
• Loss of highly optimized MATLAB library code
• Some Coder generated C-functions appear less efficient (than their MATLAB implementations)
Alpine Electronics Research of America 17
Sample Images• Sample videos and images will be shown here..
Alpine Electronics Research of America 18
Alpine Electronics Research of America 19
Results – Imperfections of ground
Alpine Electronics Research of America 20
Results – Light interference
Alpine Electronics Research of America 21
Results – Pedestrian
Alpine Electronics Research of America 22
Sample Video
Conclusion• MATLAB & Coder allowed us to focus on algorithm design
• Quick turn around time was ideal for experimentation
• Challenges in finding replacement or equivalent code in C for functions that cannot be converted by Coder
• Overall, MATLAB & Coder is a powerful tool for quick prototyping
• For future improvements:
• Our existing MATLAB code could be refactored into modules for more flexible C-code generation
Alpine Electronics Research of America 23
Acknowledgements
MathWorks Team
•Arvind Jayaraman
•Amit Deshpande
•Siva Nadarajah
•Pete Tsinzo
Alpine Team
•Priyen Shah
•Jun Cheng
•Dhruv Monga
•Kathy Li
•Joseph Chen
Alpine Electronics Research of America 24
Alpine Electronics Research of America 25
Thank you!