Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

[Matlab] dynamic change in formatting crop not showing

  1. Nov 11, 2014 #1
    I am trying to crop an image and be able to manipulate in some way (I adjusted contrast) and show change in formatting as its displayed beside the original image (by making it turn more and more blue).

    The code runs successfully, but it seems to already have made the cropped image as blue as the for loop would take it.

    How can I edit the code so that as the original is displayed beside the cropped, the cropped image is showing the change in formatting of turning more and more blue?

    Here's what I have so far:

    Code (Text):

    I = imread('peppers.png');
    I2 = imcrop(I);
    I3 = imadjust(I2,[.2 .3 0; .6 .7 1],[]);
    subplot(1,2,1), subimage(I);
    for i = 1:0.1:7
      I3(:,:,3) = I3(:,:,3) + i;
      subplot(1,2,2), subimage(I3)
    To understand what is meant by showing an image to turn more and more blue upon display, please run:

    Code (Text):

    img = imread('peppers.png');
    for i = 1:0.1:7
      img(:,:,3) = img(:,:,3) + i;
  2. jcsd
  3. Nov 16, 2014 #2
    Thanks for the post! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook