The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: changing background in .jpg to white without changing object
Replies: 1   Last Post: Jul 14, 2013 8:00 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Loren Shure

Posts: 1,067
Registered: 12/7/04
Re: changing background in .jpg to white without changing object
Posted: Jul 14, 2013 8:00 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Rafal " <> wrote in message
> Hello,
> How can I change the background in my .jpg from for example: grey to white
> without change photographed object?
> Assume that I click on the image and select the background (level of
> greyness)
> L1 = imread('image.jpg');
> L1 = double(L1)/255;
> imshow(L1)
> [x,y]=ginput(1);
> y=round(y);
> x=round(x);
> p = L1(y,x,: ); ...
> ..
> ..
> I have no idea what is next :/

I am NOT an image processing expert. But you may want to do something like
a replace pixels "near" that color - unless some of the object also has that
color. Then you might try to fill that region instead. But to do so, you
would first have to convert to black and white - fill and find what was
filled, then transform back to color. Not sure how you find which pixels
were updated in B&W except by comparing before and after.

I'm sure someone more well versed in image processing can give you an easier


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.