ilia3101 / MLV-App

All in one MLV processing app.
https://mlv.app/
GNU General Public License v3.0
283 stars 29 forks source link

How to use the camid getting matrix functions? #80

Closed ilia3101 closed 6 years ago

bouncyball-git commented 6 years ago

Sorry about late answer. It is very simple.

These are funcs from cam_id.h:

This one is for getting the "camera name"/"unique name" for the given camera model ID:

const char* camidGetCameraName(uint32_t cameraModel, int camname_type);

There funcs to get all other info by camera model ID:

int32_t* camidGetColorMatrix1(uint32_t cameraModel);
int32_t* camidGetColorMatrix2(uint32_t cameraModel);
int32_t* camidGetForwardMatrix1(uint32_t cameraModel);
int32_t* camidGetForwardMatrix2(uint32_t cameraModel);
int32_t* camidGetHFocalResolution(uint32_t cameraModel);
int32_t* camidGetVFocalResolution(uint32_t cameraModel);
int32_t camidGetFocalUnit(uint32_t cameraModel);

To get matrix 1 or 2 use first 2 functions. However the matrix you need is the matrix2

Example:

int32_t * 5d2_camera_matrix2 = camidGetColorMatrix2( 0x80000218 );

all camera model IDs are in the cam_id.c file and available from IDNT header of MLV (cameraModel)

typedef struct {
    uint8_t     blockType[4];
    uint32_t    blockSize;    /* total frame size */
    uint64_t    timestamp;    /* hardware counter timestamp for this frame (relative to recording start) */
    uint8_t     cameraName[32];    /* PROP (0x00000002), offset 0, length 32 */
    uint32_t    cameraModel;    /* PROP (0x00000002), offset 32, length 4 */
    uint8_t     cameraSerial[32];    /* Camera serial number (if available) */
}  mlv_idnt_hdr_t;

That's all :)

bouncyball-git commented 6 years ago

It returns vanilla matrix with dividers ( I know you hate it ;) ). I could write some funcs which will return float matrix without divider to eliminate more work for you. Need it?

I just needed this type of matrix for including to dng header. There is no tag for float matrix in dng header.

ilia3101 commented 6 years ago

Thanks for the explanation, it was really helpful. Sorry didn't reply at the time

The dividers are alright :)

ilia3101 commented 6 years ago

What is the forward matrix for?

bouncyball-git commented 6 years ago

Some info