LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Who knows the principle of the graph's displaying?

Dear All,
I am sorry to say that I don't whether I can make you understand me.
I want to know that in a graph how to use one pixel to display two point. Is the value of the pixel average of the two values of the point?
For example, there are 1024 points in a graph.  But the graph is only using 512 pixels. That means one pixel display two points.
What is the relationship of the final value and the value of two.
 
Thank you.
0 Kudos
Message 1 of 8
(3,242 Views)
If I understood you correctly, you wnat to know how to display more data point than ther are pixels on the screen.
 
This presentation touches on that topic.
 
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 8
(3,223 Views)
You are talking about resize image, right?
Basically, you can define the relation anyway you want.  There is no right or wrong way.  Only better or worse.  Fast or slow.
Take an average of the two pixels is the easiest and fast way, but the image quality is the worst.
A better way would be considered all nearest neighbor pixels.
For high quality rsize, you can use bilinear interpolation, or cubic interpolation.  But LabVIEW is too slow for that.
 
 
George Zou
http://gtoolbox.yeah.net
George Zou
Message 3 of 8
(3,197 Views)
Thank you for your reply.
You said the better way is considered all nearest neighbor pixels.
What do you mean?Can you give me some detail?
And What kind of book need I to see?
Thank you!
0 Kudos
Message 4 of 8
(3,175 Views)
using moving average
Message 5 of 8
(3,166 Views)
oh,Thank you:)
0 Kudos
Message 6 of 8
(3,160 Views)
I am not sure your original question was answered.  If you try to draw more points than there are pixels on the graph, LabVIEW does its best to draw lines between each of the points (assuming you are drawing lines, otherwise it just plots every point with the style you specify).  If two points lie within the same horizontal pixel width, you will normally get a vertical line.  For example, you have a graph with a 200 pixel wide display.  You plot an array of 1000 points.  Points 500 and 501 have values 20 and 22.  On the middle of your display, you will see a vertical line at X pixel position 100 connecting values 20 and 22 on the Y axis (along with the rest of your data).

Check out the tutorial Managing Large Data Sets in LabVIEW for an efficient algorithm to speed up plotting if you have more points than pixels.
Message 7 of 8
(3,140 Views)

For example:

the original pixels index

11   12    13    14

21   22    23    24

31   32    33    34

and you want to combine pixel22 and pixel 23,

the new pixel = (2*pixel22 + 2*pixel23 + pixel12 + pixel13 + pixel21 + pixel24 + pixel32 + pixel33) / (2+2+1+1+1+1+1+1)

or even better:

the new pixel = (4*pixel22 + 4*pixel23 +2*pixel12 + 2*pixel13 + 2*pixel21 + 2*pixel24 + 2*pixel32 + 2*pixel33

                            + pixel11 + pixel14 + pixel31 + pixel34) / (4+4+2+2+2+2+2+2+1+1+1+1)

......

You might need a dll or cin if the calculation is too slow in LabVIEW.

 

George Zou

http://gtoolbox.yeah.net

 

George Zou
Message 8 of 8
(3,126 Views)