LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

matlab处理图像后能否在labview的前面板显示?

Where you got the data from (before you send it to matlab)?   You should have a color table if the data is 256 color.  No color table is needed for true color (24bit color).
What do you do with the data in matlab?  Depends on what you do in matlab, you may or may not be able to use the original color table.
George Zou
0 Kudos
Message 11 of 20
(3,375 Views)

图片是用数字相机拍摄的,不知道使用了什么corlor table,图片格式是unit8gray图像。经过Matlab处理(主要是图像增强滤波)后得到的图像格式是double array。处理前的图像和处理后的图像都要在lv前面板显示。请指点一下应该分别如何设置corlor tablemask需要设置吗?

 

If image depth is 24, LabVIEW ignores this input.是不是说如果是真彩色的图像,corlor table就为空?If image depth is 8, the array can have 256 elements.是否unit8的图片corlor table就是含有256个元素的?如何取值?

 

我找了好多天,几乎看不到关于Draw Flattened Pixmap的例子。请问能否提供一些例子和关于picture方面的资料?或者把我的show1.vi修改一下,只要能显示图片就ok,我再好好学习一下。

谢谢!!

0 Kudos
Message 12 of 20
(3,367 Views)
真彩色的图像 doesn't use color table. So you don't wire anything to it.
mask is always optional.
8 bit Gray scale color table: 0x010101, 0x020202, ..., 0xFFFFFF
When you say "unit8", I don't know if it's 8 bit or not.
You should get driver from you camera maker to retrieve image data and color table.
 
What 图像增强滤波 does Matlab do?  Some of them changes the color table.
You should get this informatin from Matlab.
 
关于picture方面的资料, on your LabVIEW panel => menu =>Help => Find Examples...
=> Search "picture".
 
George
 
 
 
George Zou
0 Kudos
Message 13 of 20
(3,362 Views)

I am very sorry,the "unit8" I said is "uint8",I made a mistake.

You said,"真彩色的图像 doesn't use color table. So you don't wire anything to it.
mask is always optional."
我用showtozou.vi来对一幅真彩色24位的图像进行显示(color table don't wire
 anything to it),结果仍然不能在前面板显示。您看一下是vi的哪个地方出了问题?

"8 bit Gray scale color table: 0x010101, 0x020202, ..., 0xFFFFFF",
这个怎么样在数组里设置,难道要一个一个的都输入到数组里吗?请给一个例子,我还是不明白。

“What 图像增强滤波 does Matlab do?  Some of them changes the color table.
You should get this informatin from Matlab.”
图像进入matlab之前是uint8 array,经过matlab处理之后是double array(位数应该还是8位,
把整型变为了双精度型)。

“关于picture方面的资料,on your LabVIEW panel => menu =>Help => Find Examples...
=> Search "picture".”
这里面的资料我没有找到想要的。凡是用到Draw Flattened Pixmap的,都是把corlor设为0。
所以还是恳切希望您能提供一个example,以vi的形式,让我好好学习一下。
 Thank you!

0 Kudos
Message 14 of 20
(3,356 Views)
I need to know the color depth.  Gray scale only means red, green, and blue component are equal.  Data type (uint8) might imply 8 bit (256 color), but I want to make sure.
 
I don't have matlab, so I can't test your VI.  But try to change (400, 300) to (0, 0).
 
>"8 bit Gray scale color table: 0x010101, 0x020202, ..., 0xFFFFFF",
>这个怎么样在数组里设置,难道要一个一个的都输入到数组里吗?请给一个例子,我还是不明白。
Of course not.  If you can't figure out this, you probably shouldn't do program yourself.
Hint: use a For loop, use autoindex.
 
>“What 图像增强滤波 does Matlab do?  Some of them changes the color table.
>You should get this informatin from Matlab.”
>图像进入matlab之前是uint8 array,经过matlab处理之后是double array(位数应该还是8位,
>把整型变为了双精度型)。
I need to know the 图像增强滤波 function, so I can decide if the color table changes or not.
data type (double or uint8) doesn't give me enough information.
Or you can convert your data to 24bit, so no color table needed.  But it'll be slower.
 
 
In most case, you don't create the color table yourself, except 8 bit gray scale image.
If the data comes from camera, the driver should provide the color table;
if the data comes from an image file (for example, a bmp file), the color table comes from the bmp file.
 
 
 
 
 
George Zou
0 Kudos
Message 15 of 20
(3,351 Views)
Obviously, you have much knowledage about image programming on Windows.
Recommand a book for you:
作者:吕凤军
    数字图像处理编程入门
George Zou
0 Kudos
Message 16 of 20
(3,349 Views)

You only need to read chapt one of that book.  And you can find it at:

http://www-scf.usc.edu/~flv/ipbook/chap01.htm

 

George Zou
0 Kudos
Message 17 of 20
(3,341 Views)
Thank you for your help.
"数字图像处理编程入门chapt one "我仔细看过了,对我的帮助很大。现在对于图像格式、
调色板都有了一定了解。
corlor table 已经从camera manufacture得到,是一个256色的灰度图像调色板。
In the showtozou.vi ,I tried to change (400, 300) to (0, 0),but it doesn't work.
 
图像经过matlab之后位数没有改变,还是8位,只是数据格式由unsigned integer,我想这点
变化不影响的吧?把double再转化位uint8就行了。
 
现在我考虑是不是问题不出在color table,而是出在matlab的output端子到Flatten Pixmap 之间
还需要进行一下什么转换??我也试图把从matlab里得到的double转化为uint8,连接之后也没
成功。
error out的提示一直是:
LabVIEW:  LabVIEW failed to get variable from the script server.
 Server:"7.1.0.246 (R14) Service Pack 3
" in show1.vi
您没有安装matlab可能看不到我此前发的vi,现在我图片截下来发给您,请您帮忙看看问题出在哪里。
如果您身边同事能有matlab,希望您能帮忙 调试一下,得到一个正确的vi。万分感谢!
这个问题困扰好久了,因为马上面临summer holiday,再有两天时间还解决不了的话那就会拖到开学了,
it will be very disappointed.
At last ,thank you again.
 

 

帖子被远行在07-13-2006 04:29 AM时编辑过了

帖子被远行在07-13-2006 06:00 AM时编辑过了

0 Kudos
Message 18 of 20
(3,335 Views)
In the showtozou.vi ,I tried to change (400, 300) to (0, 0),but it doesn't work.
Is it just blank?
 
LabVIEW:  LabVIEW failed to get variable from the script server.
 Server:"7.1.0.246 (R14) Service Pack 3
" in show1.vi
It seems you have problem with Matlab script.  Modified your VI a little to see if the return data are valid.
I can see your VI, just can't run it.
I don't know Matlab script, can't help you.  We don't have Matlab here.
George Zou
0 Kudos
Message 19 of 20
(3,323 Views)
我试了多次, the return data  from matlab script 全为0,不知道是哪里出了问题,估计是matlab的问题。
 
看样子问题要等到暑假回来才能解决了。
 
Thank you for your help these days. Best wishes to you,everything goes well.
0 Kudos
Message 20 of 20
(3,316 Views)