[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
imshow: flicker and superposition problem (re-post)
From: |
jmb |
Subject: |
imshow: flicker and superposition problem (re-post) |
Date: |
Mon, 14 Jul 2014 20:13:06 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
Hello,
Some time ago I had posted the following in this forum, but did not get
any responses, which why I am re-posting. My apologies for the
repetition, but I would appreciate any suggestions anybody can offer!
Thanks, JMB
=================================================================
I am trying to use something like the following code to superimpose a
displayed value over a static image.
I am running into 2 problems with octave 3.2.4 (in Ubuntu12.04.4 32bit)
a) A flickering that I would like to suppress as the image is erased and
redisplayed within each cycle of the 'while' loop.
b) If I comment out the imshow(I) inside the 'while' loop then the value
of P_{amb} overwrites the previously displayed value and soon I get one
black mass of lettering that one cannot read.
I have tried some methods that have failed. Can anybody suggest a fix?
Thanks!
Errata: The following (corrected) code will run. Just use any *.png
file of your liking placed in the same subdirectory where this code is
run from.
==================================================================
#!/usr/bin/octave
pkg load image;
I = imread ("Schematic.png");
imshow (I);
hold("on");
P=0;
function Display_Value(Label, Units, Value, X, Y)
Output = strcat(Label, num2str(Value), Units );
text(X,Y,Output);
endfunction
DisplayPres = true;
while true
# imshow (I);
if DisplayPres == true
Display_Value("P_{amb}=", "bar", P, 0, 0);
P = P + 0.001;
endif
sleep(1);
endwhile
==================================================================
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- imshow: flicker and superposition problem (re-post),
jmb <=