LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming error diffusion

Solved!
Go to solution

Hey there!

 

I want to program the so called error diffusion algorithm for my Spatial Light Modulator. What the algorithm does is it calculates the value a pixel is supposed to have and divides this by the value the pixel actually has. This gives us a reflection per pixel, which must then be rounded to either a 0 or a 1. This rounding induces an error that is diffused to surrounding unprocessed pixels. It therefore has the name 'error diffusion algorithm', since it diffuses the error over several pixels.

This algorithm was applied by Dorrer and Zuegel on binary spatial light modulators such as Digital Micromirror Devices and Deformable Mirrors.

A nice view of a block diagram of it is this:

Error algorithm.png

The reflection t(m,n with m,n being the coordinates of the system) is rounded to either a 0 or a 1. The value that is actually assigned is called s(m,n). The difference between these two is the error e(m,n). The unprocessed pixels are these:

Dorrer and Zuegel processing.png

 

I am having trouble with the diffusion of the error to the neighbouring pixels, so the most important part. I tried adding this to my algorithm but failed.

My attempt included separating the coordinates from the image and adding numbers to them.

I did this as following:

 

I seperated the coordinates and splitted these into the X and Y values. I then copied this data four times for four  neighbouring pixels. These were x+1,y and x,y+1 and x+1,y+1 and x-1,y+1.

I however had trouble combining the error with the calculated value when I actually get to those pixels. I can't get to add the error to the pixel that is for an example underneath it. Has anyone any idea who I can add the error to these neighbouring pixels?

0 Kudos
Message 1 of 3
(2,382 Views)

Hi Choisai,

It's a very late repl, but do you still need help with this aplication? I can look into it if you want!

 

Best regards,

Jos

Message 2 of 3
(2,165 Views)
Solution
Accepted by topic author Choisai

Dear Jos,

 

I have already succeeded. I used case structures and logical operators to determine whether or not a pixel was at the edges. Then I filled an empty array with these errors and later on retrieved the error per pixel. But thank you for the offer!

0 Kudos
Message 3 of 3
(2,152 Views)