![]() |
|
#1
|
|||
|
|||
how to do basic image processing using MFChello, I am doing a project about medical image processing now. I have implemented Active Shape Model (ASM) using MatLab, but my supervisor wants me to transfer the codes into C++. The difficulties are image processing and matrix computation. How can I load an BMP image and choose one color channel to make it into gray-level image? And I also need to know the gray-level value for each pixel. Is it possible to do it? Or any library you introduce?
Thanks a lot!!! |
|
#2
|
|||
|
|||
|
hey..
i used VFW library (Video for Windows) in my project. there are heaps of sample code out there using VFW. i suggest u take a look at sample vfw c++ code so u basically know what u need to do to connect to driver, set-up the device.. create bitmap etc. basically a bitmap consist of pixels (say 320 by 240) and each pixel has 3 colour values - blue green red. These RGB values are put together in a string to form a bitmap. so say you have got an image called "picture". then picture[0] is the blue colour value of first pixel picture[1] is the green colour value of first pixel picture[2] is the red colour value of first pixel picture[3] is the blue colour value of second pixel and so forth. so a 320 by 240 bitmap starts from picture[0] and ends at picture[320*240*3 - 1]. if you want to create a grayscale picture, u'd probably need to go through each pixel, average the rgb values and set all 3 values to the average. ie picture[0] = (picture[0] + picture [1] + picture[3]) / 3; picture[1] = (picture[0] + picture [1] + picture[3]) / 3; picture[2] = (picture[0] + picture [1] + picture[3]) / 3; picture[3] = (picture[3] + picture [4] + picture[5]) / 3; picture[4] = (picture[3] + picture [4] + picture[5]) / 3; picture[5] = (picture[3] + picture [4] + picture[5]) / 3; and the same for every other pixel.. go on google and search for Video for Windows, Video Capture sample codes in vc++. There should be quite a few. I had heaps of trouble learning vfw.. even now. vfw commands are on the microsoft msdn website.. so that sorta helps a bit. also try searching TRIPOD image processing (uses logitech commands (?) not vfw but useful to see how the author deals with pixels) and Lego Mindstorm Video Capture (this one searches for red objects in a bitmap). these probably give u an idea on how to manipulate pixels. hope what i said was relevant somewhat.. ahaha.. |
|
#3
|
|||
|
|||
|
Hi, Surgio, thanks so much for your reply...
especially the details you give me... u so nice...I will tell you how I go with it... Thanks a again... |
|
#4
|
|||
|
|||
|
haha.. no worries.
|
|
#5
|
|||
|
|||
Here you areHi, i think u shoud visit this websitehttp://carol.wins.uva.nl/~ghebreab/projects.html
most probably u could find ur things there. |
|
#6
|
|||
|
|||
Re: how to do basic image processing using MFCHi Yuhui,
As seen from your first email that you have been implemented ASM in matlab. I am currently looking into research on ASM as well. And still confuse on the implementation. Would you mind sharing your idea on ASM? As I am targetting on using it to track person under an open environment, typically the video is of 320x240 size, which means that the person is quite small. Thank you Wilson |
Recent GIDBlog
Observations of Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Writing image to folder | misunderstood | MySQL / PHP Forum | 4 | 17-Jun-2004 07:18 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 15:13 |
| Google Adsense introduces targetted image ads | Div | Advertising & Affiliates Forum | 5 | 23-May-2004 10:59 |
| Problem with image | eRIC | MySQL / PHP Forum | 1 | 08-Apr-2004 06:22 |
| professional quality image generator | jrobbio | Graphics Forum | 0 | 27-May-2003 04:45 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The