Effacer les filtres
Effacer les filtres

custom preview function using updatepreviewwindowFcN problem

2 vues (au cours des 30 derniers jours)
gerard ditaranto
gerard ditaranto le 21 Sep 2018
Commenté : Benjamin Buch le 30 Sep 2020
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 commentaire
Benjamin Buch
Benjamin Buch le 30 Sep 2020
I have the same problem with a Flir A35. (Snapshot works as expected.)

Connectez-vous pour commenter.

Réponses (0)

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by