LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does it process lexicographically?

My previous comment was incomplete, so here is what I actually added.

I tried to follow your instructions but sometimes I was a bit lost on how I had to realize it, for I have little experience with auto-indexing and shift registers. Here is what I did:

 

I took the error that was being calculated:

Labview 1.png

 

And then I put this error through several weighing factors.

The reason for this is because the diffusion to the four surrounding unprocessed pixels are not equally important.

I got these values from a paper by Dorrer and Zuegel. For our purposes, just see them as weighing factors:

The line to which the big red arrow points to is the line that holds the error

 

It goes down and down and comes to the weighing factors:

 

Labview 1.png

The text boxs with the (x,y) are the coordinates of the pixels. So pixel (Y,X+1) weighs with a factor -7/16 for an example. The error is multiplied with value and goes off to a shift register.

So what we have now is this:

Labview 3.png

 

The processed errors go off to shift registers

Labview 4.png

 

I need these errors to be stored in an array and to be retrieved again when neccesary. So the values turn up on the left again:

 

Labview 5.png

 

The shift registers enter the for loops with auto-indexing, one element at a time. I see no problem here because the errors are also produced one at a time (confirmation of this would be appreciated).

 

I then put these values in an array. The initialize array function only allows you to enter an element into an array and then specify the number of dimensions of that array. I need to put these values into the array itself with specified coordinates. This is not possible so I tried something different.

I copy the image array and multiply it with zero so all its values will be zero. I then use the replace array subset to replace all those values of zero with the errors at the specified coordinates. To make it a bit different I removed some of the wires:

 

Labview 6.png

The black arrow points to where I copy the incoming image array and multiply it with zero at the green arrow. The zero-array then goes to to replace array subset, which is where the red arrow points.

 

I then take the iteration count (which is thanks to the setup also the width and height of the image array) and either add to it the numbers needed. For (x+1,y) i add one to the x and hook the Y up directly to the column index input of the replace subset function.

For clearity, here is it with only one pixel coordinates hooked up:

labview 7.png

 

Now I am not completely sure that I hooked it up the right way. The iteration count will start at 0, just like the y-count. That does refer to the very first pixel in the array, but I can't help but feel a bit unsure about this. Have I done it properly?

 

In any case, after that I hook up the input from the actual pixels. For one input it looks like this:

Labview 8.png

Now here I am a bit unsure. Should the input be set on auto-indexing? It will transfer the input then pixel for pixel, but since it now goes from outside to inside, I fear that it will first fill up the entire array for one row and THEN put the error array through. Again, will this work?

 

In any case, now it's a matter of hooking up all the index numbers with all the corresponding inputs from the errors. I have auto-indexing disabled here because I think that's right, but I am not sure.

Labview 9.png

 

I think the error lines that are coming from the left should be set on auto-indexing because otherwise I will first add one elemnt and then two elements, then three elements (because the error array ofcourse keeps growing) etcetera etcetera. But again, please help me out here I am not that experienced with labview.

 

The error array is now made. Then I use the index-array function to retrieve the error at the incoming coordinates. That is this part of the program:

Labview 10.png

 

Let's zoom in on it:

Labview 11.png

The error array that has just been created goes into there. The X and Y coordinates of the current pixel go into the row and column input to find the error that exists at that pixel. And so an element is being found and that goes out of the loop again:

 

Labview 12.png

It is currently on auto-indexing, but I don't actually see no disadvantage or advantage to have it on. It  will always pass out one pixel at a time, so does auto-indexing needs to be turned on or off?

If all of this is correct, I will only need to come up with case-structures for the edges of the image. But I want to make sure this is correct before I start on that

0 Kudos
Message 11 of 13
(352 Views)

There is no way I can possibly follow what you are trying to here.  You are the subject matter expert for the image processing you are trying to do.  I appreciate that you took the time to work up all the screenshots and put a paragraph with each of them, but I can't follow all that to be able to tell you whether you are doing something right or wrong.  Ultimately, you'll have to figure out if you are getting the results you want, and if not, why.  My gut feel says you are probably autoindexing at times you shouldn't be, but I don't know.

 

You've got a complicated algorithm.  If I were you, first I'd make a flowchart of what you are trying to do with the processing.  Then I'd start coding it, but start out smaller.  Instead of implementing the full algorithm, to it in steps.  Get each step working to your satisfaction.  Instead of combining 4 or 6, or 8 pixes worth of data.  Start with only a couple.  When you are comfortable the concept is working that way, then you can go and build up the algorithm the rest of the way.

0 Kudos
Message 12 of 13
(347 Views)

You are right, I got ahead of myself. It's just that I've been looking at it for so long and Labview not always intuitively clear. I try to work further and keep this thread updated as my progress continues. In the mean time, here is the device I have made the program for:

Lower res DMD.jpg

 

See that tiny mirror? It's about the size of the nail of your thumb and consists of about a million mirrors of about 10 micron in size. I want to use it for wavefront modulation of lasers, but you can use it also for light projection. So this is what it's all for: just a tiny mirror

0 Kudos
Message 13 of 13
(341 Views)