RetouchPRO

Go Back   RetouchPRO > Technique > Image Help
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read Chat Room


Image Help Got a problem image? Don't know where to begin? Upload images and ask our users what they think or if they can help

Reply
 
Thread Tools
  #61  
Old 05-29-2005, 01:15 PM
jcr6's Avatar
Member
 
Join Date: Oct 2002
Location: Asheville, NC
Posts: 72
HSL may have better precision than RGB

FFTs have complex floating point values at every point. It is a MAJOR HACK to try to take 8-bytes of information and encode it into 3. A HUGE loss of information. There is also a 180° symmetry between the top and the bottom of the image, post transform, so you will have funky results if you map out a different set of frequencies on the top than on the bottom. One solution is to copy the layer, rotate it 180°, keep the darker pixels between the layers, then flatten.

Notice how the workflow keeps getting more complex?

I suspect that the RGB encoded version is worse than the HSL encoded version. For one reason, he should have used R & B, not R & G because most of the Luminance information is also stored in G.

He should also have done a logarithmic µ-law encoding on Luminance, because that way you'd see more of the rays coming out from the stars and be able to do more accurate correction. Low intensity values will be overrepresented and high intensity values will have big truncation errors.

#1 - Lobby him for a 16-bit version of the plugin. This will solve most of your woes.

#2 - If your stars are white on a black field, you really need to erase to black and perform the anti-aliasing (feathering on a selection or a soft black brush).

Yes, I know all about Image-J. Your tax dollars at work. Prior to that, Wayne Rasband was working on NIH-Image, which had a bad combination of poor science and being free (he's a government employee). Thus, people used it and had no reason to pay for a *real* package that had the requirement of using good science. It also made it really difficult to compete in the early 90's for the low end of the market. Image-J has just been a sport since then. If you can fit it into you workflow, go for it. It is worth exactly what you paid for it. (If you don't consider that your tax money has been spent driving little guys like me out of business.)</rant>

FFTW is just another implementation. Whose implementation is used is largely irrelevant as far as the quality of the result is concerned.
Reply With Quote
  #62  
Old 05-29-2005, 05:34 PM
byRo's Avatar
Moderator
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,592
Chirakov x Fovea (Round 1)

If you look at the attachments first, you'll think that the first should be in Doug's Cloud thread and the second is a very uninspired art work.. read on...

My final year project tutor taught me that when you want to discover something, devise an experiment - so this is what I did.

1) Take an "average" photo (Dunno what is average, but the golf balls ain' t);
2) Separate out Luminosity;
3) Expand canvas to some size multiple of two, fill in with 50% grey ;
4) Run through FFT, then imediately return through inverse FFT;
5) Crop back to the original size;
6) Compare with the original.

The noisy image posted is an amplified (Levels 0 - 8) picture of the difference using the Alex Chirakov filter (average difference 3.5), the clean "art" is the Fovea filter (average difference 0.3).

There was no significant difference between the RGB and HSB flavours of the Chirakov filter.

Conclusions:
-The Chirakov version does introduce a considerable amount of noise, whereas the Fovea process does not introduce any. (There is a 1 pixel difference, but this is uniform and to me that's not noise).
- There's no difference between the two Chirakov filters, so you can use the easier (RGB) one without problems.


PS Chris - keep it coloured, otherwise the folks will think we're twins!
Attached Images
File Type: gif Error-Chirakov.gif (39.3 KB, 36 views)
File Type: gif Error-Fovea.gif (7.5 KB, 31 views)
Reply With Quote
  #63  
Old 05-29-2005, 06:06 PM
Duv's Avatar
Duv Duv is offline
Senior Member
 
Join Date: Oct 2003
Location: Nanaimo, British Columbia
Posts: 1,213
You both look like you need to crawl out of your cubby holes and hit the beach for a while. Ro, have you taken my advice yet?

Cheers
Dave
Reply With Quote
  #64  
Old 05-29-2005, 06:25 PM
byRo's Avatar
Moderator
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,592
Quote:
Originally Posted by Duv
Ro, have you taken my advice yet?
1,495Km to go - seems like I can already hear the waves

Reply With Quote
  #65  
Old 05-30-2005, 06:39 AM
jcr6's Avatar
Member
 
Join Date: Oct 2002
Location: Asheville, NC
Posts: 72
Duv, message well taken

(Actually, this was a break for me -- I'm supposed to be writing code.)

The test was a good idea, Rô.

Later. Since we're not near the ocean, it's time to go to the YMCA.
Reply With Quote
  #66  
Old 05-30-2005, 10:06 AM
Cameraken's Avatar
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,122
Wow! That’s heavy stuff. I feel like I need the beach after trying to understand that lot.
I am not a professional retoucher. I don’t have hundreds of textures to remove. I hit this problem once or twice a year and just want to get the best I can from an odd picture.

Byro
Thanks for doing that comparison I think you are saying
FFT RGB is as good as FFT HSL But FFT Fovea is Better.
But if I’ve read correctly you are comparing the loss between the transfer
What interests me is the end results and how to achieve it. So what probably interests me more is “What do I do to the FFT to improve the Picture?”

The initial picture I supplied is a very poor example to use as a ‘Test picture’
What do you think of jcr6 cat picture – is that a good test picture?

Jcr6
I’ve read chapter 4 and pages 9 and 10 of the pdf.

Filter > IP*Fourier > FFT(Forward)
Filter > IP*Fourier > FFT(Inverse) OR Apply Filter and FFTInverse
The picture comes back different (darker the grey padding goes black)
Could you please explain this?

Also could you please clarify that FoveaPro should be working on a Luminocity Image?
And if so then do you agree that byros method is OK.

1) Duplicate original image, right click on title bar and click Duplicate (that's a new image, not just a layer):
2) Set background colour to grey 127,127,127 (for Padding)
3) Image > Canvas Size > 512,512 in Pixels (In this case - square with dimension equal to an exact power of two)
4) On the new image, get Luminosity (New Layer (<Ctrl><J>), Edit>Fill - 50% grey, color, 100%.);
5) Flatten all, <Alt><L><F> (FFT does not understand layers);
6) Filter > IP*Fourier > FFT(Forward)
7) Paint out the Stars in white with a soft brush
8) Filter > IP*Fourier > Apply Filter and FFTInverse

Does that sound OK?
My suggestion earlier about adjusting brightness and contrast to ‘see the stars easier’
This does not seem to spoil the final image. What do you think?


Flora.
You did ‘cheat’ a little. You added the extra step.
First I 'healed' out the stars in the Blue Channel (figure1), then in the Green Channel (figure 2) and finally I 'cleaned' the 'composite' RGB (figure 3).

'cleaned' the 'composite' RGB (figure 3). Is not in the manual
http://www.retouchpro.com/forums/sho...59&postcount=6
Perhaps you could explain this step then we can find out how to apply.

Ken
Reply With Quote
  #67  
Old 05-30-2005, 05:49 PM
Flora's Avatar
Moderator
Patron
 
Join Date: Mar 2002
Location: Milan, Italy
Posts: 2,274
Blog Entries: 3
Hi everybody ...

Quote:
Originally Posted by Cameraken
Wow! That’s heavy stuff.
You can say that again ... I read all the posts ... understood that I don't understand ... .... considered taking up knitting as a hobby ...
Quote:
Originally Posted by Cameraken
Flora.
You did ‘cheat’ a little. You added the extra step.
First I 'healed' out the stars in the Blue Channel (figure1), then in the Green Channel (figure 2) and finally I 'cleaned' the 'composite' RGB (figure 3).
'cleaned' the 'composite' RGB (figure 3). Is not in the manual
http://www.retouchpro.com/forums/sho...59&postcount=6
Perhaps you could explain this step then we can find out how to apply.
I was born a real rebel!!! I know the 'mathematicians' here would gladly burn me at the stake after this, but by 'cleaning' the composite RGB I meant just that .... after cloning/healing the stars from the two 'recomended' Channels, the composite RGB still looked a bit 'untidy' ... so .... I cleaned it before performing the IFFT...
Reply With Quote
  #68  
Old 05-31-2005, 12:53 AM
Member
 
Join Date: May 2005
Location: Germantown, MD
Posts: 59
Im going to assume that FFT stands for Fast Fourier Transform. IS this yet another helpful and FREE plugin?
Pete
Reply With Quote
  #69  
Old 05-31-2005, 12:08 PM
creeduk's Avatar
Senior Member
 
Join Date: Feb 2005
Posts: 297
Just wanted to say this indepth thread made me go back and look at FFT, I had come across this filter in the past but misunderstood it, I had done the classic FFT then IFFT and see no result (of course..doh!) now reading this and going through old threads I have got it working. I still find it easier to use HSL as it shows the issue up clearer I think, I had some good success carefully cloning the vertical and horizontal lines which got rid of small highlights in that area that caused problems in the images.

So thanks for thrashing this subject again, this time it stuck for me
Reply With Quote
  #70  
Old 06-01-2005, 04:46 AM
Flora's Avatar
Moderator
Patron
 
Join Date: Mar 2002
Location: Milan, Italy
Posts: 2,274
Blog Entries: 3
Hi Pete,
Quote:
Originally Posted by pjanak
Im going to assume that FFT stands for Fast Fourier Transform.
... Yep! You assumed right!!
Quote:
Originally Posted by pjanak
IS this yet another helpful and FREE plugin?
It can perform real miracles, but it can also be extremely frustrating .... It can come free ( here ) .. or for different fees ... you'll find the links scattered all over this Thread.

It's not much... but I hope this helps....
Reply With Quote
  #71  
Old 06-01-2005, 08:08 AM
jcr6's Avatar
Member
 
Join Date: Oct 2002
Location: Asheville, NC
Posts: 72
Wink Magic Bullet

Fourier image processing is one of those "Magic Bullets" that is almost entirely useless except for those rare (but highly impressive) occassions where they are de rigueur.
Reply With Quote
  #72  
Old 06-02-2005, 05:31 PM
Caitlin's Avatar
Senior Member
 
Join Date: Mar 2005
Location: Sydney, Australia
Posts: 494
Tutorial?

Despite the shortcomings of the filter mentioned, I wonder would Cameraken, Flora, or someone else here like to put all this together as a tutorial in the tutorial section? I know that the steps are listed out in several threads already, but having it all in one spot would be good - and I thought the images in Camerakens step by step were very clear and would help someone coming to the process new. In fact I think just taking those posts and putting them in the tut section would be great.

(As an aside I tried using Ro's step by step previously, but without screenshots it mean I became very frustrated when it didn't work. It was only a month later when I tried it on another image I realised it was because the photo I was working on did not have a suitable pattern therefore did not have any 'stars'.)
Reply With Quote
  #73  
Old 06-02-2005, 06:30 PM
deadants's Avatar
Senior Member
 
Join Date: Nov 2004
Location: Port Stephens, NSW, Australia
Posts: 184
And just to add to caitlen's suggestion, it would be great if their was a Macintosh tutorial as well. I did see that there are a couple of packages for the Mac, but I'm not sure if there are any tutorials on those.
Reply With Quote
  #74  
Old 06-02-2005, 08:27 PM
byRo's Avatar
Moderator
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,592
If nobody beats me to it, I'll put up a tutorial this weekend.
That is, if you can stand me going on and on and on about FFT just a bit more!!

Reply With Quote
  #75  
Old 06-02-2005, 08:51 PM
deadants's Avatar
Senior Member
 
Join Date: Nov 2004
Location: Port Stephens, NSW, Australia
Posts: 184
Thanks byRo,
I look forward to being able to get to grips with this technique. I may only see a couple of photos a year that fall into this category but when you have them sitting on your monitor staring at you, it's good to know there is a solution.

The following attachment was presented to me yesterday. I don't know if it's a good candidate for FFT or not but it would be worth a try.
Attached Images
File Type: jpg ltphoto3GS.jpg (65.5 KB, 41 views)
Reply With Quote
  #76  
Old 06-02-2005, 09:09 PM
Cameraken's Avatar
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,122
Thanks for your comments Caitlin.

I started this thread because I was having so much trouble, especially with the newer FFT RGB for which the tutorials are very scarce.

I wrote that tutorial to help everyone else struggling with this new version

I have learnt a lot from this thread and I thank everyone so much for their contributions so far.
As you mentioned FFT is not perfect for all images but as an initial starting point for removing texture IMO there is nothing to beat it.

I hope there is more input regarding FoveaPro as this looks good. But I think we will have to wait for byRo to do this.

I would be happy to re-write the tutorial and move it to the tutorial section. And if any mac users would like to volunteer their services we could perhaps do a version for deadants. But I don’t think there is a mac FFT Alex-Chirokov available.
However as Byro has offered to do this we may be better leaving it to the experts.

Off Topic
The original picture I posted was from a much larger picture. By coincidence I have just been asked to do another so I thought I would show you where it came from.

There may be a copyright issue with posting this so I’ve blurred it but it will give the general idea.

This picture is 24” x 8” and the original photo I posted was from part of one of these – Hardly surprising that texture became a problem.
I have restored a bit. few more hours to go.

I use ExclaimPT Tutorial to Stitch the scans which works great.


Ken
Attached Images
File Type: jpg small.jpg (83.7 KB, 37 views)
Reply With Quote
  #77  
Old 06-08-2005, 04:49 PM
Caitlin's Avatar
Senior Member
 
Join Date: Mar 2005
Location: Sydney, Australia
Posts: 494
FFT tutorial

For whoever is planning to do the FFT tutorial, I happened upon this one - Rather nicely done - a shame it's in Greek!

FFT tutorial (Or in this case babelfish English) The original is here: http://www.dpgr.gr/index.php?page=FourierPS
Reply With Quote
  #78  
Old 06-09-2005, 03:00 PM
Cameraken's Avatar
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,122
Well found Caitlin.

This is a tutorial on FFT RGB so it is the version we have been talking about here.
Babelfish did a pretty good job of translating this.

This is what I managed to understand from this site

1) Again another confirmation that the stars should be painted out in black
2) They are using a square picture as an example but do not seem to insist on square
3) They use blending mode set to colour to put the colour back.
4) They are using gaussian blur on the final image to clean up further.


Does anyone speak Greek


Ken
Reply With Quote
  #79  
Old 06-09-2005, 03:17 PM
Duv's Avatar
Duv Duv is offline
Senior Member
 
Join Date: Oct 2003
Location: Nanaimo, British Columbia
Posts: 1,213
Some speak Greek, others speak Geek. Unfortunately, I speak neither.

Dave
Reply With Quote
  #80  
Old 06-09-2005, 03:34 PM
Cameraken's Avatar
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,122
Duv


It would make more sense to me in Double Dutch

Ken
Reply With Quote
  #81  
Old 06-09-2005, 04:34 PM
byRo's Avatar
Moderator
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,592
Quote:
Originally Posted by Greek FFT
Fourier will be gnw'rjmi significance.
..took the words right out of my mouth!!

Quote:
Originally Posted by Cameraken
1) Again another confirmation that the stars should be painted out in black
Yes, but he's painting black in all the channels, not just the Red one;

Quote:
Originally Posted by Cameraken
2) They are using a square picture as an example but do not seem to insist on square
They're using the Chirakov filter so it can be any size and shape;

Quote:
Originally Posted by Cameraken
4) They are using gaussian blur on the final image to clean up further.
I think maybe he's blurring the original "coloured" layer and not the FFT luminosity layer - which is a good tip that we hadn't mentioned before.

Caitlin, I got the hint - now I going to write it in portuguese, OK?


Yeah Duv, I know........
Reply With Quote
  #82  
Old 06-10-2005, 04:45 AM
Junior Member
 
Join Date: Jan 2005
Posts: 3
Quote:
Originally Posted by Caitlin
For whoever is planning to do the FFT tutorial, I happened upon this one - Rather nicely done - a shame it's in Greek!

FFT tutorial (Or in this case babelfish English) The original is here: http://www.dpgr.gr/index.php?page=FourierPS
Well, being greek and thus able to read the original of that post, I can tell you 1 thing for certain.. The person writing the article is clear in that he does NOT want to create a tutorial, but rather he just wants to proove a point, that being that everything is just plain-old maths. The steps mentioned are as Cameraken said, but he also mentiones that one should always try to use a "circular pattern" symetric to the center star when deleting spikes.

"Again another confirmation that the stars should be painted out in black"
Well, actually he says that one should "mask-out, filter-out, delete or whatever" the white stars, claiming it's just a matter of terminology and does not actually make much of a difference... not very precise I'd say

If anyone is interested, I could write an exact translation of that article, but I seriously doubt that it would shed any light to the subject. the posts here are much more precise and helpfull than anything I have found on there (and FFT is the one reason I keep coming back to retouchpro over and over again)

Thnx...
Jocker
Reply With Quote
  #83  
Old 06-10-2005, 05:56 AM
Flora's Avatar
Moderator
Patron
 
Join Date: Mar 2002
Location: Milan, Italy
Posts: 2,274
Blog Entries: 3
Hi Jocker,

Welcome to RP!

We do hope you'll keep coming back ... and, boy, are we glad you shed some light on this ....

As you can see Rô had nearly finished translating the tutorial...even though, I think he was struggling a bit to stay as close as possible to the original text here...
Quote:
Originally Posted by Greek FFT
Fourier will be gnw'rjmi significance.
Quote:
..took the words right out of my mouth!!


Thank you very much for your help!
Reply With Quote
  #84  
Old 06-10-2005, 06:23 AM
byRo's Avatar
Moderator
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,592
jocker, welcome to RetouchPRO!!

Thank you very much for the help.
Promise I'll post the tutorial this weekend, promise

Reply With Quote
  #85  
Old 06-10-2005, 09:00 AM
Cameraken's Avatar
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,122
Welcome Jocker and thanks for your input.
‘Everything is just plain-old maths’
When you scan a picture it just becomes a set of numbers, which can be changed or manipulated. The Alex Chirakov FFT RGB is just a calculation on these numbers.
The whole thing could be done in Excel or Visual Basic in fact I have a visual basic program for removing noise from sound, which uses the same calculation.

The point about symmetry is a good one and makes sense with the maths.

I don’t think it is necessary to translate the whole thing but can you help with the gaussian blur bit. It sounds a bit like Floras 'cleaned the composite' step. But as byRo says it sounds like they are talking about the colour layer.

Ken
Reply With Quote
  #86  
Old 06-11-2005, 07:15 AM
Junior Member
 
Join Date: Jan 2005
Posts: 3
Quote:
Originally Posted by Cameraken
Welcome Jocker and thanks for your input.

I don’t think it is necessary to translate the whole thing but can you help with the gaussian blur bit. It sounds a bit like Floras 'cleaned the composite' step. But as byRo says it sounds like they are talking about the colour layer.

Ken
ok, let's try a word-by-word translation of the whole thing, so that noone thinks that he's actually missing some intresting point from that article because it's in greek...

----------------------------
Translating http://www.dpgr.gr/index.php?page=FourierPS
----------------------------

Let's see how a fourier transformation of our ewample looks.
Since the information is pictured through the frequency spectrum, and the noise is periodical, like magic, all the noise is shown on specific places, much easier to process. (we use the filter Fourier Transform->FFT):
[picture of fourier spectrum here]
Doesnt it look odd that from this picture we can go back to the original? Notice how symmetric to the main star the bright points are. These are our noise. So what do we do? We delete, mask-out, filter-out, it's just a matter of terminology
Using paintbrush we blank-out the aforementioned points, as in the picture bellow. The process was delibaretly done roughly so as to show that even this way, the method gives very good results.

[picture of EDITED fourier spectrum here]

Time to go back to the space domain from the frequency domain... (that's what a mathematician would say), we just apply the inverse filter and go back to the original picture: (Fourier Transform->IFFT)

[grayscale transformed picture here]

Look at how clean the picture looks. The fact that it's grayscale (that's how the filter FFT works, at first it transform it into grayscale and then applies the transformation), wont make it more difficult to us, it's enough that the luminocity is cleared.

We take a copy of the original picture, put it over the final one as a new layer with blending mode set to colour and we apply as much gaussion blur needed to get rid of the noise (No detail is lost, as that is in the underlying layer).
Here is the result:

[final picture here]

and a crop of before and after, blown up by 200%:

[blown up crops here]

Frequency domain transformation requires skills and experience. Good thing that there are various filters and utils that hide these dificulties

The reason for this article was not to suggest that one should do this by hand, but to shed some light into how applying such methods can give very good results.

--------------- End translation -----------------

See ya...
Jocker

Last edited by jocker; 06-12-2005 at 05:36 AM.
Reply With Quote
  #87  
Old 06-11-2005, 01:23 PM
Cameraken's Avatar
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,122
Thanks Jocker for taking the time to do that.

Byro was right (as usual) :- ‘gaussion blur the colour Layer as much as needed to get rid of the noise No detail is lost, as that is in the underlying layer.’

That’s worth noting in case the info has come too late for byRo tutorial.

Thanks again Jocker.

Ken
Reply With Quote
  #88  
Old 06-12-2005, 02:21 AM
Flora's Avatar
Moderator
Patron
 
Join Date: Mar 2002
Location: Milan, Italy
Posts: 2,274
Blog Entries: 3
jocker,

This is just great!!! Thank you again for your time and help!!!!!

Ken,

... about blurring the 'color' Layer ....
it is right you don't lose details ... but, if to fade the noise you use the Gaussian Blur, careful because the colours tend to 'bleed' into each other so you can get 'noise-free' pink teeth or, if you are working on a portrait, the skin around the edges tends to get the background tinge ...etc. So, in this case, I would rather use the Median Filter as noise remover, as the Median Filter tends to 'recognize and respect' the edges between colours ....
Reply With Quote
  #89  
Old 06-12-2005, 05:43 AM
Junior Member
 
Join Date: Jan 2005
Posts: 3
Quote:
Originally Posted by Flora
This is just great!!! Thank you again for your time and help!!!!!
You're welcome.. I've been quietly reading the forum since January, originally trying to find a decent way to remove the honeycomb effect as a favor to my girlfriend. I'm not really into photography, thus have not contributed anything all this time... Glad to be of service since you have all helped us quite a bit.

Jocker
Reply With Quote
  #90  
Old 06-12-2005, 02:03 PM
byRo's Avatar
Moderator
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,592
Quote:
Originally Posted by Flora
[...So, in this case, I would rather use the Median Filter as noise remover, as the Median Filter tends to 'recognize and respect' the edges between colours ....
Nice one, Flora
I'd forgotten that.

I've written the FFT tutorial but the "uploader" isn't cooperating with me this weekend, so I haven't been able to post it yet.

Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 12:33 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 2008 Doug Nelson. All Rights Reserved