LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a vi program to create a png file of a ROI from an image file?

Hi every Labview master, I have a very simple question. I tried to create a PNG file (pattern1.png)of a ROI which was selected from a sample file (image0.jpg) on a pop-up window. Because I modified a similar vi example from NI website, it always created an extracted (reduced) file. However, I don't want an extracted (reduced) pattern file to do pattern matching. Could anybody help me get the intact and complete pattern file just as what I selected from the pop-up window? Thank you very much.

The sample image file (image0.jpg) and vi program are attached.
Download All
0 Kudos
Message 1 of 3
(2,849 Views)
Here is your code back. I flattened the logic out a bit by removing all the unnecessary case structures and sequences (all multi-frame sequences are unnecessary). I also connected up the error clusters and brought it out to a front panel indicator so you can tell if an error was being generated--which there was...

I can see where you are bringing in the image to process, but the code apparently also needs a template image and I don't see you loading in the template. The error message is that the template image is too small.

Always, always, always connect-up the error clusters. Most high-level routines (like IMAQ) will tell you when a problem occurs if you let them.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(2,849 Views)
Thank you, Mike.

I rewrote the program as ROIget.vi, but I still have no idea to get the complete (not extracted) ROI file just as the ROI image selected from the pop-up image window. The total size of the ROI pattern file (please see the attachment) created by IMAQ Vision Builder is about 25KB, but the ROI file produced by my ROIget.vi program is only "3KB" which can't be used to do the pattern matching work. I tried "IMAQ Expand" icon to replace the "IMAQ Extract" icon, but it still didn't work. Could you help me solve the problem? Thank you.
Download All
0 Kudos
Message 3 of 3
(2,849 Views)