removing lighting effects

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
paulj

removing lighting effects

Post by paulj »

HI

Whats the best way of removing problems with reflection in pictures, e.g if you take a picture of a car on a sunny day, and half the car has sunlight reflected, is this possible to remove/correct for, and more importantly is there anyway (except visually) to see that you picture includes this 'effect'. The latter is more part of a general questions, Is there anyway to know you image suffers from effects like motion blur etc, without looking at it manually ?

Tks

Paul
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: removing lighting effects

Post by fmw42 »

if on unix, you can try my scripts, redist, retinex or duotonemap (similar to Photoshope Shadows/Hightlights tool) and see if either will help your problem. (see the car example in retinex)

You can determine motion blur via FFT analysis using the cepstrum, see my cepstrum script (examples are lens defocus and motion blur). But yu have to use the script in HDRI IM mode.

see link below
paulj

Re: removing lighting effects

Post by paulj »

tks, just seen the retinex examples on your website, looks like it will work, will give it a go,

Paul
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: removing lighting effects

Post by fmw42 »

you may find the duotonemap a bit easier and better results and the fastest of the 3 methods
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: removing lighting effects

Post by fmw42 »

if you post a link to one of your images, we can test various approaches and understand your problem better.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: removing lighting effects

Post by fmw42 »

and more importantly is there anyway (except visually) to see that you picture includes this 'effect'. The latter is more part of a general questions, Is there anyway to know you image suffers from effects like motion blur etc, without looking at it manually
This is a much harder problem and the technique would depend upon the effect, if it can be solved at all.
paulj

Re: removing lighting effects

Post by paulj »

Hi

I uploaded one that I am trying to remove the glare from, with little success

http://img63.imageshack.us/img63/8098/csmtrue23.jpg

Paul
paulj

Re: removing lighting effects

Post by paulj »

I was thinking if its not easily possible to detect images which have 'glare' then is there a downside to processing all images and try to remove glare ?

Paul
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: removing lighting effects

Post by snibgo »

The glare has removed information by burning it out. Some algorithms (not built into IM) can guess what has been lost, based on nearby colors.
snibgo's IM pages: im.snibgo.com
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: removing lighting effects

Post by anthony »

The glare has removed information by burning it out. Some algorithms (not built into IM) can guess what has been lost, based on nearby colors.
That is changing! Their are techniques. but nothing like what some othe rprograms can do.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
paulj

Re: removing lighting effects

Post by paulj »

Hi

Can someone drop me a hint as to what programs I should look at. Of course if the time taken to process is too long, then it may not be worthwhile, but would be interesting to find out nonetheless

tks

Paul
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: removing lighting effects

Post by fmw42 »

you can try this, but it needs some adjustment (possibly a blur of the mask and some adjustment of the modulate paramenters and perhaps a blending rather than a straight replacement).

convert csmtrue23.jpg \( -clone 0 -modulate 75,100,100 \) \( -clone 0 -threshold 75% \) -compose over -composite csmtrue23_t75_m75.jpg

or with some of these adjustments

convert csmtrue23.jpg \( -clone 0 -modulate 75,50,100 \) \( -clone 0 -threshold 75% -blur 5x65000 \) -compose over -composite csmtrue23_t75b5_m75x50x100.jpg
Post Reply