Matlab bindings: fixed the functional template to perform an explicit cast to the...
authorRok Mandeljc <rok.mandeljc@gmail.com>
Mon, 28 Apr 2014 13:43:12 +0000 (15:43 +0200)
committerRok Mandeljc <rok.mandeljc@gmail.com>
Sat, 3 May 2014 15:37:48 +0000 (17:37 +0200)
Ptr_FeatureDetector blobDetector = inputs[3].empty() ? makePtr<SimpleBlobDetector>() : inputs[3].toPtrFeatureDetector();

Which after the patch, would be:

Ptr_FeatureDetector blobDetector = inputs[3].empty() ? (Ptr_FeatureDetector) makePtr<SimpleBlobDetector>() : inputs[3].toPtrFeatureDetector();

modules/matlab/generator/templates/functional.cpp

index 9f3a995..b019a13 100644 (file)
@@ -110,7 +110,7 @@ addVariant("{{ fun.name }}", {{ fun.req|inputs|length }}, {{ fun.opt|inputs|leng
   {{arg.tp}} {{arg.name}} = inputs[{{ loop.index0 }}].to{{arg.tp|toUpperCamelCase}}();
   {% endfor %}
   {% for opt in fun.opt|inputs %}
-  {{opt.tp}} {{opt.name}} = inputs[{{loop.index0 + fun.req|inputs|length}}].empty() ? {% if opt.ref == '*' -%} {{opt.tp}}() {%- else -%} {{opt.default}} {%- endif %} : inputs[{{loop.index0 + fun.req|inputs|length}}].to{{opt.tp|toUpperCamelCase}}();
+  {{opt.tp}} {{opt.name}} = inputs[{{loop.index0 + fun.req|inputs|length}}].empty() ? ({{opt.tp}}) {% if opt.ref == '*' -%} {{opt.tp}}() {%- else -%} {{opt.default}} {%- endif %} : inputs[{{loop.index0 + fun.req|inputs|length}}].to{{opt.tp|toUpperCamelCase}}();
   {% endfor %}
   {# ----------- Outputs ------------ #}
   {% for arg in fun.req|only|outputs %}