Author Topic: Selecting a part of the image to process  (Read 12798 times)

Offline Stathis

  • Newcomer
  • Posts: 6
Selecting a part of the image to process
« on: 2010 August 11 16:36:09 »
Hello! I have been using PI since 1.5 version and i like it very much, i do almost everything with it. Today while trying to correct some star elongation on a part of the image (due to a tilt on the focuser) i saw that i couldn't do that because i cannot find a way to process just a part. When i apply deconvolution to fix the star elongation, on the one side it's fixed, but on the other side the round stars are being elongated. What i thought was to crop that part of the image in PS, load it to Pix, fix it and then put it back toghether again in PS. But until i get a new focuser i will have to do that for every image. I was wondering if anyone has any advice.

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Selecting a part of the image to process
« Reply #1 on: 2010 August 11 16:40:31 »
You could create a simple file in PS that is white in the area where you want deconv to be active. Then load that file in PI and use as a mask.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Stathis

  • Newcomer
  • Posts: 6
Re: Selecting a part of the image to process
« Reply #2 on: 2010 August 11 16:46:02 »
Thanx Nocturnal! so essentially if i want to process half the image, then i will create 1 half black and the other half will be white where the changes will be applied. Did i get it right?

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Selecting a part of the image to process
« Reply #3 on: 2010 August 11 16:56:28 »
Yes. Be carefull with the transitions on the mask, or you may create some ugly artifacts.

A much better solution would be a non-isotropic deconvolution, but such tool has not been designed yet :P
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline cfranks

  • PixInsight Addict
  • ***
  • Posts: 138
Re: Selecting a part of the image to process
« Reply #4 on: 2010 August 11 17:06:52 »
Or an 'De-Mosaic' function to turn a single image into 2, 3, 4 etc. images and then reassemble with the standard Mosaic function.  8)

Charles

Offline Stathis

  • Newcomer
  • Posts: 6
Re: Selecting a part of the image to process
« Reply #5 on: 2010 August 11 17:18:07 »
Ok, encountered a problem. Can i have 2 masks at the same time in PI? Because when i apply the mask that i made in PS there is no star mask, so the the part that i deconvolve get's all messed up. Then if i apply a star mask only, i am back at square one, it does it to the whole image. So, how can i create a mask that has the black and white image from PS and a star mask? I've tried putting the star mask as a mask to the B&W image, and then applied that to the image, but didnt work. Ít was worth the try though ;D

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Selecting a part of the image to process
« Reply #6 on: 2010 August 11 17:22:10 »
No, you can't. You may merge both masks with PixelMath, and create a new one. One option is to use the Max(Image01,Image02) or Min(idem) function. Also, you may use the "Screen" function: ~(~Image01*~Image02) or a direct multiplication. The choice will depend on how you want to merge them.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Stathis

  • Newcomer
  • Posts: 6
Re: Selecting a part of the image to process
« Reply #7 on: 2010 August 11 17:25:45 »
Well i did it in another way. I saved the star mask from PI to desktop, opened it in PS, cut the part that i wanted and pasted it to the B&W image at the white area. Then used this as a single mask in PI and it worked. :) I didn't think it would cause the star mask backround is almost black, and i thought it would allow deconv. to that area also, but it didn't. I have to learn pixel math in PI since i don't know anything about it, but this forum has lot's of info. Thx guys.

Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 274
  • Resistance is futile.
    • Astronomí­a Sur
Re: Selecting a part of the image to process
« Reply #8 on: 2010 August 11 17:40:23 »
Ok, encountered a problem. Can i have 2 masks at the same time in PI?

I think it's possible to make a mask inside a mask image, maybe that helps. Please correct me if I'm wrong.

Enzo.

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Selecting a part of the image to process
« Reply #9 on: 2010 August 11 17:49:40 »
Yes, a mask that acts as a mask may have a mask, but that "second" mask will not work over the first image.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 274
  • Resistance is futile.
    • Astronomí­a Sur
Re: Selecting a part of the image to process
« Reply #10 on: 2010 August 11 18:06:45 »
Yes, a mask that acts as a mask may have a mask, but that "second" mask will not work over the first image.

A important point. Thanks Carlos!.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Selecting a part of the image to process
« Reply #11 on: 2010 August 15 17:02:04 »
Hi Charles,

Unless you really need an interactive drawing tool --which we still don't have in PixInsight--, you really don't need to jump to other application to build a selective mask. If you know the coordinates and dimensions of the region that you want to mask (or unmask), then nothing can beat PixelMath. Here are several examples:

A binary rectangular mask:



A binary circular mask:



A circular mask with a linear radial gradient profile:



A circular mask using a nonlinear radial profile (hyperbolic arc sine in this case):



These are just four simple examples. You can generate really sophisticated masks with PixelMath. If you need to smooth the edges of a binary mask, you can do that very easily with the ATrousWaveletTransform tool: just remove the first one or two wavelet layers.

Hope this helps!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline jmtanous

  • PixInsight Addict
  • ***
  • Posts: 155
Re: Selecting a part of the image to process
« Reply #12 on: 2010 August 15 20:15:17 »
Hi,

When I need to do similar stuff (create a mask for a part of the image) I do the following:

1) Create a preview with the target section.
2) Create a view (pull the preview out of the image)
3) Use star alignment tool. Align the preview to the original image. It will produce an image of the same size of the original image, with everything black but the preview part.
4) Use the star mask, or wavelets or whatever tool I want to create a mask based on the new image.

This is super fast, and very accurate...

Cheers,

Jose 

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Selecting a part of the image to process
« Reply #13 on: 2010 August 17 08:34:08 »

Juan: you're a show-off :) Great examples though.
Jose: great idea!
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Silvercup

  • PixInsight Addict
  • ***
  • Posts: 187
Re: Selecting a part of the image to process
« Reply #14 on: 2010 August 17 13:01:26 »
Hi:

You can do it with substitutewithpreview Script. Create a new black image with the same dimensions then use the script and you'll get a copy of the image with only the preview.



Best. Silvercup