Forum

Author Topic: Method For Masking Out Sharp Pixels?  (Read 3524 times)

DTFrontMan

  • Newbie
  • *
  • Posts: 8
    • View Profile
Method For Masking Out Sharp Pixels?
« on: November 13, 2016, 07:55:23 PM »
I'm wondering if anyone knows of a way to create a mask based on the sharpness of pixels in photos used for generation, either within Photoscan or through 3rd party applications.  With my scans even at the highest aperture (f22+) I'm having some trouble with depth of field.  Not so much with the 3D model generation but with the texture creation.  Regardless of there being sharp "in focus" information for every part of the model Photoscan tends to also use the blurry "out of focus" parts when putting the textures together.  If there was some way I could tell Photoscan not to use those portions it would be awesome (as far as I know masks can't be used for textures so I'm guess it would be done with image processing).

I came across this thread with the same issues and they suggested a tool used to detect image sharpness, but I'm hoping for a Photoshop method etc that will detect a feature as sharp and map it as white while blurry portions get set to black or transparent.

http://www.agisoft.com/forum/index.php?topic=6082.0
« Last Edit: November 13, 2016, 08:05:43 PM by DTFrontMan »

Arie

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Method For Masking Out Sharp Pixels?
« Reply #1 on: November 14, 2016, 09:59:39 AM »
Hi DTFrontMan,
when dealing with depth-of-field issues I often use Photoshops CCs feature "Select Focus Area". It automatically selects unsharp portions of the image, which can be used as a mask for texturing in Photoscan.
Most of the time, this works quite great!
Cheers.
Arie.

DTFrontMan

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Method For Masking Out Sharp Pixels?
« Reply #2 on: November 15, 2016, 01:51:23 AM »
Thank you for the reply!  That sounds exactly like what I need.  Though I'm disappointed to hear that it's only in CC (I currently work with the boxed version of CS6)...  If you or anyone else knows of other ways to "Select Focus Area" that would be great.   Otherwise I'll have to think about finally making the change to Creative Cloud lol

Chris_321

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Method For Masking Out Sharp Pixels?
« Reply #3 on: November 15, 2016, 09:51:03 PM »
If you have very little noise, you maybe could try to use a slightly blurred copy with difference blending mode.
(The idea being that a slight blur would change an already blurry area less.)

DTFrontMan

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Method For Masking Out Sharp Pixels?
« Reply #4 on: November 16, 2016, 02:28:48 AM »
That was a brilliant idea!  Noise does seem to be a hurdle but the process works well.  This is what I'm doing...

1. Open original image
2. Duplicate layer
3. Apply 0.3 pixel gaussian blur to duplicated layer
4. Set blurred layer to "Difference" blending
5. Copy result to new layer
6. Levels filter on results to increase contrast
7. 4 pixel blur on results to expand area of difference (it comes out speckled this helps make it solid)
8. "Threshold" on results to remove any gradation in mask

I've yet to put them through Photoscan but it's giving me the info I need to work with.  Thanks!

Chris_321

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Method For Masking Out Sharp Pixels?
« Reply #5 on: November 16, 2016, 07:54:38 PM »
Glad it worked!  :)