Batch Dynamic crop

flyeye

Active member
Mar 3, 2019
25
0
Hi everybody!

I need to crop a bunch of images (hundreds) after calibration and before registration. There is a defect caused by the DSLR caused by mirror (my guess). By some reason calibration with flats do not eliminate this defect. Probably, because flatbox is too close... So I would like to crop all images before aligning.

Is there any way to make it in batch mode?

Thank you!
 

pfile

PTeam Member
Nov 23, 2009
6,170
180
although you can probably do this with ImageContainer + Crop (plain old crop, not dynamicCrop), why do you need to do this? just crop the integrated result...

rob
 

fredvanner

Well-known member
Apr 17, 2019
828
90
70
Wells, Somerset, UK
Provided the crop is identical for all images, you should be able to create an ImageContainer, put all the images in it, define the required output folder and filename structure, set up the Crop process with the required parameters, and drag the ImageContainer instance onto the lower bar of the Crop process.
 

flyeye

Active member
Mar 3, 2019
25
0
It`s because after alignment subs form different nights (tens) defect covers sufficiently bigger part of image.
Including main object, so it`s really hard to remove it later with rejection, stamp clones and etc.

Thank you a lot! I has never tried containers before, so its time now!
 

pfile

PTeam Member
Nov 23, 2009
6,170
180
i wonder if then it might make sense to try to replace the offending artifact with the median value of each frame. because the crop you want to do intersects the subject of the image, there are going to be areas of different SNR directly on the main object. while filling in with the median won't increase the SNR, it might make the integration look a little better. you sometimes get a "stairstepping" look when integrating registered frames of differing pointing.

to do this you can use pixelmath that looks something like this:

iif(y()>1000,med($T),$T)

that will replace all pixels with a Y coordinate greater than 1000 with the median of the image. so if your images are 5000 pixels tall and you want to overwrite the bottom 99 pixels, you'd use 4900 instead of 1000 in the expression above.

or alternately

iif(y()<4900,$T,med($T))

anyway i'd only go thru the trouble of doing this if the cropped results are not satisfactory,

rob
 

flyeye

Active member
Mar 3, 2019
25
0
Wow! Interesting idea! Ok, I`ll try this approach after attempt with cropping.

I have already tried:
1. very strong rejection criteria - does not work;
2. Large-scale pixel rejection - out of memory;
3. Adaptation normalization - does not work because of zero pixels on corners after alignment and smaller frames taken with shorter focus length (but your idea with PixelMarth + Crop probably can help me!);
4. Local Normalization does not reject defects completely, but add some artifacts. To be honest here I have some dark spots yet and have to read manual and forum more carefully. I do not understand settings completely. Be back to this option after cropping and Adaptive normalization.

Thank you very much!
 

pfile

PTeam Member
Nov 23, 2009
6,170
180
for the LN case in #4 did you try adjusting the scale factor up or down? that can help with the artifacts. but for LN to work you need a clean frame which has no artifacts to start with, which seems like it might be hard to come up with for at least some of the subexposures.
 

flyeye

Active member
Mar 3, 2019
25
0
for the LN case in #4 did you try adjusting the scale factor up or down? that can help with the artifacts. but for LN to work you need a clean frame which has no artifacts to start with, which seems like it might be hard to come up with for at least some of the subexposures.
As a reference for LN I use the best frame form a series taken with shortest focal distance, so all artifacts are out of the object. The same frame I use as reference for registration and integration.
By the way, what if I use as reference a processed stack of some best frames taken with shortest focal length with artifact eliminated as much as possible, probably with PixelMath as you suggested?

Yes, I tried to increase LN scale up to 256, almost nothing has been changed.

And I cropped all what wanted with Containers! Thank you for the advice! Very useful tool!
Unfortunately, I have started integration and found out that I lost some WBPP weight... To many files and folders on different drives.. I have to go half way back and re-process 1/3 of subframes...