필터 지우기
필터 지우기

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