フィルターのクリア

custom preview function using updatepreviewwindowFcN problem

2 ビュー (過去 30 日間)
gerard ditaranto
gerard ditaranto 2018 年 9 月 21 日
コメント済み: Benjamin Buch 2020 年 9 月 30 日
I am trying to make a custom preview function so that that i can add some sort of image processing to the input data like imadjust. There are several examples out there, but what i seem to bump into is that the data type made by image(512,640,1) is an 8 bit and probably RGB. my data is 16 bit monochrome. I dumped the data i got from "data" in mypreview2 below and it was all 8 bit. imadjust did work, but the image was strange maybe cause only one channel of the RGB got imadjust.
The basic problem is to take in 16 bit mono data and gain it up before preview gets it. thanks in advance for your help.
imaqreset; vid = videoinput('gige', 1, 'Mono16'); vid.ROIPosition = [0 0 640 512];
% Create a figure window. This example turns off the default % toolbar and menubar in the figure. hFig = figure('Toolbar','none',... 'Menubar', 'none',... 'NumberTitle','Off',... 'Name','My Custom Preview GUI');
hImage = image(zeros(512, 640, 1)); setappdata(hImage,'UpdatePreviewWindowFcn',@mypreview2_fcn);
preview(vid, hImage);
function mypreview2_fcn(obj,event,himage) data=(event.Data); data_sub=imadjust(data); set(himage,'CData',data_sub); end
  1 件のコメント
Benjamin Buch
Benjamin Buch 2020 年 9 月 30 日
I have the same problem with a Flir A35. (Snapshot works as expected.)

サインインしてコメントする。

回答 (0 件)

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by