0

On Ubuntu 14.04, if I run the following code within the qlua interpreter invoked via the command line (with or without the first line), it displays the Lena image :

require('mobdebug').start()    -- for image.display()
require 'image'
image.display( image.lena() )

and I can display a gray scale image via gnuplot:

require 'gnuplot'
require 'image'
M = image.rgb2y( image.lena() )
P = M[{1,{},{}}]
gnuplot.imagesc(P)

However, if I set the Zerobrane Studio v1.30 interpreter to QLua-LuaJIT (there is not a "qlua" interpreter) via Project->LuaInterpreter and run it, I get this error:

Program 'qlua' started in '/opt/zbstudio/myprograms' (pid: 4608).
Debugging session started in '/opt/zbstudio/myprograms/'.
tput: No value for $TERM and no -T specified
/home/dj/torch/install/share/lua/5.1/mobdebug.lua:1093: attempt to      call local 'report' (a string value)
stack traceback:
    [string "xpcall(function() io.stdout:setvbuf('no'); re..."]:1: in    function 'report'
    /home/dj/torch/install/share/lua/5.1/mobdebug.lua:1093: in function 'loop'
    [string "xpcall(function() io.stdout:setvbuf('no'); re..."]:1: in function <[string "xpcall(function() io.stdout:setvbuf('no'); re..."]:1>
    [C]: in function 'xpcall'
    [string "xpcall(function() io.stdout:setvbuf('no'); re..."]:1: in  main chunk
    Debugging session completed (traced 4 instructions).
    Program completed in 4.12 seconds (pid: 4608).    

How do I display an RGB image from within ZBS?

DJensen
  • 1
  • 2
  • Before `Program 'qlua' started...` message, there should be `Program starting as...` message in the Output panel; does that command work when you execute it from the command line outside of ZeroBrane Studio? – Paul Kulchenko Jun 09 '16 at 19:05
  • Program starting as '"/home/dj/torch/install/bin/qlua" -e "xpcall(function() io.stdout:setvbuf('no'); require('mobdebug').loop('SignalProcessor',8172) end,function(err) print(debug.traceback(err)) end)"'. Program 'qlua' started in '/home/dj/Torch' (pid: 17629). – DJensen Jun 11 '16 at 13:16
  • The first line with mobdebug locks up a Terminal window, but the following two lines work fine. `dj@SignalProcessor:~/Torch$ qlua Lua 5.1 Copyright (C) 1994-2008 Lua.org, PUC-Rio` `> require 'image' > image.display( image.lena() ) > -- the above two lines show the lena image` – DJensen Jun 11 '16 at 13:38

0 Answers0