LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting from Picture to IMAQ Image to AVI

Solved!
Go to solution

Hello!   I have a program that successfully makes a drawing within a while loop (each loop updates/changes something on the drawing).  I'm trying to get the process of drawing the image saved as an AVI, so that the result is a movie file of the image as it is being drawn.   The drawing process is working, but i'm having trouble getting the images to save as an AVI.   The progress i currently have results in an AVI, but the colors are wrong and the resolution is not at all close to the original image.  I think i've got a color/pixel mapping issue, but i'm not sure.  Who can help me with this?

 

I've attached images of the software and images of the "Original Picture" (<--this looks the way i want it) and an image just before it is saved as an AVI ("Image" - the images in the video file look just like this, but they are moving, of course).   The code that saves the AVI is off-screen to the right.  This code seems to work..meaning is correctly saves the series of images to an AVI...its just that the images it saves are the wrong-color/low-resolution ones. Labview Program.JPGLabview Images.JPG

 

Please help if you can.

 

 

0 Kudos
Message 1 of 6
(2,327 Views)

I'm sure that there are several of us with experience, but we really can't help if you "hide" the details from us by showing only a small set of "pictures" of your LabVIEW code.  Please attach a VI (or VIs) that will allow us to do the following:

  • Generate an Original Picture.
  • Generate an Image, to be saved to an AVI.
  • Generate an AVI.

This will enable us to see (and understand) the pixel dimensions you are using, the colors used in the images, and have a better understanding of what happens when you run your code.

 

Bob Schor

0 Kudos
Message 2 of 6
(2,311 Views)

HI Bob!   Sorry, i just realized that the previous image was a bit fuzzy.  The line with the  blue arrow (in the image uploaded with this message) is from a DrawPoint vi that generates a drawing that is 500x500 (pixels).   <-- this part works great!   This code is what generates the left image (white background with red spirals).     

 

The other 'corrupted' image (blue background) is the output from the IMAQArrayToColorImage vi on the bottom right.   this 'corrupted' image is what is written to the AVI file.   The AVIWrite process seems to be working correctly (meaning, even though the image that is feeding is 'corrupted' the writing process is writing that image to the AVI file.      My question is what is the image becoming corrupted?   My guess is that there is something wrong with my process to convert from Drawing ---> IMAQ.  

 

I dont have a way to upload the video, but its an AVI that shows the animation of the 'corrupted' image (blue background) instead of an animation of the correct (white background) image.

 

Labview Program.JPG

0 Kudos
Message 3 of 6
(2,295 Views)
Solution
Accepted by topic author jfox1000

Since you are trying to save a RGB image, you have to set depth of 32 bits in picture to pixmap.vi and use 24 bit pix map output in unflatten pixmap vi and  thats why you can see there is a coersion dot in array to color image vi.


CLD Using LabVIEW since 2013
Message 4 of 6
(2,282 Views)

@jfox1000 wrote:

HI Bob!   Sorry, i just realized that the previous image was a bit fuzzy.  The line with the  blue arrow (in the image uploaded with this message) is from a DrawPoint vi that generates a drawing that is 500x500 (pixels).   <-- this part works great!   This code is what generates the left image (white background with red spirals).     

 

The other 'corrupted' image (blue background) is the output from the IMAQArrayToColorImage vi on the bottom right.   this 'corrupted' image is what is written to the AVI file.   The AVIWrite process seems to be working correctly (meaning, even though the image that is feeding is 'corrupted' the writing process is writing that image to the AVI file.      My question is what is the image becoming corrupted?   My guess is that there is something wrong with my process to convert from Drawing ---> IMAQ.  

 

I dont have a way to upload the video, but its an AVI that shows the animation of the 'corrupted' image (blue background) instead of an animation of the correct (white background) image.

Fine.  Forget about the video.  Create a VI that takes a 500 x 500 Image (that you supply) and tries to create an IMAQdx Image suitable for writing to an AVI file.  We still don't have the code you are trying to use, so cannot test it and help you learn how to do this correctly (and, maybe, learn better how to do this ourselves ...).

 

Please attach workable LabVIEW code (as one or more .VI files) that we can examine, edit, and execute.

 

Bob Schor

0 Kudos
Message 5 of 6
(2,262 Views)

Hello Kartiknattar!   You're right!  thank you for the lesson!   That worked!   Can Labview save any other format of video besides AVI?

 

  Thanks again for your insight!   Jim

0 Kudos
Message 6 of 6
(2,243 Views)