Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Pixel Write, Image Save and Application Build

Hello all. My apologies if this has already been discussed but my searches did little to point me in the right direction.

 

I am using LabVIEW 2011 SP1. Also, I am using the latest VDM Evaluation package. I have a few issues I need assitance with:

 

1: I am trying to manipulate pixel values of a 32-bit color image (changing them to a specific color) and saving that newly edited image. After setting up my code i successfully change pixel values and display the result on the front panel. In this case i chose to write a vertical black bar down the middle of the image. However, when i attempt to save the edited image using IMAQ Write File 2 only the original image is saved without the black bar.

 

Could it be because I am using the evaluation vision module?

 

2: I attempted to build an application from this so I could run it on another computer without LabVIEW. I get a build error however, indicating that I am using the eval VDM and therefore cannot build an executable. Does anyone know of a solution to this other than purchasing the module? Is it possible to achieve what I am trying without using VIs from the VDM?

 

I have attached an image of my block diagram along with the resulting image.

 

Thanks in advance.

Download All
0 Kudos
Message 1 of 9
(5,058 Views)

Update:

 

I tried relocating the IMAQ Write File 2 to the inner for loop. It begins to write the result in the newly saved file but I suspect it goes through too many iterations within the loop and crashes. I get the result that is shown in the attachment.

 

An additional question: When I run the program both Image and Image Out displays show the processed image. How can I make Image Out show the original image and Image show the processed image?

 

Thanks again. 

Download All
0 Kudos
Message 2 of 9
(5,057 Views)
What you are missing is dataflow first.
-In your first code,you are saving the image and then entering the for loop.
-Try taking the Image Out terminal of the set color pixel value to the end of for loop and make it as shift register.
-If you keep IMAQ Write File2 inside inner loop, obviously it will run for number of iterations the for loop has been set.
-So,you need to save/write the image at the end of outermost for loop.
-If you want to have both original image and processed image make extra copy of the image and then process it.
Thanks
uday
Message 3 of 9
(5,007 Views)

Thanks for your reply uday. I accidentally posted my problem from my coworkers account (hence the different username today).

 

Why is it that when I take the image out line to the end of the inner for loop it turns the data into a 1-D array and subsequently a 2-D array coming out of the outer for loop? Now i cannot display the image with a simple image display vi.

 

Any pointers on what I am missing here?

 

Much appreciated,

 

Wayne

0 Kudos
Message 4 of 9
(4,989 Views)

Never mind, the loop tunnel had indexing enabled by default. Problem solved. Thanks again.

0 Kudos
Message 5 of 9
(4,984 Views)
Problem fixed? If so, please make sure to select the proper reply as answer.
Thanks
uday
0 Kudos
Message 6 of 9
(4,957 Views)

Uday,

 

Yes, the problem of saving the newly edited image was solved after writing the file after the outer for loop.

 

Regarding my other issue, I have not figured out how to build an application from my code, which includes VIs from the VDM module since my VDM is in evaluation (getting errors and build failures). Do you know of any alternative ways to do pixel writes on an image without the VDM VIs?

 

Thanks again.

 

0 Kudos
Message 7 of 9
(4,947 Views)

Hello,

a digital image is just a numerical representation of the object,scene,etc... It is simply a matrix containing the intensity values. And the VDM is just a library that does the image read,process and display part.

You can also process images without the VDM in Labview. Take a look for example at read/write bmp/jpeg file.vi. Operate directly on the image data.

Best regards,K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 8 of 9
(4,941 Views)

Thank you K, I have been researching that path.

0 Kudos
Message 9 of 9
(4,930 Views)