Traité une image par matlab script sur Labview

salut!! j'ai un programme Matlab qui fait le traitement d'image , je veux l’exécuter sous Labview et recevoir le resultas sous Labview auss . je sais pas comment faire la conversion Array to image si quelqu'un Peut m'aider Merci !!
 ci joint le programme utilise 
Attachments:
Matlab script.jpg ‏59 KB

Hello !!
sorry for being late in my answer , I had to finnish other work!! and thank you for answering 
here are the uses of  the functions that you asked me,   from the help of Matlab !!
IMFILTER N-D filtering of multidimensional images.
B = IMFILTER(A,H,OPTION1,OPTION2,...) performs multidimensional
filtering according to the specified options.
Options are:
'circular'        Input array values outside the bounds of the array are computed by implicitly assuming the input array is periodic.
'conv'            IMFILTER performs multidimensional filtering using convolution.
DECONVWNR      Deblur image using Wiener filter.
J = DECONVWNR(I,PSF)   deconvolves image I using Wiener filter algorithm,
                                         returning deblurred image J. The assumption is that the image I was
                                         created by convolving a true image with a point-spread function PSF and
                                         possibly by adding noise. The algorithm is optimal in a sense of least
                                         mean square error between the estimated and the true images, and
                                         utilizes the correlation matrixes of image and noise. In the absence of
                                         noise, the Weiner filter reduces to the ideal inverse filter.
Finally as you can see in the archives joined to this message , the results of Matlab and Labview are different , so i think that the problem is with the conversions of the type inLabview  from image to array and array to image where i lose information of the image.
have a nice day !! 
thank you !!
Attachments:
matlab vs Labview results.zip ‏2487 KB

Similar Messages

  • Using Matlab script in Labview

    Hello,
    I am trying to use matlab script in labview to post process the sampled signals from DAQ(attached is the vi I tried)
    After every 10 seconds I want to the send the sampled voltage data to matlab scritp block which does 1) detection of peaks using peakdetection function and plots the obtained peaks on the sampled signal 2) calculates standard of 10 secs data and plots on chart.
    But I am confused of 1) how to call the peakdetection function inside the matlabscript block
    2) How to send the 10secs data of voltage and time values to the matlab script block
    3) How to plot the signal and detected peaks on the same plot (which can be done in matlab using holdon as shown in the atached vi).
    Can someone suggest for implementing these .
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Labview&Matlab.vi ‏55 KB

    Thanks  GabeG,
    Now, Labview&Matlab_TestNoAq.vi  is woking Good and for the second one  Labview&Matlab_TestAq.vi it is showing error as shown in the attached image when these ines of code are present in the matlab scrtip 
    subplot(2,1,1),plot(maxtab(:,1),maxtab(:,2),'*r');
    SDN=std(maxtab(:,1));
    and SDN output of the Matlab script
    but when I removed these it is working fine(but not showing the detected peaks).
    Can you suggest me a solution for the above and also can I know the best method to add one more channel that samples another device signal which has to be processed in this same way(Signals sampled from 2 devices have to be porcessed in this same way).
    Thanks.
    Attachments:
    Script_Error.JPG ‏133 KB

  • Same code gives different results in Matlab Script in Labview and Matlab

    I am implemeting a Matlab code into a LabVIEW application using Matlab script. When I import the exactly same code to the Matlab Script in LabVIEW it gives a different result than it is in Matlab. This code is a simulation code including first kind bessel functions. Using LabVIEW 7.1 and Matlab R14 service pack 3.

    Labview 8.5
    Matlab R2009b
    Attached are the graphs produced by matlab script in labview and in matlab.
    The minimum of graph produced by matlab code is below 1 and that in labview is above 1.
    Thanks a lot for your reply.
    Sorry, I haven't quantified the "sometimes" yet. 
    Attachments:
    matlabsResult.jpg ‏29 KB
    LV.png ‏84 KB

  • Matlab script in Labview

    Hi there,
    I want to integrate my Matlab script in Labview,
    the input variable should be a Matrix like
    the following A = [ 0 256 ; 1 256 ;1.5 100 ; 1.55 110; 1.59 55; 1.6 56 ; 9 256; 14 256 ;15 100 ]
    How do I do this in Labview, I tried an array but
    no succes...
    Bye for now

    hi chris .. thanks for the reply ...
    here's the results from 'ver
    MATLAB Version 7.0.1.24704 (R14) Service Pack 1
    MATLAB License Number: 227039
    Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 2)
    Java VM Version: Java 1.4.2_04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM
    MATLAB                                               
    Version 7.0.1      (R14SP1)
    Simulink                                             
    Version 6.1        (R14SP1)
    Aerospace
    Blockset                                   
    Version 1.6.1      (R14SP1)
    Bioinformatics
    Toolbox                               
    Version 1.1.1      (R14SP1)
    CDMA Reference
    Blockset                              
    Version 1.1        (R14SP1)
    Communications
    Blockset                              
    Version 3.0.1      (R14SP1)
    Communications
    Toolbox                               
    Version 3.0.1      (R14SP1)
    Control System
    Toolbox                               
    Version 6.1        (R14SP1)
    Curve Fitting
    Toolbox                                
    Version 1.1.2      (R14SP1)
    Data Acquisition
    Toolbox                             
    Version 2.5.1      (R14SP1)
    Database
    Toolbox                                     
    Version 3.0.1      (R14SP1)
    Datafeed
    Toolbox                                     
    Version 1.6        (R14SP1)
    Embedded Target for Infineon C166 Microcontrollers    Version 1.1.1      (R14SP1)
    Embedded Target for Motorola
    HC12                    
    Version 1.1.1      (R14SP1)
    Embedded Target for Motorola
    MPC555                  
    Version 2.0.1      (R14SP1)
    Embedded Target for OSEK
    VDX                         
    Version 1.1.1      (R14SP1)
    Embedded Target for TI C2000
    DSP(tm)                 
    Version 1.1.1      (R14SP1)
    Embedded Target for TI C6000
    DSP(tm)                 
    Version 2.2.1      (R14SP1)
    Excel
    Link                                           
    Version 2.2.1      (R14SP1)
    Extended Symbolic
    Math                               
    Version 3.1.1      (R14SP1)
    Filter Design HDL
    Coder                              
    Version 1.1        (R14SP1)
    Filter Design
    Toolbox                                
    Version 3.1        (R14SP1)
    Financial Derivatives
    Toolbox                        
    Version 3.0.1      (R14SP1)
    Financial Time Series
    Toolbox                        
    Version 2.1.1      (R14SP1)
    Financial
    Toolbox                                    
    Version 2.4.2      (R14SP1)
    Fixed-Income
    Toolbox                                 
    Version 1.1        (R14SP1)
    Fixed-Point
    Toolbox                                  
    Version 1.1        (R14SP1)
    Fuzzy Logic
    Toolbox                                  
    Version 2.2        (R14SP1)

  • Matlab script of labview keeps executing multiple times,

    i have some code for serial communication in matlab , i want to use it in labview for easier and better gui design. for that i have used matlab script node in labview. it seems that labview keep executing the matlab script but i want labview to execute it only once.is there any way to do it?
    Solved!
    Go to Solution.

    i am attaching a vi file. this vi sends 'h' to the com1 continuously but i waant it to send only once.
    Attachments:
    forum.vi ‏7 KB

  • Récupération des données à partir d'une carte mémoire SD sur LABVIEW

    Salut tout le monde, 
    je suis très heureuse de devenir un membre dans ce groupe. bein, je suis entrain de faire un projet qui consiste à enregistrer des données sur carte mémoire sd à partir d'un microcontroleur puis récupérer ces données sur PC. Mon problème c'est que je veux visualiser ces données sur une interface graphique sur LABVIEW mais dommage je suis débutante sur LABVIEW et j'arrive pas à trouver une solution. Quelqu'un peut m'aider??

    If Google translate is correct, you are trying to log data to a SD card and figuring how to see it in on graph. Since you are getting started with LabVIEW I would suggest using the Write To Measurement File and Read From Measurement File. As shown in this tutorial, you only need to specify the format and file path. I would encourage you to search for code and tutorials about this VIs for more reference, like this one. I hope this helps.
    Alejandro | Academic Program Engineer | National Instruments

  • How can i put Matlab script in LabView?

    I need to recognize some signals from objects but in Lab View I don't have or i don't know how to make that. In this reason i use Matlab tools Neural network but i have doubt about possibility from this.
    If somebody solve same or near problems please tell me.
    Thank you in advance.

    Two ways:
    1. Look at the examples of Matlab (in the shipping examples).
    2. Do a vi search for "matlab", it will bring up the Matlab script node and you can experiment from there.

  • Affichage d'une image traité par matlab sur labview

    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 ]);
    Attachments:
    1335097296331.jpg ‏59 KB

    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
    National Instruments
    FlexRIO Product Support Engineer

  • Equivalent de la fonction plot (Matlab) sur Labview

    Bonjour,
    Je suis débutante un Labview et j'ai un petit problème :
    Dans mon VI il y a une partie Matlab qui trace 4 cercle :
    for m=1:4
      xe(m,: ) = R(m)+cos(alpha)*xc(m);
      ye(m,: ) = R(m)+sin(alpha)*yc(m);
    end
    Si j'écris : plot (xe(m,: ),ye(m,: )) dans la partie Matlab, quand je lance mon VI il me trace bien 4 cercles dans une nouvelle fenêtre.
    Maintenant, j'aimerais que mes xe et mes ye (mes cercles) apparaissent sur ma face-avant et non dans une nouvelle fenêtre. Pour ça j'ai essayé d'utiliser Graph XY mais ça ne fonctionne pas (je pense que c'est parce que xe et ye sont tous les 2 en 2D).
    J'aimerais donc trouver l'équivalent de la fonction plot de Matlab mais sur Labview. Quelqu'un peut m'aider ?

    Voilà ce que j'ai tenté de faire dans un premier temps pour afficher mes cercles dans un graph ( en PJ):
    (le but final étant de relier mes cercles à la place de sub_ed2)
    en PJ, il y a aussi l'affichage de mes cercles avec la fonction plot de Matlab
    Pièces jointes :
    pb labview2.png ‏248 KB
    pb labview2-bis.png ‏6 KB
    pb labview2-biss.png ‏32 KB

  • Get a better feedback from matlab script

    Hi everyone,
    I'm using matlab script from LabView. It seems to work, my server receives correct data but I would like to get some useful outputs. For instance, for debugging purpose, I'd like to be able to get messages sending by fprintf. And more generally, I could see if my script is crashed or running.
    Any idea?

    I "improved" my program by using as often as possible LabView to let Matlab just do the computation (LV is opening image, reading data sheet and send it as input for Matlab).
    And, as you've said, I split my big script into several one which is really better.
    Though, the main computation lasts 2min and it s a pity to wait such a long time without being sure of what's happening.
    One "solution" is to use a 'STEP' variable which is incremented along the computation under Matlab and use it as an output/indicator for LabView. So, if step didn't reach its max, it means that you can go back to debugging.
    An idea for LabView 8.0: create a kind of screen able to receive the standard output of Matlab

  • Matlab script error 1050

    Hi All,
    I am using MATLAB Script in LabVIEW. But there is error 1050. 
    Could you take my attached script and figure it out for me? Thanks a lot!
    elephant
    Attachments:
    MATLAB SCRIPT Error.png ‏35 KB

    I am also getting error 1050. The script works fine in Matlab with the same parameters. But in Labview, the following error occurs :
    Error 1050 occurred at LabVIEW:  Error occurred while executing script. Error message from server: ??? Error using ==> mtimes
    Inner matrix dimensions must agree.
    Error in ==> linspace at 22
    y = [d1+(0:n-2)*(d2-d1)/(floor(n)-1) d2];
    . in wgm_Individual_RootSearch.vi
    The script is:-
    format longEng
    [Lre Lim]=meshgrid(lambda0_re,lambda0_im);
    row=0;
    col=0;
    R_=zeros(N1,N2);kco=zeros(N1,N2);kc=zeros(N1,N2);M1=zeros(N1,N2);M2=zeros(N1,N2);
    mn=1e5;%minimum value
    while(mn>tol)
    L=Lre+1i*Lim;%L becomes a 2D mesh with all possible combinations of real and imag
     kco=(2*pi./L)*nco;
            kc=(2*pi./L)*nc;
            M1=nco/2*(besselj(m-1,kco*p1)-besselj(m+1,kco*p1))./besselj(m,kco*p1);
            M2=nc/2*(besselh(m-1,1,kc*p1)-besselh(m+1,1,kc*p1))./besselh(m,1,kc*p1);
            R_=abs(M1./M2 -1)';
    mn=min(R_();
    [row col]=find(R_==mn);
    Dr=lambda0_re(N1)-lambda0_re(1);
    Di=lambda0_im(N2)-lambda0_im(1);
    Lr=lambda0_re(row);
    Li=lambda0_im(col);
    lambda0_re=linspace((Lr-(Dr/20)),(Lr+(Dr/20)),N1);
    lambda0_im=linspace((Li-(Di/20)),(Li+(Di/20)),N2);
    [Lre Lim]=meshgrid(lambda0_re,lambda0_im);
    end
    r=lambda0_re(row);
    c=lambda0_im(col);
    Any hints will be really appreciated.. Where am I going wrong please let me know. Thanks  a lot.
    The parameters are in the screenshot below:

  • Error occured while executing Matlab script

    Hello!
    I want to run a Matlab script under LabVIEW, but there is always
    a error message which says "Error occured while executing script".
    Should I install Matlab on the same computer at first? if yes, do
    I need to configure Matlab under LabVIEW?
    Thanks!
    Le

    Yes No
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705

  • Sending time and voltage samples as input to matlab script block

    Hello,
    I am planning to use Matlab script in labview and the matlab scritp block needs inputs of time and voltage values of sampled signal to post process.
    Can someone explain me of how to send the sampled values of time and volatge after every  'x' interval of time to the matlab scritp block I mean if the sampling rate is 100Hz then 100samples will be collected in 1 sec but I want to send both time and votlage values collected after every 10 seconds to the matlab scritp block.
    Thanks.

    Hi,
    I am using DAQUnit 6016 that samples an analog signal of sensor.The vi I tried is attached below.
    Attachments:
    Labview&Matlab.vi ‏55 KB

  • Why Does My MATLAB Script Return Error 1048?

    I am running Matlab 6.5, and the matlab scrip is
    M_thred2=M > Thred;
    M is 2 dimensional array and Thred is a constant, so M_thred2 will have thresholded array from M.
    If I make M as output, it works fine, but M_thred2 doesn't.

    Hi,
    This error can occur if your variable name is the same as a function name in MATLAB. For instance, using the variable name disp and then trying to return this variable will generate this error. To fix this, choose variable names that are not reserved names used by MATLAB. See the MATLAB online help or user manual for a list of reserved function names.
    This error can also be generated if the Clear All function is used in your MATLAB script. To resolve the error, simply remove this function from your script. For more information on creating and using MATLAB scripts in LabVIEW, refer to LabVIEW's VI, Function, & How-To Help.
    Hope this helps,
    Isabelle
    Ingénieur d'applications
    National Instruments France

  • How to call matlab script? (it shows server error)

    hi all
    i am using original version of Labview 8.2 and Matlab 7 . but i can not call the matlab script in Labview. while doing the same it shows server error Active X control fails to connect the server. What can i do?
    suggestion please...
    thanks in advance...

    Hi adsafsaf,
    Can you provide an error number or more details about how you are trying to call your MatLab script? Until you can share those details, you might want to consult either this KnowledgeBase or this one.
    Regards,
    Hillary E
    National Instruments

Maybe you are looking for