octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #56958] [Octave-Forge] Implementation of inser


From: Rik
Subject: [Octave-bug-tracker] [bug #56958] [Octave-Forge] Implementation of insertText
Date: Fri, 27 Sep 2019 13:25:31 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #56958 (project octave):

                Category:         Octave Function => Octave Forge Package   
                  Status:                    None => Confirmed              
                 Summary: Implementation of insertText => [Octave-Forge]
Implementation of insertText

    _______________________________________________________

Follow-up Comment #1:

Changing the category to Octave Forge Package since any implementation would
take place in a package, rather than in octave-core.

The function can easily be simulated by creating a figure, puting the image in
it, putting the text in it, and then pulling the pixels back out with print. 
A rough draft is shown below.


function RGB = insertText (img, pos, txt)
  hf = figure ("visible", "off");  # Invisible figure for combining images
  imshow (I);                      # Add image
  text (pos(:,1), pos(:,2), txt);  # Add text
  RGB = print (hf, "-RGBImage");   # Extract new image
  close (hf);                      # cleanup temporary figure
endfunction


This works for me with a simple invocation like


hf = figure;
sombrero
img1 = print ("-RGBImage");
clf;
imshow (img1);
img2 = insertText (img1, [200, 200], "Hello World");
hf2 = figure;
imshow (img2)




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56958>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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