8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
When trying to save 14b raw data as a dng (see #75 for why I have to do that) PiDNG crashes:
out[:, ::7] = data[:, ::6] >> 6 ~~~^^^^^^^^ ValueError: could not broadcast input array from shape (3000,502) into shape (3000,752)
This is due to the packing algorithm being just plain wrong. I'd propose the following fix, which works just fine for me:
def pack14(data : np.ndarray) -> np.ndarray: out = np.zeros((data.shape[0], int(data.shape[1]*(1.75))), dtype=np.uint8) out[:, ::7] = data[:, ::4] >> 6 out[:, 1::7] = ((data[:, ::4] & 0b0000000000111111) << 2) out[:, 1::7] += data[:, 1::4] >> 12 out[:, 2::7] = ((data[:, 1::4] & 0b0000111111110000) >> 4) out[:, 3::7] = ((data[:, 1::4] & 0b0000000000001111) << 4) out[:, 3::7] += data[:, 2::4] >> 10 out[:, 4::7] = ((data[:, 2::4] & 0b0000001111111100) >> 2) out[:, 5::7] = ((data[:, 2::4] & 0b0000000000000011) << 6) out[:, 5::7] += data[:, 3::4] >> 8 out[:, 6::7] = data[:, 3::4] & 0b0000000011111111 return out
If wanted I could create a pull request for it, in which case I'd probably propose a couple other changes here to make these functions more robust.
The text was updated successfully, but these errors were encountered:
OParczyk, you're my hero. Thank you for this contribution!!
Sorry, something went wrong.
No branches or pull requests
When trying to save 14b raw data as a dng (see #75 for why I have to do that) PiDNG crashes:
This is due to the packing algorithm being just plain wrong. I'd propose the following fix, which works just fine for me:
If wanted I could create a pull request for it, in which case I'd probably propose a couple other changes here to make these functions more robust.
The text was updated successfully, but these errors were encountered: