Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

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
 
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

**broken link removed**
 

you can use matlab
Code:
i = imread('trees.tif');   %load image
x=im2bw(i,100);          %convert to binary

you also can make a GUI for your program, if you want to use visual c++
you can convert the matlab file to c using matlab compiler
see
**broken link removed**
www.khwarzimic.org/activities/matlab_2.html
i hope this would help
 

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
 

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?
 

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.
 

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?
 

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
 

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.
 

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 :(
 

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

Back
Top