Convertir une image en un tableau RGB de valeur [0,255]

Bonjour!
je suis débutant sur Labview et je veux faire le traitement d'image . J'ai un programme que j'ai téléchargé sur internet qui simule un filtre de wiener Mais l'entré est un tableau de RBG , je veux prendre n'importe quelle image et lui appliquée ce filtre ; comment je peux faire ??
ci-joint le programme utilisé .
Merci 
Attachments:
01.Wiener Filter - Color.vi ‏2911 KB

LabVIEW fait la lecture d'un image (fichier) jpeg, bmp, ou png en utilisant U8.  La fonction Wiener ne semble pas aimer les U8, mais plutot les doubles ayant des fractions, pas des nombres comme:  234.000, 543.000, etc.
J'ai ameliorer la fonction qui converti l'image en une matrice 3D pour des images plus amples.  Voir ci dessous.
Tu peux savegarder le fichier png sur ton ordi et "dragger" (je pense que ce n'est pas la bonne expression) le fichier png dans ton diagramme et automatiquement, tu auras le code.
J'ai oublier d'enlever les fils allant ailleurs dans le code avant de faire un snippet...
Attachments:
jpeg2-3Darray.png ‏42 KB

Similar Messages

  • Convertir une image "Grayscale I16" en "RGB U64"

    Bonjour,
    je cherche depuis un petit moment sur tous les forums que je connais, et je ne trouve pas de réponse à mon besoin, à savoir convertir une image en niveaux de gris de 16 bits en RGB 64 bits. J'ai réussi à le faire en 32 bits, mais la dégradation est trop importante pour mes besoins.
    Si vous avez une solution, je vous en serais reconnaissant.
    Si ça peut vous aider, j'ai Labview 8.6 et NI Vision.
    Merci d'avance

    Si vous souhaitez, voici le VI que j'essaye de faire. 
    Il marche très bien en grayscale 8bits => RGB 32 bits, mais pas en Grayscale 16 bits => RGB 64 bits...
    J'ai supprimé tout le traitement que j'effectue sur l'image pour que ce soit plus lisible. Comme j'effectue divers traitement suivant la couche de l'image (R,G,B), je suis obligé de passer par un Imaq ReplaceColorPlane. 
    Merci du temps que vous consacrez à mon problème.
    Pièces jointes :
    tests.zip ‏217 KB

  • Convertir une image couleur en tableau

    Bonjour,
    Je souhaiterai appliquer un seuil sur une image couleur. Il semblerait que le VI IMAQ Threshold ne fonctionne que sur des images noir et blanc? j'aimerai donc procéder de la manière suivante : j'ai besoin d'extraire les plans de l'image et de les convertir en tableau. Puis j'applique un sous VI de calcul (créé par me soins) afin de créer un seuil. Seuilement, à l'exécution du VI plusieurs erreurs apparaissent :
    L'erreur -1074396080 s'est produite à : IMAQ ExtractColorPlanes.Raisons possibles : IMAQ Vision:  Type d'image non valide.
    L'erreur -1074396080 s'est produite à : IMAQ Array To Image. Raisons possibles : IMAQ Vision:  Type d'image non valide.
    L'erreur -1074396080 s'est produite à : IMAQ ReplaceColorPlane. Raisons possibles : IMAQ Vision:  Type d'image non valide.
    Comment résoudre ces problèmes ?
    Merci d'avance pour votre aide.
    PS : en PJ le sous VI Calcul qui est appelé dans le VI Traitement de l'image superposée pour créer un seuil.
    Attachments:
    Traitement image superposée.vi ‏68 KB
    calcul.vi ‏9 KB

    J'ai réussi à éliminer les erreurs citées précedemment.
    En fait j'ai utilisé le VI ColorImageToArray. Je n'ai plus décomposé les plans de l'image initiale.
    Le problème maintenant est le suivant : lorsque mes commandes de seuil prennent les valeurs telles que l'image finale soit égale à l'image intiale, j'obtient une image bleue au lieu de l'image initiale. Pourtant mes tableaux de pixels sont les mêmes en entrée et en sortie.
    Je vous joins mon VI en PJ pour une meilleure compréhension. (le principe de calcul est le même que le VI Calcul précédent).
    Pièces jointes :
    Traitement image superposée 2.vi ‏54 KB

  • Inserer une image dans un tableau sous Word (géré par Labview)

    Presque tout est dans le titre
    Je cherche, lors de la génération d'un document Word, à introduire une image dans un tableau.
    Je cherche désespéremment une façon de faire mais j'avoue que je tourne un peu en rond.
    Et encore mieux, est-il possible de fusionner des cases d'un tableau?
    Merci

    Bonjour Bysbobo,
    Je ne suis pas exactement sûr de comprendre ce que tu veux faire. Pourrais-tu illustrer avec des copies d'écran?
    Aussi, il existe un toolkit Géneration de Raports pour MS Office (Word,Excel), l'as-tu à ta disposition? Si oui ce sera beaucoup plus simple à mettre en place!
    NB : Je pense que tu devrais poster ton message sur le forum dédié à LabVIEW et non pas aux "Autres produits NI", tu aurais plus de réponses
    Bonne journée,
    M-Junior

  • Convertir une image en image IMAQ

    Bonjour,
    Je souhaite faire l'acquisition d'image issu d'une kinect de microsoft puis de comparer la 1 ere image acquise avec toutes celles qui suivront.
    Pour l'acquisition ça va mais la ou j'ai un problème c'est avec la fonction comparer 2 images. J'ai vu qu'il existe cette fonction dans vision and motion mais pour cella, il faut que mes images soient du type IMAQ.
    Donc j'aimerai savoir soit comment convertir mes images (issues d'un array U16 RGB) pour es comparer
    Soit savoir s'il y a un autre moyen de comparer 2 images pour savoir si un nouvel élément apparait sur l'image.
    merci de vos conseils
    ci joint une image pour vous montrer ou j'en suis.
    Pièces jointes :
    Image.png ‏19 KB

    J'ai réussi à éliminer les erreurs citées précedemment.
    En fait j'ai utilisé le VI ColorImageToArray. Je n'ai plus décomposé les plans de l'image initiale.
    Le problème maintenant est le suivant : lorsque mes commandes de seuil prennent les valeurs telles que l'image finale soit égale à l'image intiale, j'obtient une image bleue au lieu de l'image initiale. Pourtant mes tableaux de pixels sont les mêmes en entrée et en sortie.
    Je vous joins mon VI en PJ pour une meilleure compréhension. (le principe de calcul est le même que le VI Calcul précédent).
    Pièces jointes :
    Traitement image superposée 2.vi ‏54 KB

  • Converting RGB images (sRGB or Adobe RGB) to 709 color space.

    I'm trying to determine the correct way to convert RGB images (sRGB or Adobe RGB) to 709 color space.  I can't just use the "covert to profile" function to do this because it does not produce results that fall within the 16 to 235 range that 709 dictates.  I've read that you can simply use the "Levels" adjustment and change the output levels to 16 to 235.  While this would clearly compress the luminance to the correct range, I'm not entirely clear if the end result would be a proper conversion (i.e. if color and gamma, for example, would be technically correct.)
    I noticed that converting the profile to "HDTV (Rec. 709)" does alter the image, so I'm wondering what the result would be if I did both this AND used the levels control to compress the output range to 16 to 235.
    Thanks for any feedback on this.

    (1)
    http://en.wikipedia.org/wiki/Rec._709
    (2)
    http://en.wikipedia.org/wiki/Rec._601
    The transfer functions for Rec.709 (1) refer to the range [0..1] or for 8 bits per pixel [0...255].
    It seems that the clipping, black=16 and white=235 has to happen after the application of the
    transfer function. If this should be true, then we don't have a level compression but a level
    clipping at both ends, as already for Rec.601 (2), like here:
    The ICC-Profile HDTV(Rec.709) in Photoshop contains the primaries and the white point
    (both like that in sRGB) and the transfer functions for [0..1], coded by a LUT with high resolution,
    as found by Profile Inspector. There is no clipping.
    By the way, that`s the internal profile name, I don't know the file name of the profile.
    Softproofing, source in sRGB, target HDTV(Rec.709), without clipping:
    With numbers not preserved: no change of the appearance, as expected.
    With numbers preserved: shows the effect of different effective gammas. 
    Your questions are very clear and I'm not sure whether my comments help. The information
    in the internet is not convincing.
    Best regards --Gernot Hoffmann

  • Converting from duotone to CYMK or RGB destroys image

    Hello
    I am trying to create an example of how colours are made up so I am splitting channels, colorising and then printing the individual colour layers RGB and CYMK on to transparency and then layering them on a light box.
    I am able to convert to duo tone by doing the following things:
    converting the image to 8 bit
    splitting channels of the image, i have one rgb image and one cymk image.
    converting to duotone and colorising.
    if I save the cymk duotone images they just revert to a flat image of the target colour, all of the detail is lost see below
    If I try to change the image back to rgb or cymk, the image goes blocky, see below
    I need to import these images into inDesign to print them as I have a template that allows me to line each of the images up properly.
    why is it doing this?
    I am using creative cloud. latest version of photoshop on windows 7 64 bit.
    I am close to self harm just now as it makes no sense to me.
    any help at all would really be appreciated.
    Thanks

    Quite frankly I don’t understand the procedure you explain.
    Could you post screenshots to illustrate the steps?
    If I try to change the image back to rgb or cymk, the image goes blocky, see below
    That looks like a problem of its own.
    Does turning off »Use Graphics Processor« in the Performance Preferences and restarting Photoshop have any bearing on the issue?
    Otherwise you might want to run some general trouble-shooting routines:
    http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
    Though if it’s bad RAM …

  • How convert an image into its RGB value

    i want to find out how to convert an image files such as .gif or .jpg into its RGB value so that i can find out how much amount of a particular colors contain in the image.

    Try this:
    public int countColors(String filename) throws IOException {
    BufferedImage image = ImageIO.read(new FileInputStream(filename));
    Set colors = new HashSet();
    int height = image.getHeight();
    int width = image.getWidth();
    for (int x = 0; x < width; x++) {
    for (int y = 0; y < height; y++) {
    colors.add(new Integer(image.getRGB(x, y)));
    return colors.size();

  • Convert color images to black&white bitmaps

    Hi,
    I have black&white scans of public domain books (image format). I use an OCR software to convert them to indexable PDFs (image+text format). However, the OCRed PDFs are insanely big: a 27 MB scanned PDF leads to an indexable PDF of 728 MB! And unfortunately, my OCR software doesn't have output settings, so I have to find a way to compress the files using Adobe Acrobat 9 Pro.
    Using Advanced Options > Optimization does reduce the file size, but not significantly. The problem seems to be that my OCR software converts the black&white scans to color images, and encodes them as such inside the PDF. So I need a way to set the image modes back to black&white. I tried using the Advanced Options > Preflight dialog, and selecting "Convert to black&white". However, the resulting PDFs stay about the same size! It seems that "Convert to black&white" converts the images to grayscale, instead of to bitmap.
    Any help would be appreciated!

    I mentioned "bitmaps", because when I open the original PDF and right-click a random page and select "Modify image..." and open the image in Photoshop, the mode is set to "Bitmap mode": meaning 1-bit mode, containing either black or white pixels. However, when I do "Modify image..." for the OCRed PDF, the mode is set to "RGB Color Mode". I think this explains, in part, the huge size of the OCRed PDF.
    Maybe this table will make it more clear:
    Original PDF (Bitmap Mode, 132 dpi)
    Size: 27 MB
    OCRed PDF (RGB Color Mode, 300 dpi)
    Size: 728 MB
    Now, from the table above, it's clear that I have to reduce the image resolution. So, using the Acrobat's PDF optimizer, I tried the following settings:
    Optimized OCRed PDF: Try 1 (Downsample to 132 dpi, JPEG compression)
    Size: 733 MB
    Optimized OCRed PDF: Try 2 (Downsample to 132 dpi, ZIP compression)
    Size: 449 MB
    But 449 MB is still huge for a single book. And I don't want to reduce the resolution under 132 dpi, because I will loose quality. Clearly, if the original document is just 27 MB, I should be able to squeeze the OCRed document too. But I don't know how.

  • Segmenter une image en 4 couleurs sous Vision

    Bonjour,
    J'ai une image que j'aimerais segmenter en 4 couleurs : rouge, jaune, vert et bleu avec des seuillages en RGB pour avoir uniquement 4 couleurs sur ma photo.
    J'ai essayé avec Color Segmentation Setup et Class Labels mais malheureusement je n'arrive pas à obtenir un bon résultat.
    De plus, je souhaiterais remplir les trous noirs. Et pour finir, j'aimerais découper mon image en 10 zones par exemple (comme une cible idéalement) et lui appliquer la couleur moyenne sur chacune de ces zones (Zone 1 Rouge si plus de pixels Rouge que Jaune/Vert/Bleu)
    Comment pourrais-je faire ? Merci de votre aide.
    I have an image which I want in 4 colors : red, yellow, green and blue with thresholdes in RGB to have only 4 colors on my photo.
    I try with Color Segmentation Setup and Class Labels but I don't have a good result.
    Moreover, I would like to fill the black holes. And finally, I would cut my image in 10 areas for example and applicate a mean color on each one (red area if number red pixels are more important than blue, green and yellow pixels).
    Thanks for your help !
    Attachments:
    prof_1_1_060_0000_0180_00_result.jpg ‏619 KB

    Hello,
    I imagine that you looked before to the exemple in LabVIEW "Color segemntation "? http://zone.ni.com/reference/en-XX/help/372916J-01/nivisionconcepts/color_segmentation/
    Here is a link of a segmentation tool which could be helpful to you project : http://www.ni.com/example/28139/en/
    Regards,
    Maxime G. | Application Engineer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    LabVIEW Tour
    Journées Techniques dans 10 villes en France, du 4 au 20 novembre 2014

  • Converting an Image to a PlanarImage

    I have captured a frame from a video clip as an Image, and want to send this through a series of filters I have programmed.
    These filters use JAI and so take PlanarImages as inputs.
    I therefore wouldlike to convert an Image to a PlanarImage. Any suggests would be much appreciated.
    Also I before I send my Image through the filtering, I want to split the RGB image into 3 gray_scale images (one for each band). I am also struggling with this.
    I can get the A,R,G,B of the image easily enough, but I don't know how to transform these into seperate Images or PlanarImages.
    Cheers,
    Adam

    The following should do it
    Image src = BufferToImage.createImage(WHATEVER);
    RenderedOp result = JAI.create("AWTImage",src);RenderedOp is a PlanarImage and also implements RenderedImage.
    I would split the image into colour bands after you get it into the
    JAI domain. There is a simple operation to do it.
    public RenderedOp getBand(RenderdOp src, int band) {
      int[] bands = new int[1];
      bands[0] = band; // select band
      ParameterBlockJAI param = new ParamterBlockJAI("BandSelect");
      param.addSource(src);
      param.add("bandIndices", bands);
      return JAI.create("BandSelect",param);
    }matfud

  • PLEASE HELP!!! URGENT!!!! convert a jpg CMYK to jpg RGB

    Hello i need to convert to image jPG CMYK to jpg RGB..y try with this code:
    <code>
    RenderedOp image = JAI.create("fileload", "C:/Documents and Settings/rsornes/Desktop/Imagenes/fondo grde con simb_copei.jpg");
    JAI.create("filestore", convertCMYKtoRGB(image), "C:/Documents and Settings/rsornes/Desktop/001.jpg", "JPEG", null);
    .....>
    public static RenderedOp convertCMYKtoRGB(RenderedOp op) {
    try {
    // -- Convert RGBA to CMYK
    // -- because JAI reads CMYK as RGBA
    ICC_Profile cmyk_profile = ICC_Profile.getInstance("C:/Documents and Settings/rsornes/Desktop/jai/CMYK.pf");
    ICC_ColorSpace cmyk_icp = new ICC_ColorSpace(cmyk_profile);
    ColorModel cmyk_cm =
    RasterFactory.createComponentColorModel(op.getSampleModel().getDataType(),
    cmyk_icp,
    false,
    true,
    Transparency.OPAQUE);
    ImageLayout cmyk_il = new ImageLayout();
    cmyk_il.setColorModel(cmyk_cm);
    RenderingHints cmyk_hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, cmyk_il);
    ParameterBlockJAI pb = new ParameterBlockJAI("format");
    pb.addSource(op);
    pb.setParameter("datatype", op.getSampleModel().getDataType());
    op = JAI.create("format", pb, cmyk_hints);
    // -- Convert CMYK to RGB
    ColorSpace rgb_icp = ColorSpace.getInstance(ColorSpace.CS_sRGB );
    ColorModel rgb_cm =
    RasterFactory.createComponentColorModel(op.getSampleModel().getDataType(),
    rgb_icp,
    false,
    true,
    Transparency.OPAQUE);
    ImageLayout rgb_il = new ImageLayout();
    rgb_il.setSampleModel(rgb_cm.createCompatibleSampleModel(op.getWidth(),
    op.getHeight()));
    RenderingHints rgb_hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, rgb_il);
    pb = new ParameterBlockJAI("colorconvert");
    pb.addSource(op);
    pb.setParameter("colormodel", rgb_cm);
    op = JAI.create("colorconvert", pb, rgb_hints);
    } catch(Exception ex) {
    ex.printStackTrace();
    return op;
    </code>
    With this code work but de image jpg RGB result is not have the same color that of the original jpg CMYK...the image result (jpg RGB ) is very dark is almost black color....please i need urgen to resolve this
    if you kwon whta happends with my code thanks and if exist other code that you have...thanks
    thanks
    Rafael

    I don't know anything about this topic, but I've seen a lot of posts about it.
    http://www.google.com/search?q=convert+cmyk+site:forum.java.sun.com&sourceid=opera&num=0&ie=utf-8&oe=utf-8

  • HELP!!! URGENT!!!! convert a jpg CMYK to jpg RGB

    Hello i need to convert to image jPG CMYK to jpg RGB..y try with this code:
    <code>
    RenderedOp image = JAI.create("fileload", "C:/Documents and Settings/rsornes/Desktop/Imagenes/fondo grde con simb_copei.jpg");
    JAI.create("filestore", convertCMYKtoRGB(image), "C:/Documents and Settings/rsornes/Desktop/001.jpg", "JPEG", null);
    .....>
    public static RenderedOp convertCMYKtoRGB(RenderedOp op) {
    try {
    // -- Convert RGBA to CMYK
    // -- because JAI reads CMYK as RGBA
    ICC_Profile cmyk_profile = ICC_Profile.getInstance("C:/Documents and Settings/rsornes/Desktop/jai/CMYK.pf");
    ICC_ColorSpace cmyk_icp = new ICC_ColorSpace(cmyk_profile);
    ColorModel cmyk_cm =
    RasterFactory.createComponentColorModel(op.getSampleModel().getDataType(),
    cmyk_icp,
    false,
    true,
    Transparency.OPAQUE);
    ImageLayout cmyk_il = new ImageLayout();
    cmyk_il.setColorModel(cmyk_cm);
    RenderingHints cmyk_hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, cmyk_il);
    ParameterBlockJAI pb = new ParameterBlockJAI("format");
    pb.addSource(op);
    pb.setParameter("datatype", op.getSampleModel().getDataType());
    op = JAI.create("format", pb, cmyk_hints);
    // -- Convert CMYK to RGB
    ColorSpace rgb_icp = ColorSpace.getInstance(ColorSpace.CS_sRGB );
    ColorModel rgb_cm =
    RasterFactory.createComponentColorModel(op.getSampleModel().getDataType(),
    rgb_icp,
    false,
    true,
    Transparency.OPAQUE);
    ImageLayout rgb_il = new ImageLayout();
    rgb_il.setSampleModel(rgb_cm.createCompatibleSampleModel(op.getWidth(),
    op.getHeight()));
    RenderingHints rgb_hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, rgb_il);
    pb = new ParameterBlockJAI("colorconvert");
    pb.addSource(op);
    pb.setParameter("colormodel", rgb_cm);
    op = JAI.create("colorconvert", pb, rgb_hints);
    } catch(Exception ex) {
    ex.printStackTrace();
    return op;
    </code>
    With this code work but de image jpg RGB result is not have the same color that of the original jpg CMYK...the image result (jpg RGB ) is very dark is almost black color....please i need urgen to resolve this
    if you kwon whta happends with my code thanks and if exist other code that you have...thanks
    thanks
    Rafael

    thanks but I need to pass a CMYK to RGB

  • Unable to convert an image (.bmp) to PDF

    I have a written servlet that uses Adobe LiveCycle API to convert files to PDF. This works. I have a problem with one image (.BMP) for which the PDF conversion fails. I then tried converting the image to PDF using Adobe Acrobat. I see the following error:
    I am able to open the image file without any issues. Why does Acrobat think the file is corrupt? Is there a way to find out if an image is OK for PDF conversion, either manually or programmatically? Attaching the image file for reference.

    Hi ,
    For this issue, it looks like your SharePoint server(s) have been patched with MS13-052. 
    Please try to uninstall it and reboot your machine.
    Here is a similar post for you to take a look at:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/eec6e515-6a0a-42f2-963d-51fde59be9c4/sharepoint-server-20102-abnormal-issues-please-help
    Best Regards,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How can I convert an image created in Photoshop into a format that Java's ImageIO library will take?

    Hi all,
    I've been trying to write an image resize tool to use the Lancoz resample algorithm to resize images to a high standard in Java.  The library with the algorithm/filter in it is mortennobel's image scaling library and it takes a buffered image as an input and returns the resized image as desired.  However the trouble I’m having is that the ImageIO library in Java, a standard library, which converts images given to its read method to buffered images doesn't accept certain images created in Photoshop and so it throws an exception.  My library needs to be fully automated to process possible thousands of images at a time and so manually converting them by resaving them as JPEG's is really feasibly.  Is there some way I can convert these images from Adobes Exif format to standard JFIF format?  I've tried simple inserting the APP0 marker from a JFIF image in-between the SOI and APP1 marker but the ImageIO library still failed.
    The above image is a screenshot of the binary in hex of one of the images that cause an Invalid Format exception when passed to ImageIO.
    Any help you could offer me with this would be much appreciated.
    Kind regards and thank you,
    Alexei Blue
    Science Warehouse.
    NB: I previously posted this post in Developers but was told to post it in a Photoshop forum so apologies if this is the incorrect formum

    The image scaling library does have a BiCubicFilter in it so I'll experiment around with them and see what happens.  As for the imageIO library I think it accepts Exif image types, but still for some reason it just doesn't like Adobe Photoshop types.  Maybe its the colour map it doesn't like I just can't seem to work out what's wrong which is slightly frustrating but looking round to see if I can find an answer

Maybe you are looking for

  • IOH Temp x58 Pro-e Confusion

    Hi, I've read most of the threads on this topic, but my IOH temp is at 115 C where most others are at 70C. I'm not even overclocking or anything. I contacted tech support and they said it runs hot but the temp is fine. I don't really buy that. I aske

  • Help with simple program

    I am trying to get a program in my CS1 course and am having a hard time, help.. this is what the prof wants>>> Your employer is developing encryption software and wants you to write a Java program that will display all the prime numbers less than N,

  • Transfer capitalised Assets to Inventory items

    Hi, There is a Material which is procured as ASSET & has been capitalised & available in books as ASSET. Now, there is a requirement to transfer this ASSET in value & quantity from Books of assets to Inventory. The transfer may be in parts also. Can

  • My school's open Wi-Fi network...

    I'm concerned about the security of my school's wi-fi, seeing as it is open unsecured. Is there any possible way I could securely connect (with encryption) to an open network such as this? I've e-mailed the school's network administrator about this,

  • My Windows 8.1 laptop fails to connect to or reconize my HP Laser Jet 4250 over my network

    My printer fails to be reconized by my lap top. I think it is tied into a windowns update but it seems to be the only computer I have that is affected. Even when I have gotten the printer to be reconized it only last for a short time before it shows