Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.