LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read an array from the bottom to the top

Solved!
Go to solution

Hy. I have a problem. I have a 2D array and i already read it from the top left corner to the bottom right corner. But in order to apply an immage processing i'd like to read it from the bottom left to the top right. To make it the first time i used 2 for loops but i can't achieve to do it in the other sens. Please if someone have a solution  ? thaks everyone 

0 Kudos
Message 1 of 15
(4,453 Views)

You can either calculate the new indices based on the original index and the array size, or you can transform the 2D array so it is arranged the way you want.  The first solution is very simple math. Here are a few examples on how to do the second solution.

0 Kudos
Message 2 of 15
(4,444 Views)

ok but i am not shure to understand completly the first one how can i changes all the indicies on the array  ? and thurthemore because i have to make and immage processing on certains pixels that i listed before i think it will be incompatible 

0 Kudos
Message 3 of 15
(4,432 Views)

In fact i just wat to read it back wards wthout modifying the array. In C or python it will so simple and i can't achieve it on LABVIEW ^^ 

0 Kudos
Message 4 of 15
(4,428 Views)

Hi Hellunteur,

 

how do you do that in C? Show the code...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 15
(4,426 Views)
Solution
Accepted by Hellunteur

You can easily read it backwards using LabVIEW, for example instead of getting element "i" you would get element "N - i - 1", where N is the size in the current dimension.

 

You haven't really explained what kind of image processing you are doing. The actual implementation details probably depend on it. For some processing, the result does not depend in which order the elements are processed so you might not need to do anything special.

0 Kudos
Message 6 of 15
(4,425 Views)

this solution sound good to me. How can i change this litte i by N-i-1 ? and my immagae processing is region growing by labelling so i need the pixels at their actual location and if i move them i'll lose a lot a precious informations for the rest of my sftware. Thanks a lot by th way you'r very helpful and i think it's not the first time that you take out of a wrong place ^^

0 Kudos
Message 7 of 15
(4,421 Views)

Hi Hellunteur,

 

N-i-1 can be so easy:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 15
(4,418 Views)

i didn't made it in C cause my project is in LABVIEW but in C it's so easy to put variables everywhere and decrement them to read the array as you want in fact exactly as 

0 Kudos
Message 9 of 15
(4,415 Views)

Thks but how can i put the new value in ;y i in the for loop in order to make it stqrt from the good value? here is my problem because even if i can have the good value i can't put it in my loop as an indication. Cause the i is just an outpout i can't give him a value to take

0 Kudos
Message 10 of 15
(4,402 Views)