Slices of float image

asked 2020-03-06 03:05:23 -0500

NL37 gravatar image

Hello,

I am working on project in which I capture 5 grayscales images 8 bit uchar images (CV_8UC1), and I sum those images in 16 bit float image (CV_16FC1).

My question is : Why CV_16FC1 has 2 slices ? I need 1, and then I send that image toward an other computer over TCP/IP socket.

Thank you

edit retag flag offensive close merge delete

Comments

Why CV_16FC1 has 2 slices

why do you think, it is so ? please explain "slices"

berak gravatar imageberak ( 2020-03-06 03:17:47 -0500 )edit

Sorry if I am not clear.

As I use grayscale, I expect to obtain 1 with the following code : Image_Process.elemSize();. If it is CV_8UC1 image, it is 1. If I have CV_16FC1 image, it is 2. If I have CV_32FC1 image, it is 2.

NL37 gravatar imageNL37 ( 2020-03-06 03:56:36 -0500 )edit

so you mean bytes ? (CV_16F == 16bits == 2*8bit)

also elemSize() should be 4 for CV_32F, check again, please

berak gravatar imageberak ( 2020-03-06 04:15:01 -0500 )edit

Ok great many thanks. Because I though that elemSize() gives the total number of channel.

Thank you

NL37 gravatar imageNL37 ( 2020-03-06 07:58:13 -0500 )edit

elemSize() == numbytes_per_channel * num_channels

berak gravatar imageberak ( 2020-03-06 08:53:29 -0500 )edit