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
Similar Messages
-
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 KBLabVIEW 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 -
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'avanceSi 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 -
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?
MerciBonjour 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 KBJ'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 -
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 KBHello,
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 -
comment changer la couleur de fond d'une image et garder la couleur de la personne en premier plan?
You will likely get better program help in a program forum
The Cloud forum is not about using individual programs
The Cloud forum is about the Cloud as a delivery & install process
If you will start at the Forums Index https://forums.adobe.com/welcome
You will be able to select a forum for the specific Adobe product(s) you use
Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll -
Imaqdx - Capture d'image couleur 12 bits et enregistrement
Bonjour,
J'utilise une caméra GigeVision couleur 12 bits, seulement, je n'arrive pas à sauvegarder le fichier (png, tif, ...) avec un codage de 12 ou 16 bits par couleur.
Actuellement, l'enregistrement en 8 bits par couleur ne pose aucun problème.
Quelqu'un à un solution ?
Cordialement,Bonjour,
Voici quelques pistes:
Dans LabVIEW/Vision, il n'y a pas de type de donnée numérique sur 12-bits et donc nous stockons ces données au format 16-bit.
(quatres bits sont donc inutilisés et restent à 0).
Les images acquises devraient s'afficher correctement dans LabVIEW.
Par contre, les choses sont un peu différentes lorsque les images sont sauvegardées sous la forme d'un fichier et lues avec un logiciel externe (non NI).
Le lien suivant explique ce problème et propose un VI pour décaler les bits afin d'y remédier et que l'image soit lisible dans un logiciel d'affichage d'image non NI.
Problems When Viewing Saved Images in Third Party Software
http://digital.ni.com/public.nsf/allkb/3C03FE2B63D1AFC586256C91006F50BF?OpenDocument
Le lien suivant pourra aussi vous être utile:
Pixel Intensities of a 16-bit Image from LabVIEW
http://digital.ni.com/public.nsf/allkb/6D4D5300ECE4AFD08625752700680770?OpenDocument
Il est possible que votre caméra code les images couleurs au format Bayer ( http://zone.ni.com/devzone/cda/tut/p/id/3903 ).
Donc je pense que vous choisissez "16-Bit Monochrome Bayer" comme format de sortie pour votre caméra.
Si vous avez du mal à visualiser l'image en couleur, vous pouvez aussi regarder le lien suivant:
Color Camera Shows Black and White Images in Measurement & Automation Explorer (MAX)
http://digital.ni.com/public.nsf/allkb/8AAAE9435D30CEB886256F80007A39AD?OpenDocument
Cordialement
Thomas B. | CLAD
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;}
>> Inscrivez-vous gratuitement aux Journées Techniques : de l'acquisition de données au contrôle/com... -
Arriere plan transparent pour une Image 3D?
Bonjour a tous,
Voila, j'aurais aimé savoir si il est possible de rendre transparent l'arrière plan d'une image 3D?
J'arrive bien a changer la couleur de l'arrière plan, mais la transparence ne fonctionne pas... y a t-il un autre moyen de rendre transaparent l'arriere plan.
En fait je vous explique ce que je souhaite réaliser, je voudrais afficher une piece qui a été réalisé en 3D donc je viens récupérer et lire le fichier STL de cette piece, ce qui me donne ma piece modélisé en 3D et me l'affiche dans mon indicateur 'Image 3D", ensuite je la fais tourner sur elle meme pour bien montrer à quoi ressemble la piece.
Pour ce VI, j'ai réalisé une face avant (voir piece jointe) qui change un peu de l'ordinaire et je voudrais intégrer cette image 3D sans que celle ci me casse le design de ma face avant. Je voudrais que ma piece 3d soit affiché comme si elle flottait dans le cadre que j'ai créé pour son emplacement. Avec l'image jointe ce sera bcp plus clair a comprendre je pense.
Si ce n'est pas possible avec l'afficheur "image 3D", y a t'il un autre moyen d'afficher ma piece avec un arriere plan transparent tout en gardant la rotation de celle ci? (afficher ma piece dans un graphe 3D? c possible?)
Merci d'avance pour votre aide
Pièces jointes :
image 3D.png 389 KBBonjour,
Malheureusement, je pense que ce n'est pas possible. SI tu lis l'aide sur la propriétés Background d'un objet 3d, tu peux changer la couleur et donner une valeur Alpha entre 0 et 1, mais cela ne rend pas le fond tranparent.
http://zone.ni.com/reference/en-XX/help/371361H-01/lvprop/scenewindow_clear_color/
Cordialement.
.mesLeft{float:left} .mesInfo{border-left:solid 1px #989898;font-size:x-small;color:#989898} .mesLogo{float:right;opacity:0.18} .mesLogo:hover{opacity:0.9}
Maxime R.
CLD - Certified LabVIEW Developer / Développeur LabVIEW Certifié
CLAD - Certified LabVIEW Associate Developer -
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] -
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 formumThe 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
-
Need to convert an image to .jpeg using Java !
Hello,
i am working in images now. i need to convert any image in the form of .jpeg using Java. in other words, i need to store an image in the form of .jpeg format. can any of u help me ! thanks in advance.
- KrishnaThere's also jimi, at http://java.sun.com/products/jimi/
You can do something like:
image = new BufferedImage (width, height, BufferedImage.TYPE_INT_RGB);
// create your image
String path = "/path/image.jpg";
Jimi.putImage(image, path);
[\code] -
How can I convert an Image ( or BufferedImage ) to Base64 format ?
Hi folks...
How can I convert an Image, or BufferedImage, to the Base64 format ?
The image that I want to convert, I get from the webCam connected to the computer...
Anyone can help me ?
Rodrigo KerkhoffI suggest you read this thread concerning this:
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=477461
Failing that, Google is your friend.
Good luck! -
How can i convert an image into gif file as jpeg by using com.sun.image.*
please help me to convert an image into gif format. i have used sun's impl com.sun.image.code.jpeg package to convert a buffered image into a jpeg file. is there any implementatioln available from sun to handle gif files.
Many. Try for instance google with 'java image encoders'. Go to the URL http://www.google.com/search?q=java+image+encoders and be amazed of the wonders of modern web search tools.
-
How to convert an Image to a byte array?
I want to make a screenshot and then convert the image to a byte of arrays so I can send it through a BufferedOutputStream.
try
robot = new Robot();
screenshot = robot.createScreenCapture(new Rectangle(500,500));
imageFile = new File("image.png");
ImageInputStream iis = ImageIO.createImageInputStream(screenshot);
byte[] data = new byte[1024];
byte[] tmp = new byte[0];
byte[] myArrayImage = new byte[0];
int len = 0;
int total = 0;
while((len = iis.read(data)) != -1 ) // LINE 52 --- EXCEPTION CATCHED HERE
total += len;
tmp = myArrayImage;
myArrayImage = new byte[total];
System.arraycopy(tmp,0,myArrayImage,0,tmp.length);
System.arraycopy(data,0,myArrayImage,tmp.length,len);
ios.close();I get this exception while running:
Exception in thread "Thread-0" java.lang.NullPointerException
at Server.run(Server.java:52)
at java.lang.Thread.run(Unknown Source)Fixed that. I got a new problem.
When I connect to my simple server application that reads the image file, converts it to an array of bytes and sends it back, the file is created on the client side and it containts data, but I am not able to open the image. I have checked that the image that the server is sending is working. So where is the problem?
The client application recieves the image as following:
public void run()
try
socket = new Socket("127.0.0.1", 2000);
BufferedOutputStream out_file = new BufferedOutputStream(new FileOutputStream("recieved_img.png"));
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
int inputLine;
while((inputLine = in.read()) != -1)
char c = (char)inputLine;
System.out.println(c);
out_file.write(inputLine);
catch(IOException err){ err.printStackTrace(); }
}And the server sends the image like this;
try
socket = server.accept();
in=new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new BufferedOutputStream(socket.getOutputStream());
out.write(25);
while((inputLine = in.readLine()) != null)
System.out.println(myArrayImage.length);
System.out.println(inputLine);
out.write(myArrayImage); // Send the array of bytes
}
Maybe you are looking for
-
My Ipod touch 4g won't turn on!!
Hi, This has happened before, while i was charging it, my iPod slowly turned white, and when i press both the home screen and the on/off button it turned off and went black. The problem is that i can't turn it back on, no matter what i do. It was so
-
How to save files in the filesystem and remember their position?
This is a fairly novice question. I'm writing a Java desktop application which executed from the jar (actually a jnlp) will first run a setup creating some files in a directory of user choice. When the application runs, it'll requires access to those
-
Can we open Delivery Tab in Purchase requisition as like in Purchase order
Hi, Generally we have Delivery tab in Purchase order under item level data, where one can schedule the total quantity to more than 1 time lines with different quantity. E.g in P.O line item quantity is 500, and i can maintain it in 3 lines under del
-
Hello, I wonder if somebody could help me? I'm using Garage Band after using Logic for years (yeah, I know). When I go to add an effect to my parameters box it doesn't do it. I am correctly following instructions. Is my system faulty? Thanks, Mel
-
Solaris 10 pannic under High TCP connect timeout rate
Today I find one of my server is rebooted.the messages is as follows: Dec 20 08:14:27 hosta unix: [ID 836849 kern.notice] Dec 20 08:14:27 hosta unix: [ID 836849 kern.notice] Dec 20 08:14:27 hosta ^Mpanic[cpu3]/thread=2a1009c3cc0: Dec 20 08:14:27 host