LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a set of 100000+ bmp file images

Hi,
Greetings 🙂
I have to read a folder that consists of BMP  image file which is monochromatic , do a preprossing depending upon a condition .
If the condition is fulfilled , only that image is saved in a new folder.

I have uploaded my vi and a sample image in the post.
I am facing error in reading the bmp file from the location. 
Kindly let me know where am I wrong? and suitable solution to fix this bug 😞

I am using vision Acquision and Labview version 15I was unable to upload bmp file hence took a screenshot .I was unable to upload bmp file hence took a screenshot .Attached is the properties detail of the bmp fileAttached is the properties detail of the bmp file

Thanks and  Best,
Lipika

0 Kudos
Message 1 of 11
(3,815 Views)

What error Message do you get?

I get none, once I correct the image file path. In my test, I had to include the extension.



Remember Cunningham's Law
0 Kudos
Message 2 of 11
(3,786 Views)

Hi,

I do not get any  error explicitly.
 However, I do not get the output as expected! 😞

The aim is to read a folder of bmp files one after the other and depending on the condition either save it or do not save .


When I read the file ,while highlighting the wire diagram I see the unexpected error of reading the bmp file .
I have attached the error in the post.

I included the extension too but no much help it seems 😞

Thanks a lot in advance! 


0 Kudos
Message 3 of 11
(3,725 Views)
The error says that the file not found! Did you cross check?
0 Kudos
Message 4 of 11
(3,715 Views)

I confirm it's an erroneous path, i get the same behaviour.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 11
(3,704 Views)

Hi,
Thanks for your reply. 
In that case  changing the whole path file didn't help much.
How do you suggest that would help me take the whole folder  of the images  to process the loop?

Thanks 
Lipika

0 Kudos
Message 6 of 11
(3,682 Views)

Snippet for idea.

Read folder of bmp.png

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 11
(3,671 Views)

Hi Lipika,

Are you trying to write your acquired image from camera into a bmp file through some other program? and in parallel you want to check for the intensity of the image? If this is the case, You need to have a synchronization mechanism between your writing and reading part! because sometimes when you try to read the bmp, the complete content will not be written to the file. That's why you get the file error!

If this is not your case, then try Yamaeda's solution

 

I hope this helps!Smiley Happy

-- Achuthan

  

0 Kudos
Message 8 of 11
(3,667 Views)

I looked at your code (horrors!  have you ever heard about sub-VIs?  And trying to keep your wires straight (and horizontal)?  Actually, I've seen much worse, it's just a bit confusing to figure out what is going on).

 

think I understand what you are trying to do, which is very close to what you described in your Post -- you've got a whole lot of Image files (.bmp), and want to define a sub-set of those files for further processing.  You are using a Producer/Consumer design, where the Producer reads (what looks like the file C:\test27.1 every time, but that's probably not what you mean), gets a binary image out, does some tests on it, and puts the Image on a Queue to send to the Consumer Loop (where more work gets done).

 

Question -- why pass the Image?  Why not open a text file and whenever you determine that a particular File meets your criteria, save the File Name in the text file?  Very simple, very fast, no need for memory considerations, certainly it would be difficult to find anything faster.  Of course, now you have to write a second program that reads your Text file and does whatever processing you need to do on the Images in those Files that you already know meet your criteria.  Of course, you can combine the "Filter BMP Files" and "Process Selected BMP Files" in a Producer/Consumer Design, but don't bother passing Images (very large, will start consuming memory), pass instead the File Path (very small, only need one IMAQ Buffer, minimal memory requirement, much faster, much simpler to understand and debug).

 

Bob "Simple-Minded" Schor

Message 9 of 11
(3,649 Views)

Hi Achuthan,
 You are right!
1.I have saved the images captured through camera in a folder.
2. I am trying to access the same folder to compare intensities and then do a set of condition test.

If the test is passed , new images are saved or else ignored. 


0 Kudos
Message 10 of 11
(3,629 Views)