Shifting a set of images by a given shift (dX,dY) depending on image
-
- Posts: 4
- Joined: 11 Feb 2024, 19:30
Shifting a set of images by a given shift (dX,dY) depending on image
Hi,
I am at the very beginning of my leaning curve about scripts. So, I have a number of questions ...
I would like to shift a set of images (image-1.fit, image-2.fit, image-3.fit, ..., image-i.fit) by a given shift (X, Y)(i), the value of each shift (X,Y) dependant on the image number i.
I know how to read and write images using : Image.Open() and Image.Save()
I have seen it is possible to shift an image by calling Image.Macro(n) with Macro (n) calling the Shift function.
But I don't know how to use different (X,Y) values for the different images. In other words, is it possible to call a "Image.Shift" function with a given (X,Y) parameter depending on the image number i ?
Thanks for your help !
Christian
I am at the very beginning of my leaning curve about scripts. So, I have a number of questions ...
I would like to shift a set of images (image-1.fit, image-2.fit, image-3.fit, ..., image-i.fit) by a given shift (X, Y)(i), the value of each shift (X,Y) dependant on the image number i.
I know how to read and write images using : Image.Open() and Image.Save()
I have seen it is possible to shift an image by calling Image.Macro(n) with Macro (n) calling the Shift function.
But I don't know how to use different (X,Y) values for the different images. In other words, is it possible to call a "Image.Shift" function with a given (X,Y) parameter depending on the image number i ?
Thanks for your help !
Christian
Re: Shifting a set of images by a given shift (dX,dY) depending on image
Are you trying to make a mosaic?christian viladrich wrote: ↑11 Feb 2024, 19:43Hi,
I am at the very beginning of my leaning curve about scripts. So, I have a number of questions ...
I would like to shift a set of images (image-1.fit, image-2.fit, image-3.fit, ..., image-i.fit) by a given shift (X, Y)(i), the value of each shift (X,Y) dependant on the image number i.
I know how to read and write images using : Image.Open() and Image.Save()
I have seen it is possible to shift an image by calling Image.Macro(n) with Macro (n) calling the Shift function.
But I don't know how to use different (X,Y) values for the different images. In other words, is it possible to call a "Image.Shift" function with a given (X,Y) parameter depending on the image number i ?
Thanks for your help !
Christian
Re: Shifting a set of images by a given shift (dX,dY) depending on image
Would be interesting to know what you are trying to achieve.
-
- Posts: 4
- Joined: 11 Feb 2024, 19:30
Re: Shifting a set of images by a given shift (dX,dY) depending on image
Indeed, I fogot about the context. So, here are some information. It is about processing solar eclipse images.
Basically, processing total solar eclipse images involves three steps :
(1) - registration of images with respect to the solar corona (and not lunar disk, because of the relative motion Sun/Moon),
(2)- "optimal" stack,
(3)- "visualisation" of the HDR stack.
These operations can be more of less elaborated (see for example PhD thesis of Hanna Druckmuller).
I am currently trying to have step (1) semi-automatic. The approach is the following :
- a : registration of images with respect to the lunar disk = Sobel filter in AA (= detection of contour) + Hough transform (for finding position X, Y of lunar disk) : this part is already largely automatic,
- b : calculation of the relative shift X(i),Y(i) to be applied to each image i accordingly to ephemerids (to compensate Moon/Sun relative motion)
=> this means reading the header of each file(i) to get acquisition time and run the appropriated calculation : this is done in EXCEL (for now),
- c : shift each file (i) by the proper amount X(i), Y(i) : this is the part I want to make automatic, using scripts in AA
=> inputs : list of files and list of X(i), Y(i) shifts to be applied to each file (i).
As I am at the very begining of the leaning curve about AA scripts, I surely make good use of some helps
Thanks guys !
Basically, processing total solar eclipse images involves three steps :
(1) - registration of images with respect to the solar corona (and not lunar disk, because of the relative motion Sun/Moon),
(2)- "optimal" stack,
(3)- "visualisation" of the HDR stack.
These operations can be more of less elaborated (see for example PhD thesis of Hanna Druckmuller).
I am currently trying to have step (1) semi-automatic. The approach is the following :
- a : registration of images with respect to the lunar disk = Sobel filter in AA (= detection of contour) + Hough transform (for finding position X, Y of lunar disk) : this part is already largely automatic,
- b : calculation of the relative shift X(i),Y(i) to be applied to each image i accordingly to ephemerids (to compensate Moon/Sun relative motion)
=> this means reading the header of each file(i) to get acquisition time and run the appropriated calculation : this is done in EXCEL (for now),
- c : shift each file (i) by the proper amount X(i), Y(i) : this is the part I want to make automatic, using scripts in AA
=> inputs : list of files and list of X(i), Y(i) shifts to be applied to each file (i).
As I am at the very begining of the leaning curve about AA scripts, I surely make good use of some helps
Thanks guys !
Last edited by christian viladrich on 14 Feb 2024, 20:05, edited 1 time in total.
Re: Shifting a set of images by a given shift (dX,dY) depending on image
Hello, the script command is Image.Shift(dx,dy) . On a group of images there could be three solutions:
1) A script which opens, process and saves images, maybe using FindFiles(...)
2) A script from a template: menu Templates / Selected images, (menu from the script window).
3) A script to be applied with the Apply Script Window, see the attached screenshot:
1) A script which opens, process and saves images, maybe using FindFiles(...)
2) A script from a template: menu Templates / Selected images, (menu from the script window).
3) A script to be applied with the Apply Script Window, see the attached screenshot:
-
- Posts: 4
- Joined: 11 Feb 2024, 19:30
Re: Shifting a set of images by a given shift (dX,dY) depending on image
Great ! Thanks for the directions Fabio.
Christian
Christian