custom preview function using updatepreviewwindowFcN problem
이전 댓글 표시
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
2020년 9월 30일
I have the same problem with a Flir A35. (Snapshot works as expected.)
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Preview and Device Configuration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!