help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to place changing values of numbers/text on an image


From: jmb
Subject: How to place changing values of numbers/text on an image
Date: Tue, 02 Apr 2013 20:25:59 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4

Hello,

I am trying to display continually changing values (from a DAQ system)
onto a scanned image, using octave.

A. I have sort of made it work but would like to eliminate the periodic
redisplay of the image, which can be annoying to a user.  Here is what
creates the flickering image:

[code snippet]
pkg load image;
I = imread ("Schematic.jpg");
imshow (I);
hold("off");

function Display_Value(Label, Units, Value, X, Y)
#       Output = strcat(Label, num2str(Value), "[", Units, "]" );
        Output = strcat(Label, num2str(Value), Units );
        text(X,Y,Output);
endfunction

while true
        imshow (I);
        Display_Value("T_{amb}=", "C", T_amb, 100, 0);
        sleep(10);
endwhile
[end code snippet]

The flickering is understandable because I have the imshow() inside the
loop.  But the values of T_amb remain readable after each iteration of
the while loop.

B. Using an alternate method I tried to display the image first, then
place the changing values on the image, but I seem to get values
overwriting the old, which soon becomes a black blob with each
successive value scribbling on top of what was already there and
creating a "blob of black" in a few iterations of the while loop...

[code snippet]
pkg load image;
I = imread ("Schematic.jpg");
imshow (I);
hold(on);

function Display_Value(Label, Units, Value, X, Y)
#       Output = strcat(Label, num2str(Value), "[", Units, "]" );
        Output = strcat(Label, num2str(Value), Units );
        text(X,Y,Output);
endfunction

while true
        Display_Value("T_{amb}=", "C", T_amb, 100, 0);
        sleep(10);
endwhile
[end code snippet]

But when I place the imshow() outside the while loop, I get values
overwriting the old.

How can I get the non-flicker of method B. but legibility of method A.?
Any ideas?  Thanks!

JMB


reply via email to

[Prev in Thread] Current Thread [Next in Thread]