Error: Undefined variable "vision" or class "vision.TextInserter" - Stand Alone Application

4 ビュー (過去 30 日間)
Pim Nederstigt
Pim Nederstigt 2013 年 1 月 3 日
コメント済み: Cuong Nguyen 2022 年 3 月 15 日
Hello everyone,
I'm currently building a Stand Alone Application for windows with Matlab Compiler, however the compiled application doesn't seem to accept some of my code.
I use the command vision.TextInserter from the 'Computer vision system toolbox' in one of the scripts that the compiled GUI loads while executing the program. The GUI runs perfectly within Matlab, but the compiled GUI returns the following error in the command prompt: Undefined variable "vision" or class "vision.TextInserter".
Compiling the script with the vision.TextInserter command with the deploytool wasn't possible due to a bug, however, this could be successfully done using the work-around in mcc: http://www.mathworks.com/matlabcentral/answers/27493-building-standalone-application-fails-on-file-i-don-t-use
From what I've read so far on this community, this error comes up when trying to run a command from a toolbox which is not supported by Matlab Compiler. However, according to Matlab, the Computer Vision System Toolbox is compatible with Matlab Compiler: http://www.mathworks.nl/products/compiler/supported/compiler_support.html
My question to you all is:
- Is the 'vision.TextInserter' command from the Computer Vision Toolbox really compatible with Matlab Compiler?
- If so, what changes do I have to make in the compiling process to get this funtion to work?
Thanks in advance, any help would be much appreciated.
  2 件のコメント
Witek Jachimczyk
Witek Jachimczyk 2013 年 1 月 3 日
Hi Pim,
Can you tell me which release are you using and post a smallest snippet of your code that can reproduce the error?
Thank you,
Witek
(Computer Vision System Toolbox development)
Matt Smith
Matt Smith 2013 年 3 月 18 日
Has this been resolved yet? I have the same problem. Using 2012b. Computer Vision Toolbox works great, compiling GUI has no problems, but same error Pim described. I do not use the deploy tool, just command line 'mcc' method to create a stand-alone application. I am using vision.OpticalFlow()
-Matt

サインインしてコメントする。

回答 (6 件)

Walter Roberson
Walter Roberson 2013 年 1 月 3 日
Did you try adding
%#function vision
to the MATLAB function?
  1 件のコメント
Pim Nederstigt
Pim Nederstigt 2013 年 1 月 3 日
編集済み: Pim Nederstigt 2013 年 1 月 3 日
Dear Walter,
Thanks for the quick reply.
This is what I've been doing for the last hour: the vision.TextInserter command was originally being used in a script that was executed in the GUI with the run command. I've turned this script into a function now, which is directly run in the GUI, and I've added your code at the top of the function.
%#function vision
After compiling I still get the Undefined variable "vision" or class "vision.TextInserter" error. So no improvement yet.

サインインしてコメントする。


Muhammad Ammad
Muhammad Ammad 2013 年 2 月 8 日
Problem is in your matlab use matlab 2012....

The Phuong Luu
The Phuong Luu 2015 年 7 月 18 日
add in your build command: -p vision

Usama
Usama 2015 年 9 月 16 日
I am using matlab 2014 a , still getting error in
video= vision.VideoFileReader('irkinect.mp4'); what should i do ??
error is : Undefined variable "vision" or class "vision.VideoFileReader". Error in postprocessing (line 70) video= vision.VideoFileReader('irkinect.mp4');
  1 件のコメント
Eric Caplain
Eric Caplain 2017 年 5 月 6 日
I'm using the latest version and experiencing the same issue with vision.VideoFileReader

サインインしてコメントする。


shiv
shiv 2015 年 10 月 17 日
I m using matlab 7.8.0 (R2009a) In viola jones algorithm, I am using 'FaceDetector = vision.CascadeObjectDetector;' and Error in ==> Untitled at 5 FaceDetector = vision.CascadeObjectDetector; Please help me in this algo.. thanx in advance
  3 件のコメント
shiv
shiv 2015 年 10 月 18 日
sir can u tell me the correct code for R2009a... thanx in advance
Walter Roberson
Walter Roberson 2015 年 10 月 18 日
No, that would require that I research the Viola Jones algorithm and write and test code that uses toolboxes that I do not own, to match hardware that I do not have, and I would have to test against a version of MATLAB that does not run on my hardware. That would be a significant investment of my time and energies, and I would not even receive as much as a glass of clean water in compensation. It would be much easier for you to upgrade to R2015b Student Version.

サインインしてコメントする。


Jegadeeshkumar R
Jegadeeshkumar R 2018 年 12 月 22 日
Undefined variable "vision" or class "vision.TextInserter".
how to rectify that error. still i have using matlab R2017b.
pls help me to solve the error.
thanks

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by