PDA

View Full Version : Y16 video format



Boonping
June 11, 2013, 10:50:43
Hi,

Do you have the description of the data position (LSB\MSB) for the video format Y16?. And how can I use extract 12 bits data from the C++ library.

I found that it is not in any of the documents provided.

Thanks.

Best regards,
Boon Ping

Stefan Geissler
June 12, 2013, 11:09:36
Hello,

the used pixel mask is 11111111 11110000. But the lower 4 bits can be ignored, so you can cast the pixel value directly into unsigned short int.

Boonping
June 18, 2013, 16:35:48
Hi,

Do you have the .dll files in the C++ support which I can call from Labview? I'm thinking if there are possibilities to access the full 16 buffer in Labview.

Thanks.

Stefan Geissler
June 18, 2013, 16:54:30
Hello

I am very sorry, but for LabVIEW we do not have this ready. The ActiveX does not support this.

Boonping
July 19, 2013, 13:55:47
Dear Stefan,

Do you know if the activeX or DLL for LabVIEW for the Y16 is ready?

Thanks.

Best regards,
BP

Stefan Geissler
July 19, 2013, 14:47:23
16 bit sink formats are not supported by the ActiveX.

However, you may use the .NET component instead. In this case, you must use all properties and methods of the component directly. You can not use all the nice VIs provided with the IC LabVIEW extension.

Boonping
July 31, 2013, 11:50:50
16 bit sink formats are not supported by the ActiveX.

However, you may use the .NET component instead. In this case, you must use all properties and methods of the component directly. You can not use all the nice VIs provided with the IC LabVIEW extension.

Dear Stefan,

Thank you for the reply.

For the documentation you provided, I have a few questions.

1) for the exmaple:

Private Function ReadY16(ByVal buf As TIS.Imaging.ImageBuffer, ByVal row As Integer, ByVal col As Integer) As UInt16
' Y16 is top-down, the first line has index 0
Dim offset As Integer = row * buf.BytesPerLine + col * 2

Dim val As Int16 = System.Runtime.InteropServices.Marshal.ReadInt16(b uf.GetIntPtr(), offset)

Return ToUInt16(val)
End Function

a) Is the Function a single point extraction? Seem like it maps to each row and column as a pixel.
b) I don't quite understand the offset. For the row*buf.BtyesPerLine, I can understand as it is the offest to extract the buffer position of each row. However, for the col*2, it seems quite strange. This is becuase when I returned the bytesPerLine, it is 4800. Which means in my case, there are 4800/1600 = 3 btyes per pixel. If I assumed this, the command line should be col*3. If this assumption is wrong, then I have another assumption which is in the 4800 bytes per line, only the first 2*1600 are valid data, and the rest of the 1600 btyes are useless.

2) Do I need to use the FrameHandlerSink.SnapImage to before I can save the data. I try to use LiveDisplay and capture the data and is this correct. I have attached the VI in version 8 and picture for your reference.16101611

3) Can I capture the whole 5MB(4800Btyes/Lines*1200Lines) data and do a post processing to extra the meaningful 12 bits data?

Looking forward to your reply. Thank you.


Best regards,
Boon Ping

Stefan Geissler
August 1, 2013, 11:11:50
Hi Boon Ping,


System.Runtime.InteropServices.Marshal.ReadInt16(b uf.GetIntPtr(), offset)
First of all, this is .NET.


b) I don't quite understand the offset. For the row*buf.BtyesPerLine, I can understand as it is the offest to extract the buffer position of each row. However, for the col*2, it seems quite strange. This is becuase when I returned the bytesPerLine, it is 4800. Which means in my case, there are 4800/1600 = 3 btyes per pixel. If I assumed this, the command line should be col*3. If this assumption is wrong, then I have another assumption which is in the 4800 bytes per line, only the first 2*1600 are valid data, and the rest of the 1600 btyes are useless.

Please refer to:
http://msdn.microsoft.com/de-de/library/system.runtime.interopservices.marshal.readint16.a spx


2) Do I need to use the FrameHandlerSink.SnapImage to before I can save the data. I try to use LiveDisplay and capture the data and is this correct. I have attached the VI in version 8 and picture for your reference.Grab16bitdata.zipUnbenannt.jpg

Usually not, but you have to disable the overlaybitmap by setting its path position to none. Also you must set the sink format to a 16 bit format. This is available in IC Imaging Control 3.3. (not in the ActiveX).


3) Can I capture the whole 5MB(4800Btyes/Lines*1200Lines) data and do a post processing to extra the meaningful 12 bits data?
I think so. I know, this answer is not as helpful, but we did this in C#.

Boonping
August 1, 2013, 11:47:33
Dear Stefan,

Thanks for the reply. Currently, I have changed all my labview ActiveX into .Net using the library, TIS.ImagingControl33(3.3.2.1586).

I have no problem with the .NET command. I only have problem with the buffer, which is 24 bit, but I guess I will need to do step (2), which is change the sink format to 16 bit first.

How do I change the sink format? I tried to change the video format to Y16, which the PixelFormat returned "DontCare, Undefine" and the BitsPerpizel returned "16". When I change the video format to Y800, the PixelFormat returned "Format8bppIndexed" or I change to RGB, the PixelFormat return will be "Format24bppRgb".


I try to write into MemoryCurrentGrabberColorformat(change to ICY16) and MemoryPixelformat and it does not work.

Thank you.

Best regards,
Boon Ping

Stefan Geissler
August 1, 2013, 13:30:52
Hi Boon Ping


I have changed all my labview ActiveX into .Net using the library
Very well!!

Ok. First of all, remove the overlay bitmap object from IC Imaging Control. This converts the image to 8 bits
icimagingcontrol.overlaybitmap.pathposition = none;

Who returns "Format8bppIndexed"?

Boonping
August 1, 2013, 15:21:32
Dear Stefan,




First of all, remove the overlay bitmap object from IC Imaging Control. This converts the image to 8 bits
icimagingcontrol.overlaybitmap.pathposition = none;



Thanks!! It work. I checked that in Labview, the function should be "icimagingcontrol.overlaybitmapposition = none".



Who returns "Format8bppIndexed"?

The returns I check is TIS.Imaging.FrameType.PixelFormat.

Best regards,
Boon Ping