Re-arranging pixels - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Re-arranging pixels

googydeathgoogydeath Posts: 2Member
Hi. I want to re-arrange the pixels of the color image matrix row wise, column wise, and diagonally. I need to do these 3 process individually. I tried the 'circshift' function for row and column rearrangement. But the output image is too predictable. Can anyone help me with any other functions or codes to perform these 3 process.


Comments

  • PredictorPredictor Posts: 17Member
    You might try rand scrambling, using [italic]randperm[/italic], like this:

    >> TinyImage = [0 2 3 11; 20 1 5 7; 13 10 8 9; 12 22 31 6]

    TinyImage =

    0 2 3 11
    20 1 5 7
    13 10 8 9
    12 22 31 6

    >> R = randperm(4)

    R =

    3 1 2 4

    >> TinyImage(1,:) = TinyImage(1,R)

    TinyImage =

    3 0 2 11
    20 1 5 7
    13 10 8 9
    12 22 31 6


    -Will Dwinnell
    [link=http://matlabdatamining.blogspot.com/]Data Mining in MATLAB[/link]

Sign In or Register to comment.