Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

FreeImage Lib: convert raw image to cv::Mat

Hi there,

are there any FreeImage users in this cmmunity? I am trying to convert a FreeImage RAW image (Sony ARW File) data structure with the following specs:

type: FIT_RGB16 bits per pixel: 48

to a cv::Mat data structure. Besides a lot of tests, I tried the following:

//image dimensions int cols = FreeImage_GetWidth(rawImage); int rows = FreeImage_GetHeight(rawImage);

FIRGB16 bits = (FIRGB16 )FreeImage_GetScanLine(rawImage, 0);

cv::Mat preview(rows, cols, CV_16UC3, bits, cols * 3);

There is always a segmentation fault. Can you tell me what I am doing wrong? Since a 48bit image is not so special I really don't understand what I am doing wrong...

Thanks for your help! Johannes

FreeImage Lib: convert raw image to cv::Mat

Hi there,

are there any FreeImage users in this cmmunity? I am posting here because the FreeImage users were sadly not able to help me yet... I am trying to convert a FreeImage RAW image (Sony ARW File) data structure with the following specs:

type: FIT_RGB16 bits per pixel: 48

to a cv::Mat data structure. Besides a lot of tests, I tried the following:

//image dimensions int cols = FreeImage_GetWidth(rawImage); int rows = FreeImage_GetHeight(rawImage);

FIRGB16 bits = (FIRGB16 )FreeImage_GetScanLine(rawImage, 0);

cv::Mat preview(rows, cols, CV_16UC3, bits, cols * 3);

There is always a segmentation fault. Can you tell me what I am doing wrong? Since a 48bit image is not so special I really don't understand what I am doing wrong...

Thanks for your help! Johannes

FreeImage Lib: convert raw image to cv::Mat

Hi there,

are there any FreeImage users in this cmmunity? I am posting here because the FreeImage users were sadly not able to help me yet... I am trying to convert a FreeImage RAW image (Sony ARW File) data structure with the following specs:

type: FIT_RGB16 bits per pixel: 48

to a cv::Mat data structure. Besides a lot of tests, I tried the following:

//image dimensions int cols = FreeImage_GetWidth(rawImage); int rows = FreeImage_GetHeight(rawImage);

FIRGB16 bits = (FIRGB16 )FreeImage_GetScanLine(rawImage, 0);

cv::Mat preview(rows, cols, CV_16UC3, bits, cols * 3);

There is always a segmentation fault. Can you tell me what I am doing wrong? Since a 48bit image is not so special I really don't understand what I am doing wrong...

Thanks for your help! Any tips are really appreciated! Johannes

FreeImage Lib: convert raw image to cv::Mat

Hi there,

are there any FreeImage users in this cmmunity? I am posting here because the FreeImage users were sadly not able to help me yet... I am trying to convert a FreeImage RAW image (Sony ARW File) data structure with the following specs:

type: FIT_RGB16 bits per pixel: 48

to a cv::Mat data structure. Besides a lot of tests, I tried the following:

//image dimensions
int cols = FreeImage_GetWidth(rawImage);
int rows = FreeImage_GetHeight(rawImage);

FreeImage_GetHeight(rawImage);

FIRGB16 bits = (FIRGB16 )FreeImage_GetScanLine(rawImage, 0);

0);

cv::Mat preview(rows, cols, CV_16UC3, bits, cols * 3);

3);

There is always a segmentation fault. Can you tell me what I am doing wrong? Since a 48bit image is not so special I really don't understand what I am doing wrong...

Any tips are really appreciated! Johannes

FreeImage Lib: convert raw image to cv::Mat

Hi there,

are there any FreeImage users in this cmmunity? I am posting here because the FreeImage users were sadly not able to help me yet... I am trying to convert a FreeImage RAW image (Sony ARW File) data structure with the following specs:

type: FIT_RGB16 bits per pixel: 48

to a cv::Mat data structure. Besides a lot of tests, I tried the following:

//image dimensions
int cols = FreeImage_GetWidth(rawImage);
int rows = FreeImage_GetHeight(rawImage);

FIRGB16 FIRGB16* bits = (FIRGB16 (FIRGB16* )FreeImage_GetScanLine(rawImage, 0);

cv::Mat preview(rows, cols, CV_16UC3, bits, cols * 3);

There is always a segmentation fault. Can you tell me what I am doing wrong? Since a 48bit image is not so special I really don't understand what I am doing wrong...

Any tips are really appreciated! Johannes

FreeImage Lib: convert raw image to cv::Mat

Hi there,

are there any FreeImage users in this cmmunity? I am posting here because the FreeImage users were sadly not able to help me yet... I am trying to convert a FreeImage RAW image (Sony ARW File) data structure with the following specs:

type: FIT_RGB16 bits per pixel: 48

to a cv::Mat data structure. Besides a lot of tests, I tried the following:

//image dimensions
int cols = FreeImage_GetWidth(rawImage);
int rows = FreeImage_GetHeight(rawImage);

FIRGB16* bits = (FIRGB16* )FreeImage_GetScanLine(rawImage, 0);

cv::Mat preview(rows, cols, CV_16UC3, bits, cols * 3);

There is always a segmentation fault. Can you tell me what I am doing wrong? Since a 48bit image is not so special I really don't understand what I am doing wrong...wrong.

Any tips are really appreciated! Johannes

FreeImage Lib: convert raw image to cv::Mat

Hi there,

are there any FreeImage users in this cmmunity? I am posting here because the FreeImage users were sadly not able to help me yet... I am trying to convert a FreeImage RAW image (Sony ARW File) data structure with the following specs:

type: FIT_RGB16 bits per pixel: 48

to a cv::Mat data structure. Besides a lot of tests, I tried the following:

//image dimensions
int cols = FreeImage_GetWidth(rawImage);
int rows = FreeImage_GetHeight(rawImage);

FIRGB16* bits = (FIRGB16* )FreeImage_GetScanLine(rawImage, 0);

cv::Mat preview(rows, cols, CV_16UC3, bits, cols * 3);

There is always a segmentation fault. Can you tell me what I am doing wrong? Since a 48bit image is not so special I really don't understand what I am doing wrong.

Any tips are really appreciated! JohannesJohannesZ