I am executing matlab script ( converted into .sh file using mcc ) using exec command from php . exec("./ru​n_searchIM​age.sh <Matlab Path> > output file 2>&1 & ") .

7 ビュー (過去 30 日間)
Running this command from php is giving error Error Using imshow IMSHOW unable to display image.
But if I run ./run_searchImage.sh -path from the command line it is running fine.
Code snipet where it is giving error .
f1 = figure('Visible','off'); imshow(im1_);hold on; f=figure('Visible','off'); imshow(im2_); hold on;

採用された回答

Anirudh Goyal
Anirudh Goyal 2013 年 7 月 1 日
Yes I mean to run it from php and probably there is no display environment variable set , so cld u plz elaborate your answer a little bit more
I have asked the same thing in apache mailing list and they told to run matlab in headless mode , and I tried running it but cld get the results , so cld u plz tell how to do it

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 7 月 1 日
When you run it from PHP there is probably no DISPLAY environment variable set.
When you say "run it from PHP" do you mean by a web server? If so then the web server session is not connected to any display, and so is not able to display graphics. The most it can do in such a case is to compute an image of a graphic and send the image to the web session using an appropriate MIME type.
  5 件のコメント
Anirudh Goyal
Anirudh Goyal 2013 年 7 月 1 日
I want this to be an web app only But Now for demonstration purposes I have shown this using Remote Desktop. I am showing an Image using imshow then I am plotting some boundaries on it using plot and then I am saving this using saveas .
Walter Roberson
Walter Roberson 2013 年 7 月 2 日
Try using image() or imagesc() instead of imshow()

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

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by