Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

sgl_imaging_challenge_banner_dslr_mirrorlesss_winners.thumb.jpg.9deb4a8db27e7485a7bb99d98667c94e.jpg

Recommended Posts

Now it's summer and no dark nights for us here in the north, what to do?

Many many years ago I wrote my own functions in Matlab to do astrophoto processing. Now I want to do that again, but Matlab is very expensive so I need some other tool. I have found ImageJ and the more specialized version AstroImageJ (AIJ) let me do this. You can do your own plugins with Java programming or use the built in functions with macros, the later is what I do now in the beginning.

AIJ is a multiplatform image tool and handle 32 bit floating point. There are a lot of plugins to download. And it's free !

I have a Canon DSLR camera and AIJ does not open its raw CR2 files direct, but there is a wraparound plugin to DCRAW. Works fine but only opens files one by one. I'm now buliding macros to batchload these raw files and do other things. I have started a tutorial about this AstroImageJ software and later I will place my macros there to download. If you want to try them, have a backup of all your files if anything goes wrong, I'm in the begiining of this.

 

Here is my AstroImageJ tutorial:

http://astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-01-introduction.html

There are links how to download, install and  other things. It will come more later.

Lars

  • Like 3

Share this post


Link to post
Share on other sites

Now I have the first two macros to AstroImageJ, AIJ ready to test.

First macro convert your Canon CR2 raw subflat files to demosaiced calibrated rggb master flats.

Second macro convert your Canon CR2 subobject files to calibrated and demosaiced rggb files.

There is no need for any bais and dark, it take information from Canon's overscan region. It give perfect temperature match because the dark/bias and object comes from the same image. I have tested on Canon EOS 350D, 5D and 6D.

It doesn't dark/bias calibrate pixel by pixel, it subtract an average value, that's mean that you have to take your object files by dithering method to get rid of static pattern.

Here you find my macros and a short tutorial, download on page 3.
http://astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-01-introduction.html

This is my first macros for AstroImageJ so expect them to have bugs. Have backup of you files! You use it on your own risk!

The files you get as a result you handle like files from a monocrome camera with rgb filters. There are two green images, green1 and green2, you must align them not just add.

Later when I get a free time I will explain how to align and stack them in AIJ, this function are already built in AstroImageJ, as an alternative you can use your favorite astro edit program to align and stack.

Hope you find it interesting.

/Lars

Edited by Astrofriend

Share this post


Link to post
Share on other sites

Hi Michael,

Yes give it a try, I'm very exited about this software. Now I can process astrodata with my own functions as I did in Matlab 20 years ago. AstroImageJ is almost exactly as ImageJ, just some small changes and a lot of astro editing plugins are included in the installationpack. Did you use ImageJ to do astroediting or did you process other kind of images?

 

/Lars

Share this post


Link to post
Share on other sites

I have now added a new part to the AstroImageJ tutorial.

This is one method how to align the images, there are others methods too, maybe better:
http://astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-06-align-rggb-files.html

One big advantage of how it aligns is that it align the demosaiced images, each separate color relative the others. Optics with chromatic problems will look better.

/Lars

Edited by Astrofriend

Share this post


Link to post
Share on other sites

Ive been using AIJ for a while to WCS solve and annotate images via SIMBAD, its only downfall is that you have to save the image off in chunks (if its large) and stitch them back together in order to keep the object labels uncluttered. This image had to be saved off in 24 chunks before stitching back together with ICE:

26527830040_37fac692bf_h.jpg

If you could write a function that would avoid me having to save off in so many bits, that would be incredibly useful for a lot of people as it would provide a free alternative to much more expensive options like PI.

Share this post


Link to post
Share on other sites

Hi Uranium,

How many Mpixel are your files and how many bits per pixel? Do you run on a Windows 64 operation system? Or did you mean that's it's only that the labels get to big on big images?

 

My files are 20Mpix (Canon EOS 6D) and I can have more than thirty open at the same time without having them as a virtual stack. My system is Windows 10, 64 and I have 8GByte of RAM. I havn't tested the annote function yet, much to learn to understand all possibilities of AIJ.

/Lars

Share this post


Link to post
Share on other sites
3 hours ago, Astrofriend said:

Hi Uranium,

How many Mpixel are your files and how many bits per pixel? Do you run on a Windows 64 operation system? Or did you mean that's it's only that the labels get to big on big images?

 

My files are 20Mpix (Canon EOS 6D) and I can have more than thirty open at the same time without having them as a virtual stack. My system is Windows 10, 64 and I have 8GByte of RAM. I havn't tested the annote function yet, much to learn to understand all possibilities of AIJ.

/Lars

Thanks for taking a look at this. The above image is just under 9MP (8300 camera, which is 16bit), but ive used it on images that are ~60MP+ (3x3 mosaic), and Im using the 64bit version of AIJ.

When you zoom out to view the whole image, the labels remain the same size (and so look too big). Whats needed is a way to save it all off as a TIFF (or id be happy with a jpg), while keeping the object labels the same size as they would look when the image is viewed at pixel scale (100%). ie: the lable font size needs to scale in relation to the image zoom setting, so if you zoom out to something like 20% - the text follows suit and becomes quite small. Or alternitavely, when using the option to save the current view - instead of saving just what is displayed, it also saves was isnt currently being rendered (the rest of the image, plus its overlay).

I'll take a look at the overlay options next time im at the PC.

Share this post


Link to post
Share on other sites

Now I have finished the last important step in my tutorial: How to stack the sub images.

It's a little bit different compare how it's done normally.

Here is my homepage with my tutorial:

http://astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-07-stack-object-files.html

Now the fun starts, if you have a Canon EOS camera it should work. You don't have to take darks or bias images if your camera is of late low noise type. Or I will say in my case, maybe there are some situations where it's not working. I have also done some tests on my old Canon EOS 5D files, it looks like it works pretty well with these noisy images too, but could had been even better if I had taken those old images with dithering technique.

 

/Lars

 

  • Like 1

Share this post


Link to post
Share on other sites

Now I have started next step on the develop of a new macro/function to AstroImageJ (AIJ).

This will be a Drizzle align tool. I'm not shure if this will work but I will do an attempt to do it. I have started to collect the mathematical tools that's needed to do this and you can follow it on my homepage if you find it interesting:

http://astrofriend.eu/astronomy/tutorials/tutorial-astroimagej-align-drizzle/tutorial-aij-align-introduction-matrix.html

With a Drizzle tool you can get back the resolution you have lost by undersampled images, i.e. high resolution telescope and big size pixels. Google on NASA and Drizzle and you will se how they develop this method for Hubble Space telescope.

This is much about matrices and one problem is that AIJ doesn't handle matrices as Matlab do. I have to find a solution to this, nestled loops and other things.

/Lars

Edited by Astrofriend

Share this post


Link to post
Share on other sites

Today it was a bad weather and I spent the day to collect more information how to do develop the Drizzle function and also wrote some examples how different number of reference points (stars) in the align procedur affect the stacked image.

If you find it interesting to read more, visit my homepage:
http://astrofriend.eu/astronomy/tutorials/tutorial-astroimagej-align-drizzle/tutorial-aij-align-introduction-matrix.html

/Lars

Share this post


Link to post
Share on other sites
Hi,
I have done a small but significant update in my macro to the AstroImageJ editing software.

Earlier when creating files after the demosaicing process they very ordered in color order. That caused problem later when try to align comet images or images that moves because of bad polar align. Now the filenames creates so that they will sort by the time when they were taken. Hence just small movements between each image to be align. You can still have the old filename order, just set a parameter in the macro file.

This is important in this case because I'm not only align rgb images, I do demosaic rgb images and then them align r, g and b images against each other. This reduce the color aberation from lens optics and atmospheric aberration.

You find the new macro here to download and instrcuction how to used it:

Share this post


Link to post
Share on other sites

I did a new complement in the AIJ macro "Calibrated_object files from CR2 files", a flag that let the flat calibration to be on or off.

But the big new is that there is a new macro.
The: "Open_DSLR raw files and convert to cfa Tiff 16 bit" (Beta)

http://astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-03-my-own-macros.html
All my three macros are included.

With that I hope you can open your files in AstroImageJ whatever DSRL camera you have. If DCRaw can handle the cameras raw file it should work. It opens in batch mode, you don't have to open the files one by one.

It opens raw files, and convert to cfa Tiff 16-bit and store under map CFA.

I have tested Nikon D3 nef files and Sony A7RII arw files. It looks to work.

Note:
You must edit the parameter to the filetype in the macro to your specific camera.

Let me know if you if you try this with a non Canon camera.

/Lars

Share this post


Link to post
Share on other sites

These days I have done a Quantum Leap in my progress to have a tool that can give back lost resolution from under sampled images.

 

I tested a plugin that is developed to ImageJ and ImageJ is dedicated to the microscopic world. I didn't think this should work. But cells are a bit galaxy shaped, why not?

 

Plugins to ImageJ should also work in AstroImageJ.

 

I wrote to the developer of Parallel Super-Resolution plugin Piotr.

 

If you find it interesting you can read here what he answered and what I got from my simple test on undersampled M13 images.
http://astrofriend.eu/astronomy/tutorials/tutorial-astroimagej-align-drizzle/tutorial-aij-align-parallel-super-resolution.html

 

Impressed? YES!

 

/Lars

Share this post


Link to post
Share on other sites

Hi,
It was long time ago since I updated my macros I use to pre process my Canon .CR2 raw format files. I have started to rewrite it and make it more user friendly, from very uggly to only uggly user inter face 🙂 . I also added more functions to make it more practical to use. It will also be possible to batch read Nikon and Sony raw files, with a little extra line of code whatever camera you have as long DCRaw can read them. I have only seen this over scan region on Canon raw files, if not in the raw file you can disable the reading of the over scan region. I will post the new macro on my homepage soon.

But until then I have made a small test tool, "Frame Selection test". With that tool you can test your camera's raw file if it has an over scan region which I use in my Canon raw files to do a bias and dark calibration without any dark and bias files.

The over scan region width on my three different Canon cameras are:

Canon 350D, column width = 42 pixels
Canon 5D (Mk I), column width = 90 pixels
Canon 6D, column width = 72 pixels

It's placed on the left side. There is also an over scan region on top of the image, but I don't use that.

To make my macro work with all my Canon camera raw files I have set the reading of the over scan region from column 5 to column 32. And the rows with a margin at top and bottom of 10 pixels.

I will come back with an update of my tutorial as soon the new version of my macro is functioning.

Here at the middle of the page you can download my "Frame Selection test" tool:

http://www.astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-03-my-own-macros.html

There are comments in the file how to use it.

Note:
You use it on your own risk, back up your files before using it !

/Lars

Edited by Astrofriend

Share this post


Link to post
Share on other sites

One more macro in a new version. See it as a lite version of the "big" version I am working on.

It has the name "Open DSLR raw files and convert to Tiff 16 bit", you find it here in the middle of the page:

http://www.astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-03-my-own-macros.html

What I have done is to add a menu from where you choose which raw format you want to convert to Tiff format. You can also add the option to read the overscan areas of the sensor if it has it. Maybe only Canon.

I think this can open all DSLR cameras raw files, at least as long DCRaw can read them. I have included the most common, Canon .cr2, Canon .cr3, Nikon .nef, Sony .arw.

It's easy to add more raw files extension.

Open the macro in Notepad and add some extra rows with your raw files extensions. Don't forget to change newArray(X) to correspond to how many rows you have.

fileformatDef = newArray(4);
    fileformatDef[0] = ".cr2"; // Canon RAW
    fileformatDef[1] = ".cr3"; // Canon RAW
    fileformatDef[2] = ".nef"; // Nikon RAW
    fileformatDef[3] = ".arw"; // Sony  RAW

If you use it a lot I can add some extra raw formats and they will be there in future updates. let me know but I can't test the files, you have to do it and let me know if it works.

You download and use the macro at your own risk ! Backup your files before !

/Lars

Share this post


Link to post
Share on other sites

At last I can upload my new macro. It took me tottaly a month to rewrite all codes behind and do a lot of test. Now it work much better and it's faster. But the main thing, there are menus to set up the parameters from. It is a dream to use now compare how it was earlier. It's also more motivated to add more functions now when there is a better over view and easier handling.

I have added stacking processes for 'normal' cameras without over scan areas. Use it to convert your raw files to TIFF which AstroImageJ can read. There is already a function to precalibrate images in AIJ, you find it at the button 'DP'. I have not used it very much because I want to use the possibilities my cameras over scan area gives me.

It's a very early Beta version, but I have tested most of the functions and now after two weeks of work it looks to work correct.

I have also updated my tutorial, the pages 3 to 5 are totally rewritten:
http://www.astrofriend.eu/astronomy/tutorials/tutorial-astroimagej/tutorial-aij-01-introduction.html

After I have used it and tested more I will develop some new functions.

If you test it, especially with some other camera than Canon, let me know how it works for you.

Don't forget to update the DCRaw if you have a later camera. This is separated from AIJ and works separate, but it's stored in the AIJ directory.

At least it was some good with the bad wheater, I got time to fix this !

/Lars

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.