LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Problems

I have a problem with the arrays.

The entire program will be with the Vision package programmed, but for my part problem, it does not matter.

So I want an image as an array processing, which works well, now I will have a Determines size (1x4), the mean values of all pixels read that works well.
My problem now is that the funds received values in an array save. I can be the processing, but the old values are overwritten, and so does the array always with the same numbers full.





I know that the not so well programmed, but it is only the first to test whether it ever will.
Improvement suggestions are always welcome.
0 Kudos
Message 1 of 23
(4,626 Views)
I don't fully get what you want, but the following code should come near:



Ton



Message Edited by TonP on 11-19-2007 10:40 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 23
(4,619 Views)
Thank you for the fast answer.

I post more of the vi, that you can look better what i mean.




I want convert an image to an array. But with my old version the array fill judt with the same mean value.
And the question is now, what is the bug in my vi.

I don´t understand the example from the first answer, because i don´t know how to wire the "Initialize Array" vi

I hope so its better to understand what my problem is.
0 Kudos
Message 3 of 23
(4,609 Views)
Hi Phartas,

where's the problem in using the "Initialize array"? You already used it in your example and there is explanation in context help on wiring!

Problems of your vi: You don't use dataflow!
You create some arrays in the inner for loop BUT you create them in every iteration. This way you "forget" results of iterations before! That's the reason for using a shift register (as in TonP's example). Instead of creating new arrays in each iteration you simple store a value in a pre-initialized array (by using "Replace Array element").
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 23
(4,603 Views)
So here is my new vi.


It works, but not so fast.
the inner loop count just every second step and its to slow.
I have no delay in it but it need nearly 10 seconds to get the new value and these the wrong one.

And before i forget it, thank you for your answers!

0 Kudos
Message 5 of 23
(4,589 Views)
Hi Phartas,

what about attaching the vi (instead of a broken image link)?


Message Edited by GerdW on 11-19-2007 01:04 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 23
(4,571 Views)
ok

First you must read the image in the main and the you can look in the subvi "Image Array"  the problem

Link


0 Kudos
Message 7 of 23
(4,565 Views)
Hi Phartas,

dummerweise fehlt mir da die Berechtigung...

Kannst du die Bilder (vorzugsweise PNG/JPG) nicht einfach hier anhängen? (Siehe unten: "attachment")
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 23
(4,561 Views)
Würd ich gerne ich bekomme aber hier nix angehängt.
Ich kann die Datei zwar auswählen mehr aber auch nicht.

Wenn mir mal einer sagen könnte wie ich die Datei einfügen oder anhängen kann?


How i add a attachment?


0 Kudos
Message 9 of 23
(4,557 Views)
Hi Phartas:

under the editing window you will find the "attachment" area to add files:



Message Edited by GerdW on 11-19-2007 01:39 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 23
(4,533 Views)