LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Set Overlay Properties

I tried using IMAQ Set Overlay properties with property as "scale" and behavior as "transform" for the image I wanted to resample. The text overlays looks as if they got stretched. Is there any white paper that I can refer regarding the behavior IMAQ Overlay Text and IMAQ Set overlay properties?

The first image is of resolution 800x641

The second image is resampled and its resolution is 200x154

Download All
0 Kudos
Message 1 of 8
(3,164 Views)

You will help us immensely (to help you) by posting your code.  We don't know what you did, so we can't easily tell you (and explain to you) what you did that was either incorrect or incomplete.  It would also help to include a sample Image.

 

If you are using LabVIEW Project, and all of the Project Files (and, perhaps, the Sample Image) are in the same Folder, compress the Folder and attach the resulting .zip file.

 

Bob Schor

0 Kudos
Message 2 of 8
(3,113 Views)

Hi,

I've attached a sample vi and image.

0 Kudos
Message 3 of 8
(3,104 Views)

Thanks.  Here are a few interesting "facts":

  • The "Distortion" is not seen if the Resample Factor = 1, but is seen for all larger Resample Factors.
  • The Distortion is not obvious at 0° and at 90°, but is at other angles (even 0.1°).
  • The Distortion is not affected (noticably) by the Interpolation Type.

Some conclusions:

  • Resample is "clever" -- if the Image Size is not changed (Resample Factor = 1), it does nothing to the Image.
  • The observation that going from a Rotation of 0° to 0.1° (or from 90° to 90.1°) both seem to make the letters taller (not to stretch it in the X or Y direction) says something is funky in the algorithm, I think.
  • I wonder if there is a relationship between Image size and Display size.  The (blank!) Image you attached is much larger than my screen, so it is compressed (a lot) to be displayed.  Hmm, what if I don't compress it?
  • Nope, same thing happens when you show it full size.

I think it has something to do with the size/shape of the Image and the size of the screen (and possibly shape of the screen's pixels, i.e square vs rectangle).  I'd say that the phenomenon is "real", but I'm not certain if this is a "bug" or a "feature".  The fact that it seems to have a pretty sharp "discontinuity" near 0 and 90 makes me think "bug", but as I don't have an Image to test against, it might only be a quirk of IMAQ's rendering of Text that's the problem.

 

Bob Schor

 

0 Kudos
Message 4 of 8
(3,091 Views)

Thanks.

I have observed the same.

Is there any white paper/document/blogs that I can refer to understand about IMAQ Overlay Text function?

0 Kudos
Message 5 of 8
(3,071 Views)

I doubt it.  We are clearly talking about some strange behavior "buried in the weeds" underlying the algorithm NI is using.  I'm sure that there are texts written about Computer Graphics that go into going into and out of various implementation of images-as-pixels -- you could try doing a Web search for such books, but it's likely to be, at best, a "distraction".

 

Here's part of the problem, particularly with Text.  Text using Western alphabets tends to have many vertical lines.  Representing these as pixels results in nice sharp edges as the pixels replicate vertically.  Now consider rotating it by 0.1° -- the Pixels will have some X component that needs to be recognized and computed.  You'd think it wouldn't matter too much, but who knows what computations are being done "behind the curtain" -- in the interest of speed, approximation short-cuts may have been employed that introduced subtle errors, or some other factor whose existence I don't know might be at fault.

 

Bob Schor

0 Kudos
Message 6 of 8
(3,031 Views)

True. 

I tried changing the font name from Times New Roman to Calibri and found that this "stretching" of text is not much evident on the screen. Looks like only some font names have such peculiar behaviour. 

 

0 Kudos
Message 7 of 8
(3,016 Views)

Good catch -- I wouldn't have thought about the "old" and the "new" Font Features.  As I remember (and this could be wrong), Times New Roman is a TrueType Font, developed for the earlier versions of Windows (e.g. Windows 95, 98), whereas Calibri is a ClearType Font, adapted by Microsoft Office in 2007.  ClearType use sub-pixel shading, which I think means that a stroke that is, say, 30 pixels tall when upright, and (let's imagine) a pixel on your screen take 0.005", so the stroke is 0.15" high, when it gets tilted, by "shading" the pixels, it will continue to occupy 0.15" on the screen.  Note that if you turn it 90° and want it to still be 0.15" high, this might not be 30 pixels unless the pixels are "square" (which need not be the case).

 

Bob Schor

0 Kudos
Message 8 of 8
(2,999 Views)