Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for color images #57

Closed
martinberoiz opened this issue Oct 22, 2020 · 3 comments
Closed

Add support for color images #57

martinberoiz opened this issue Oct 22, 2020 · 3 comments

Comments

@martinberoiz
Copy link
Member

For registration is probably better to use Y channel in YUV colorspace, or average of RGB.

Quick and dirty gist here https://gist.github.com/martinberoiz/1ab5f6ec4a81680517ad2d9bd2ab9f32

@leliel12
Copy link
Contributor

leliel12 commented Oct 22, 2020 via email

@martinberoiz
Copy link
Member Author

I like checking for ndim but it assumes it's a numpy array. I think this should be added to find_transform which already accepts either an iterable of (x,y) pairs or a numpy array.

The input is getting more complicated to parse, but I think it's still manageable.

This also relates to #55 but if batch_register eventually calls find_transform then we only have to modify it there once.

Regarding the joblib parallel it may be an overkill, since the loop is 3 items long.

@martinberoiz
Copy link
Member Author

Following @leliel12 suggestion, I think we should follow scikit-image's convention on which axis contains color channel info.

The convention seems to be that the trailing axis is the one for channel. Images loaded with pillow (PIL) also behave this way.

The only concern is for data cubes, or collection of images in different filters, that may be created this way:

>>> data_cube = np.array([data_g, data_r, data_i, data_z])
>>> data_cube.shape
(4, 256, 256)

Then the "channel" is the leading axis. Also astropy FITS data cube seem to put the spectral index at the front as well.

A compromise could be adding an argument channel_axis=-1 that user can change to 0.
I'm reluctant because of the argument pollution but I don't see a better option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants