04-26-2012 11:08 AM
Bonjour!!
je veux faire un traitement d'image avec matlab et afficher les resultats sous Labview . j'ai essayer la formula node de matlab dans la palette mathematics mais l'affichage se fait toujours sur matlab comment je peux l'afficher sur labview ??
vous trouver ci-joint le programme utiliser .
% Load jpeg files
orgImage = imread('Pixel.jpg', 'jpg');
figure(1); imshow(orgImage);
% 2D FFT
fftImage = fftshift(fft2(orgImage)); % 2d fft
ampImage= abs(fftImage);
figure(2); imshow(ampImage, [0 10000 ]);
% Convolution (low-pass filtering)
filter = fspecial('gaussian',[10 10], 4); % gaussian kernel
filterImage = conv2(orgImage, filter); % convolution
figure(3); imshow(filterImage, [0 250]);
% 2D FFT of filtered image
fftFilterImage = fftshift(fft2(filterImage));
ampFilterImage= abs(fftFilterImage);
figure(4); imshow(ampFilterImage, [0 10000 ]);
04-27-2012 03:59 PM
tjrs pas de réponse ??
04-27-2012 05:23 PM - edited 04-27-2012 05:25 PM
Hello aziz-be,
You may find quicker responses in the french forum.
http://forums.ni.com/t5/Discussions-de-produit-de-NI/bd-p/4170
Regarding your question. The Matlab Scipt Node uses activeX to access an api that calls into the Matlab engine. Thus any figure generation would occur on the Matlab side of things. What you could try doing is converting the figure to an image, converting the image to an array, and bringing that array into labview and converting it into a LabVIEW image type which you could then display inside of LabVIEW. This is a rather convoluted way of displaying a figure on the front panel inside of LabVIEW though. You may find it much easier to do what you are trying to accomplish with the MathScript Node rather than the Matlab Script Node.
figure (MathScript RT Module Function)
http://zone.ni.com/reference/en-XX/help/373123B-01/lvtextmath/msfunc_figure/
NI LabVIEW MathScript RT Module
http://www.ni.com/labview/mathscript/
David A