From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

finding edge cordinates from the rake function

Hello,
I am using LabVIEW to acquire and process an image so that I can perform certain calculations on the image. I can acquire the image and filter out some of the unwanted particle noise. From here, I am using the rake function so that I can obtain all of the edge coordinates of the image. So here is where my problem lies. I want to re-order the format of the edge coordinates so that I can perform the calculations using a C program, which has already been written. The form that the C program needs the coordinates is like this:
Y Values X Values
.2246 .6054
.2247 .6061
Etc.
From the rake function output of �ALL EDGES�, I�ve tried to use the index array function � to unbundled by name � to index array function � t
o unbundled by name and it seems to split up each individual coordinate into an x and y value which is what I was aiming for, then I wanted to Ive enclosed that code inside of a for loop connecting the # of edges found to the # of loops that the for loop would do; then, I use two build array functions that contain all of the x and y values separately so I could put that into a spread sheet of some kind. This would be read by the C program. Unfortunately, this process of using the For loop do not work. I get this error message:
You have connected a scalar (non-array) data type to an array of the same data type. This type conflict may be resolved by building the scalar type into an array. Check for a tunnel on a loop that has indexing incorrectly disabled.
The type of the source is cluster of 3 elements.
The type of the sink is 1-D array of double [64-bit real (~15 digit precision)].

Im not sure why I get this error message but I was hoping that someone could shed a little light o
n this subject and help me out some.
Thank you for your time.
Nick
0 Kudos
Message 1 of 2
(2,533 Views)
Hello Nick,

Thank you for contacting National Instruments.

I tested this out here on my computer and did not get the same error that you received. I have 2 nested for-loops that unbundle the contents of the clusters. In the outer loop, I unbundled the Edge Coordinate array, and in the inner loop, the X and Y arrays. Instead of manually indexing the array, I used the auto-indexing feature of the for-loop. This made it so I didn't have to specify the number of iterations for the loops.

The image attached to this post is a partial VI that shows the loop structure I used for testing. Not all of the required inputs for the IMAQ Rake VI are shown, but the loop structure definitely works. I also pointed to one of the indexed tunnels with a red arrow.
Each of the output arrays is two dimensional. Each column corresponds to one of the edges found, and the rows correspond to the specific points on the edge.

Hope this helps you resolve the error.

Best Regards,

Jesse D.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,533 Views)