LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

フロントパネル上の画像を取得する方法について

Solved!
Go to solution

お世話になります. 

 

現在, カメラで撮像した映像をフロントパネル上に表示し, フロントパネル上の画像を取得するプログラムを制作中です. 

以下の記事を参考にプログラムを制作し, 画像を保存することは成功しました. 

フロントパネルの画像をJPEG、PNG、BMPファイルに保存したい - NI

 

ですが, 保存された画像を確認すると, フロントパネル全体の画像が取得されてしまいます. 

取得した画像取得した画像

 

実現したいことは, 以下画像赤枠内の領域画像を取得することです.

どのようにして, 実現すればよろしいでしょうか?ご教示よろしくお願いいたします. 

isk_YO_0-1715066492122.png

 

【ご参考】該当箇所のソースvi

isk_YO_1-1715066637924.png

 

 

0 Kudos
Message 1 of 9
(229 Views)

[部分画像を取得] アイコンで、必要な領域を切り出してから保存する方法が考えられますけれどいかがでしょうか。

 

部分画像を取得.png

Message 2 of 9
(168 Views)

If you working with IMAQ and need to save images from Vision Control why do not use IMAQ Write File 2 Function from Vision & Motion -> Vision Utilities -> Files Palette, which is intendent exactly for this purpose?

Screenshot 2024-05-09 07.05.20.png

As far as I can see you have 8 bit image, so any File Type will be OK for you.

Message 3 of 9
(158 Views)

is IMAQ required for this? just use .NET system.drawing or .common

CY (expired CLAD)
Message 4 of 9
(146 Views)
Solution
Accepted by topic author isk_Y.O

@cy... wrote:

is IMAQ required for this? just use .NET system.drawing or .common


Yes, you need IMAQ, and you already using IMAQ, just connect this with this:

Screenshot 2024-05-09 13.29.17.png

That is.

 

Message 5 of 9
(141 Views)

ご回答誠にありがとうございます. 

 

[部分画像を取得], 存じ上げておりませんでした. 

確かに必要な領域だけ切り抜きできました.

しかし, 説明はしていなかったのですが今回作成のプログラムはユーザが解像度を任意に変更できる機能が実装してあります. 

すると当然, フロントパネルに出力される画像サイズも変わるため部分境界値の指定に工夫が必要になります. 

従って, もう少し簡単に要件が実装できるノードがあれば...というのが本音でございます. 

 

ただ, 大変勉強になりました. 当方なにぶん初学者なものですから...

別回答者様の [IMAQ Write File 2] を用いたやり方で本件は解決できました. 

ご教示, 誠にありがとうございました. 

0 Kudos
Message 6 of 9
(130 Views)

Hi, thanks for your answer.

 

In this case, the camera is connected using Camera Link communication.
Therefore, we thought that IMAQ would be necessary.

0 Kudos
Message 7 of 9
(129 Views)

Hi, thanks for your answer.
It is very helpful that you included the sample program capture.
The reason I did not use [IMAQ Write File 2] is that I did not know this node...
But with this, I was able to implement the function I wanted to do!


Thank you so much! Now I don't have to get mad at my boss lol.

0 Kudos
Message 8 of 9
(128 Views)

Andrey's answer is most straightforward if IMAQ is involved... Kudos

 

use .NET only for the parts IMAQ doesn't support

CY (expired CLAD)
Message 9 of 9
(112 Views)