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

Describe image operations #36

Open
jeaunrg opened this issue Apr 13, 2021 · 3 comments
Open

Describe image operations #36

jeaunrg opened this issue Apr 13, 2021 · 3 comments

Comments

@jeaunrg
Copy link
Collaborator

jeaunrg commented Apr 13, 2021

For now the management of image types, storing and operations are not crystal clear, but it is the center of all our processes.
We have to define what we want when we use operations on images and how we want to store them.

We can decide to keep:

  • saturated operation, like openCV does (250 + 10 = 260 => 255)
  • modulo operation, like numpy does (250 + 10 = 260 % 256 => 4)
  • true operation, like we currently do (250 + 10 = 260 => 260)

True operation looks nice to me but implies many issues:

  • creation of numpy raw array of type float64 (stored in _IMAGES_STACK), using more memory than uint8 (0-255) array.
  • uint8-like double of raw array (stored in IMAGES_STACK), vital to have a realtime snap view with scroll wheel.
  • if we want to store images with minimum memory, we need to find the best type at each time we click on apply (loose process time) and save raw array as sparse array

So what do you think @Hboni ?

@Hboni
Copy link
Owner

Hboni commented Apr 14, 2021

Your description is pretty clear! I agree that the best solution would be the true operation.
Maybe some investigation on numpy function as add and other would be great, maybe this type of type management is already include in numpy.
I know that another problem of processes in Francis is that it can take some times to make basic operations like dilation, but is it quicker in case of using int8 image instead of float image? If it really change something, the optimization would be more interesting.

@jeaunrg
Copy link
Collaborator Author

jeaunrg commented Apr 14, 2021

I didnt find anything about that with numpy except specifying the dtype. There is a function which find the minimal dtype but only for a single value, not array.
For now I think we should keep any modified raw array in float64 because the process to find the best type is too long.

@Hboni
Copy link
Owner

Hboni commented Apr 16, 2021

Ok I see, I agree to keep everything in float64 for now

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

No branches or pull requests

2 participants