110 likes | 120 Vues
CS320n –Visual Programming. Clusters and Images. What We Will Do Today. Look at clusters in LabVIEW and start working with images. Clusters. Arrays are used to hold many elements that are of the same data type A cluster is used to hold together data of different types
E N D
CS320n –Visual Programming Clusters and Images
What We Will Do Today • Look at clusters in LabVIEW and start working with images Clusters and Images
Clusters • Arrays are used to hold many elements that are of the same data type • A cluster is used to hold together data of different types • normally fewer elements than an array • but some of the elements may be arrays themselves Clusters and Images
Cluster Example • Take a name and an age and put them together • Name = string • Age = int • The “Bundle” function is used to group together different elements into a cluster • number of input can vary • drag down on button of function to add more inputs Clusters and Images
Creating a Cluster Bundle Function Clusters can be used to reduce the number of wires in a diagram. Like a high level view of data. Analogous to high level methods / functions in Alice. Clusters and Images
Opening Images in LabVIEW • LabView provides a way to open image files • jpg, png, and bmp are image types • different ways of saving an image on a computer • Specify location of image with a path control Clusters and Images
Picture functions • To open a picture in LabVIEW use a path control and wire to a Read JPEG File function • Note the output on the Read JPEG File function Clusters and Images
Image is a Cluster • Lots of Data! indicates arrays Clusters and Images
Looking at the Raw Image Data • Use an Unbundle function and an array indicator in the image cluster • right click on image output and select create -> indicator Unbundle Right click on this output terminal Clusters and Images
Class work • Link on the class web page to an image of the UT tower • how many pixels in the picture? (Find answer using LabVIEW, not some other graphics program) Clusters and Images