简体   繁体   English

在C或LabView中生成的16位灰度图像的结构

[英]Structure of 16-bit grayscale image to be generated in C or LabView

I have a kind of basic (but still unresolved) problem. 我有一个基本的问题(但仍未解决)。 I'm building a program in LabView in which I gather a large amount of measurements into anxm matrix, and I need to convert that matrix into an image to be processed/analyzed with ImageJ. 我正在LabView中构建一个程序,其中将大量测量结果收集到anxm矩阵中,并且需要将该矩阵转换为要用ImageJ处理/分析的图像。 Due to resolution and the kind of analysis I need, this has to be a 16-bit grayscale image. 由于分辨率和我需要的分析种类,这必须是16位灰度图像。

Now, the problems I'm facing are the following: LabView does not have (on the basic package) any VI to transform data into 16-bit grayscale, only 8-bit, which kills my dynamic range. 现在,我面临的问题如下:LabView(在基本软件包中)没有任何VI可以将数据转换为16位灰度,只有8位,这扼杀了我的动态范围。 I've read around that the Vision and Image toolboxes of LabView might have more options in that sense, but for company-related reasons I cannot access these toolboxes (ie I have to make do with the Full Developer version only). 我已经了解到,LabView的视觉和图像工具箱在这种意义上可能有更多选项,但是由于公司相关的原因,我无法访问这些工具箱(即,我只能使用Full Developer版本)。

My reaction at the moment is to try and build on my own a VI to build a 16-bit grayscale image, whether by using standard LabView functions, entirely with C code, or mixtures of both. 目前,我的反应是尝试自行构建一个VI,以构建16位灰度图像,无论是使用标准的LabView函数(完全使用C代码)还是两者混合使用。 However, I haven't found any clear-enough information on the web regarding how a 16-bit grayscale is structured, what data is needed, etc. 但是,我没有在网上找到关于16位灰度的结构,所需数据等的足够清晰的信息。

So, my question is twofold: does anyone have a better way of creating this 16-bit grayscale image (some LabView VI I've skipped, external software I can invoke, etc.)? 所以,我的问题是双重的:有人能更好地创建此16位灰度图像吗(我已经跳过了某些LabView VI,可以调用外部软件等)? If not, does anyone have detailed information or code useful to generating such an image from scratch? 如果没有,是否有人拥有对从头开始生成此类图像有用的详细信息或代码?

Any help will be really useful! 任何帮助将非常有用! Thanks! 谢谢!

Install IMAQ module (different than the vision toolbox), it is free and has basic image management capabilities. 安装IMAQ模块(与视觉工具箱不同),它是免费的,具有基本的图像管理功能。 I use it for creating 16 bit grayscale images. 我用它来创建16位灰度图像。

创建16位灰度图像

Find IMAQ driver here (4.6.4 as of June 2012). 在此处找到IMAQ驱动程序 (截至2012年6月为4.6.4)。

Since you mention 16-bit grayscale, I interpret that to mean that you need 16 bits of precision per pixel. 由于您提到16位灰度,因此我将其解释为意味着每个像素需要16位精度。

So, if you're failing to create that directly as grayscale, perhaps you can create it as a true-color image, and simply encode your sixteen bits by splitting them into eg the red and green components? 因此,如果您无法直接将其创建为灰度级,也许可以将其创建为真彩色图像,并通过将它们分成例如红色和绿色分量来简单地编码16位?

So for every 16-bit pixel value x , you would set red = x / 256; 因此,对于每个16位像素值x ,您将设置red = x / 256; , green = x % 256; green = x % 256; and blue = 0; blue = 0; .

Did you already try posting this question to the NI Forums as well? 您是否已经尝试过将这个问题发布到NI论坛? There may be some other LabVIEW developers who have tried to accomplish the same thing you're tackling here. 可能还有其他LabVIEW开发人员试图完成您在此处要解决的相同问题。 Hopefully you won't have to start from scratch. 希望您不必从头开始。 https://bit.ly/NIForums https://bit.ly/NIForums

Have you checked to see if you can get your hands on any trial versions of the LabVIEW vision toolkits/addons? 您是否检查过是否可以使用LabVIEW视觉工具包/插件的任何试用版?

And if your company has a SSP (paid support option although you typically get one year free when you buy LabVIEW), I'd also suggest you give the support engineers a call. 而且,如果您的公司有SSP(有偿支持选项,尽管购买LabVIEW通常可以免费获得一年),我也建议您致电支持工程师。 They can coach you through some in's and out's of getting around some of the current limitations. 他们可以指导您解决一些当前的限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM