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 Ansichten (letzte 30 Tage)
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;

Akzeptierte Antwort

Anirudh Goyal
Anirudh Goyal am 1 Jul. 2013
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

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 1 Jul. 2013
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 Kommentare
Anirudh Goyal
Anirudh Goyal am 1 Jul. 2013
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 .

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by