Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

How to convert Picture to 1 & 0 Bitmap ?

Status
Not open for further replies.

zkai2000

Member level 5
Joined
Jul 25, 2004
Messages
94
Helped
0
Reputation
0
Reaction score
2
Trophy points
1,286
Activity points
907
Does anyone know how to convert Scanned Pinture into 1 & 0 Bitmap using Visual C++ ?
thanks so much!!
im stuck half way in my project
 

eltonjohn

Advanced Member level 4
Joined
Feb 22, 2002
Messages
1,435
Helped
64
Reputation
126
Reaction score
28
Trophy points
1,328
Activity points
16,328
you need a thresholding function .. There are a lot of these in image processing tools look at CVIPtools .. whay you do is you select a thresholding value .. all pixels above it will be affected 0 an all pixels under it will be affected 1 .The threshloding fuction can also be selected
by another funcion called histogram . All these is not very complicated but is better if you study a little bit those tools .Beacuse when you transfer color to binary images .. well you need to do some ajusting in order to get the gest of it . Otherwise you will loose some image quality

http://www.ee.siue.edu/CVIPtools/
 

eng.

Junior Member level 3
Joined
Jul 15, 2004
Messages
31
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
243

fireplus

Full Member level 3
Joined
Oct 31, 2003
Messages
182
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
1,633
hi;

see this link :


h**p://www.compsys1.com/workbench/On_top_of_the_Bench/KS0108/ks0108_controller.htm

bye


Fire in the Wire :sm2:l
 

zkai2000

Member level 5
Joined
Jul 25, 2004
Messages
94
Helped
0
Reputation
0
Reaction score
2
Trophy points
1,286
Activity points
907
thank you so much guys...i'll go study abit first as i do not really understand the "advices"... :oops:

by the way, i'm doing a fingerprint recognition system, so colors don't make any difference i suppose? the scanned fingerprint shud be black and white rite?
 

Pinczakko

Full Member level 2
Joined
Jul 29, 2004
Messages
138
Helped
13
Reputation
26
Reaction score
0
Trophy points
1,296
Location
Taka Bonerate National Park, Indonesia
Activity points
1,608
since you are using VC++, it's easier if the scanned file is saved as bitmap (*.bmp) and then working on the bitmap file contents directly. You can look at Charles Petzold's "Programming Windows 5th Edition" in the image related chapter for the exact bitmap file format. As a preliminary info, IIRC windows bitmap store each RGB value in DWORD (32-bits) boundary for every scan line in the corresponding file, as per windows bitmap file version 3.0 that's in use in most of bitmap related software today.
 

zkai2000

Member level 5
Joined
Jul 25, 2004
Messages
94
Helped
0
Reputation
0
Reaction score
2
Trophy points
1,286
Activity points
907
but i cant actually save it manually as bmp file coz im doing a fingerprint recognition system. If it can be easily saved as bmp automatically then my fingerprint features extraction part is solved...issit possible?
 

zkai2000

Member level 5
Joined
Jul 25, 2004
Messages
94
Helped
0
Reputation
0
Reaction score
2
Trophy points
1,286
Activity points
907
by the way, it's a real-time system...so i cant convert files from matlab or something into the file type i want manually...all i can do is just a "click"..and pops --> the recognition results
 

mami_hacky

Full Member level 6
Joined
Mar 28, 2002
Messages
337
Helped
18
Reputation
36
Reaction score
11
Trophy points
1,298
Location
Some where
Activity points
3,428
I'm agree with eng.
Write a simple matlab program,
imread
rgb2gray
im2bw
imwrite

compile it ot C. link it to your VC++ code. add needed DLLs.
if needed do edge detection or what ever you like.
 

Pinczakko

Full Member level 2
Joined
Jul 29, 2004
Messages
138
Helped
13
Reputation
26
Reaction score
0
Trophy points
1,296
Location
Taka Bonerate National Park, Indonesia
Activity points
1,608
zkai2000 said:
but i cant actually save it manually as bmp file coz im doing a fingerprint recognition system. If it can be easily saved as bmp automatically then my fingerprint features extraction part is solved...issit possible?
of course it is possible, everytime you are doing a fingerprint check there must be a "signal", to indicate that the fingerprint acquisition is done, right? during the acquisition process you can save the 1 & 0 data you get from the sensor into somekind of buffer in the "image acquisition system", then using the "signal" I mentioned before, save the buffer into a *.BMP file (perhaps by first transferring the raw data from the "image acquisition system" to the PC as needed). AFAIK, the windows 3.0 BMP file format is very much stright forward, you only need to add a couple of header addition. Some hints on the BMP file format (read Charles Petzold's -- Programming Windows 5th Edition book for detailed explanation) :
1. The header contains some static data for format recognition. This should be easy to handle, you can make a static array to handle it.
2. The header also contains height and weight information about the BMP image. Since I assume you are getting a "fixed" size image from the fingerprint scanner, you can make this a static array too, or possibly a "setting" that can be customized to the fingerprint scanner you are using.

PS: sorry if the clue is slightly misleading, since you aren't describing the whole system design :(
 

zkai2000

Member level 5
Joined
Jul 25, 2004
Messages
94
Helped
0
Reputation
0
Reaction score
2
Trophy points
1,286
Activity points
907
hmm...im not really good in Matlab yet... it's not easy for me to absorb and handle those... :oops: ..keke

thanks for ur explanations,i think im getting something from them..well,i think i'll just program in a way that the picture is saved as bitmap,then place it in arrays...btw, i might face another problem too, can normal 600dpi scanner be used in my system?coz im afraid when the fingerprints are place in different orientations...well....the whole arrays will be different...will the scanner affect the algorithms used in the program?
(i heard from my seniors,normal scanners can only recognize fingerprints scanned on the same place,change of orientations could cause the recognition fail.)

it's alrite if u guys don read this...it's abit outta topic though...haha.. :D "
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top