-
Notifications
You must be signed in to change notification settings - Fork 19
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
different intensity dynamic with import #15
Comments
OK, I found the problem. It is not pycine, this is fine. It's the output into tiff files from CineViewer. There he takes into account the parameters gain, brightness and gamma, which were not at default. If I put them to default, the output is (almost) the same as the import via pycine. Only in the case of 16bit export the intensities are by a factor of 16 higher. It's because the four bits are filled at the end and not at the front. |
Wouldn't the CineViewer also apply the color correction matrix and white balance when exporting a tiff? That's something you would need to do on your own when using the raw .cine files. I would love to add the correct color pipeline. There is some old code from before we got the example code from VRI in https://github.com/OTTOMATIC-IO/pycine/blob/master/pycine/color.py but it's not working correctly. Porting the C example to Python or Cython or using it with CFFI would be the solution. I currently do not have the time to work on this but if you want to work on this I would be happy to help. |
Actually I only have gray-scale cameras. So I don't have accesss to any color cine files. If you can send me sample files I can try if I can figure out a good code. As it is nothig for work for me I have to do in spare times, so I will not be very fast. And the link to the request to VR in the color.py code does not wwork any more. It would be nice to have these infromation too. |
I added the output from VRIs You can get the latest (public) .cine file format documentation here. Unfortunately it does not yet contain the information about the 3x3 calibration matrix present as I will ask VRI to release the latest version of the specs. Maybe they are even willing to release the cine2tiff sample code under a permissive license. That would allow to use that code directly from a public python library. |
Dear all,
![intensity_Import](https://user-images.githubusercontent.com/60341278/77522854-352bf380-6e85-11ea-9961-559c5a26ddfd.jpg)
I use a Phantom highspeed camera which saves the data in cine-files. Therefore I use pycine to open the files and work with them. Overall it works quite nice.
But I found a discepancy between images I export directly from the Phantom software compared to the imported frames via pycine. It is not only a difference in global intensity values as expected for 8, 12 or 16 bit. It is also a different dynamic! Here you see a plot for two different exports from the Software (CV) with different bit depths and from pycine (Python). It is normalized to [0,1] to see the different dynamics.
I used the following code for saving the frames as tif files:
raw_images, setup, bpp = pycine.raw.read_frames(pin, start_frame=1) for i, raw_image in enumerate(raw_images): imsave(os.path.join(pout, 'frame_py_{}.tif'.format(str(i).zfill(4))), raw_image)
Can someone tell my, why I get different dynamics and how I can solve this issue?
Kind regards
Stefan
The text was updated successfully, but these errors were encountered: