Dividing an image into block and calculate difference between pixel

1 view (last 30 days)
Hey, I have an image of size 512*521 .I divided into blocks of size 2 by 2. which means four pixels are defined for each block. now the my question is : How can I compute the difference between pixel pairs in each block? .e.g if U1,u2,u3, and u4 are pixels in the first block how can I generate a random value from each block then use it to compute the difference in the corresponding block . like for block1: diff0 =u1, diff1= u2-rand value, diff2 = u3-rand value, diff3=u4- Then do it for all blocks and store the results for each block in a vector . Your help will be highly appreciated.

Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!