Skip to content

Conversation

@mcnalu
Copy link

@mcnalu mcnalu commented May 4, 2023

Fix that gets raw2dng.py working again by supporting fmt in init of camdefs.py.

@osexpert
Copy link

I tried your changes in 4.0.9 but got another error instead:
Before:

    width, height = self.model.fmt.get("size", (0,0))
AttributeError: 'RaspberryPiHqCamera' object has no attribute 'fmt'

After:

    self.fmt['size']=(width,height)
TypeError: list indices must be integers or slices, not str

@mcnalu
Copy link
Author

mcnalu commented Oct 24, 2024

It looks like you've supplied fmt as a list but it should be a dict. Here's an example that works on 4.0.9 for me:

    fmt={}
    fmt['format']='SRGGB12_CSI2P'
    fmt['stride']=3072

    # choose a predefined camera model, set the sensor mode and bayer layout. 
    # this camera model class sets the appropriate DNG's tags needed based on the camera sensor. ( needed for bit unpacking, color matrices )
    #3 is 4056 by 3040, 12bpp
    #2 is 2028 by 1520, 12bpp, no crop so 2x2 bin I think
    camera = RaspberryPiHqCamera(2, fmt, CFAPattern.BGGR)

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

Successfully merging this pull request may close these issues.

2 participants