Ask Your Question

jjsword's profile - activity

2019-11-30 07:49:57 -0600 received badge  Student (source)
2019-10-01 15:52:44 -0600 commented question unpack 12 bit mono images

Well it seems that this code actually does work. I didn’t need to create a pointer or do memcpy so that is unnecessary.

2019-09-30 17:49:11 -0600 answered a question unpack 12 bit mono images

Well it seems that this code actually does work. I didn’t need to create a pointer or do memcpy so that is unnecessary.

2019-09-23 12:32:24 -0600 asked a question unpack 12 bit mono images

unpack 12 bit mono images I'm trying to process images from a Hamamatsu Orca flash 4 camera using Opencv and having some

2019-09-23 06:16:40 -0600 received badge  Enthusiast
2019-09-20 08:41:23 -0600 received badge  Editor (source)
2019-09-20 08:41:23 -0600 edited question How do I transfer buffer data to a Mat object using memcpy?

How do I transfer buffer data to a Mat object using memcpy? I'm trying to do image processing of frames from a Hamamatsu

2019-09-19 16:51:34 -0600 commented answer How do I transfer buffer data to a Mat object using memcpy?

One more question is that if this is a 12 bit image that is bit packed where 2 pixels are contained in 3 bytes, is there

2019-09-11 09:16:54 -0600 commented answer How do I transfer buffer data to a Mat object using memcpy?

That worked! Thanks!

2019-09-11 09:14:29 -0600 marked best answer How do I transfer buffer data to a Mat object using memcpy?

I'm trying to do image processing of frames from a Hamamatsu Orca flash 4 v 3 and am having a tough time transferring the buffer data to a Mat object.

Here is some example code from the live_average example in the Hamamatsu SDK from their website https://dcam-api.com/sdk-downloads/ :

Frames are monochrome 2048 x 2048 of 16 bit unsigned int

The "image" window is grey, suggesting that I am not actually transferring by reference like I think that I am. Any suggestions on troubleshooting the problem?

Also, if this is a 12 bit image where 2 pixels are packed into 3 bytes, is there a way to directly import into a Mat object or must they be unpacked first? What would be an efficient way to do that?

        // access image

        err = dcambuf_lockframe( hdcam, &bufframe);
        if( failed(err) )
        {
            dcamcon_show_dcamerr( hdcam, err, "dcambuf_lockframe()" );
            continue;
        }

        // a frame has come

        cv::Mat img(2048, 2048, CV_16U);
        ushort* pointer_to_data_start = img.ptr<ushort>();
        memcpy(pointer_to_data_start, bufframe.buf, bufframe.height * bufframe.rowbytes);
        imshow("image", img);
2019-09-11 09:14:29 -0600 received badge  Scholar (source)
2019-09-10 14:36:13 -0600 asked a question How do I transfer buffer data to a Mat object using memcpy?

How do I transfer buffer data to a Mat object using memcpy? I'm trying to do image processing of frames from a Hamamatsu

2019-01-12 13:53:37 -0600 answered a question Problem getting Mat from GigE camera (Sapera SDK)

Has anyone figured out a way to transfer images to a Mat object with the Sapera SDK without using CVB? Seems this has a