The function 'edge' is not supported for standalone code generation

和自甴很熟 提交于 2019-12-13 01:27:24

问题


I am trying to use the edge(I,'sobel') method inside a Matlab function block in Simulink(MATLAB 2013a). When I try to compile, I get the error "The function 'edge' is not supported for standalone code generation". I know there is an edge detector block , but I want to call the function with in the Matlab function block. How to get around this.


回答1:


If you have Computer Vision System toolbox you can use vision.EdgeDetector System object. If you have edge detector block then you already have this toolbox. This object supports code generation. The default edge detector method it uses is 'Sobel'. When you generate code for this object remember to set all properties using constructor arguments. You may not be able to change properties after construction when generating code.

edgeObj = vision.EdgeDetector;
edges = step(edgeObj, inputImage);



回答2:


You should be able to declare the function as an extrinsic:

coder.extrinsic('edge');

then it should work for simulation but not code generation.



来源:https://stackoverflow.com/questions/19641024/the-function-edge-is-not-supported-for-standalone-code-generation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!