473,507 Members | 11,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to read pixel values of a Bitmap Image.

Hi everyone, I want to read the pixel values of 2 similar images in
bitmap format like 2 continuous frame of a video for calculating the
median. But i dont know how to read the pixel values of bitmap
image.so please help me in doing this in c++.
thank you.

Jan 29 '07 #1
2 9600
ajay_itbhu wrote:
Hi everyone, I want to read the pixel values of 2 similar images in
bitmap format like 2 continuous frame of a video for calculating the
median. But i dont know how to read the pixel values of bitmap
image.so please help me in doing this in c++.
"bitmap format", "video", "pixel values", are all undefined in C++.
You need to ask this in a newsgroup where "bitmap" is on topic, most
likely the newsgroup for your operating system.

Generally, reading a pixel in a pixmap involves opening a file,
reading its header, figuring out the layout of the file depending
on the format, then getting to the content part (image), reading the
(potentially encoded, packed) scan lines, then, using the offsets
calculated from the header information, extracting the color and/or
other information from the (decoded, unpacked) lines. All this
has nothing to do with the language itself.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jan 29 '07 #2
ajay_itbhu wrote:
Hi everyone, I want to read the pixel values of 2 similar images in
bitmap format like 2 continuous frame of a video for calculating the
median. But i dont know how to read the pixel values of bitmap
image.so please help me in doing this in c++.
thank you.
// #include <iostream<fstream<vector>
{ // main or function
std::ifstream Ping("Some.png",
std::ios_base::in|std::ios_base::binary );
if( not Ping.is_open() ){
std::cout<<"\n ifstream FAILED"<<std::endl;
// return or exit(EXIT_FAILURE) here
}

std::vector<unsigned charImage;

while( Ping.peek() != EOF ){
Image.push_back( Ping.get() );
} // while()

// use 'Image' here, or pass it somewhere.
} // main or function end

If you are asking about the bitmap format, you are in the wrong NG (it's
OT here). There are many libraries that handle the graphic formats, just
use your favorite searh engine to find them (Google).

I don't know if programmersheaven is still up, but, there was a ton of
links there for graphics.

Bob R
POVrookie
Jan 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
10909
by: Anirudh Saria | last post by:
Does anyone know how to read in a grayscale bitmap image in Visual C++ and store the pixel values in an array ? Thanks, Anirudh
1
5033
by: Sinora | last post by:
I am trying to cahnge pixel value of a grayscale image using Bitmap object . Each pixel is consists of 8 bits. Bitmap bigim(720,480,PixelFormat8bppIndexed) ( I tried 8 instead...
1
7121
by: jty202 | last post by:
I know alot of people have the problem with indexed pixel format. I hope someone can show me the solution to this.I am have problem with graphics with the following code giving the error: "A...
1
2032
by: Ajay | last post by:
Hello Guys, Iam working on a zoom in and out tool and here is the code iam using for it //Method for zooming in Bitmap bmpSource=new Bitmap(ImgBox.Image); Bitmap bmpZoomed=new...
7
3584
by: TomHL | last post by:
hello, - I have a Bitmap Object named: bmp1 - I already have the numerical values of:red,blue and green colors + I have the X and Y cordinates. How do I set the pixel value via safe code on...
2
3450
by: fripper | last post by:
I want to generate a graphic in a picture box control where the color of each pixel is determined by particular values calculated for each pixel. These values are manipulated in such a way that I...
2
2015
by: fripper | last post by:
I am using VB 2005 and want to generate a graphic in a picture box control where the color of each pixel is determined by particular values calculated for each pixel. These values are manipulated...
4
2866
by: Martijn Mulder | last post by:
When I zoom in on an image, GDI+ automatically smoothens the edges between the pixels. I am looking for a way to see the individual pixels as squares in the enlarged image, like in MSPaint. I...
1
3227
by: ofiras | last post by:
In bitmap, how can I find the nearest pixel (pixel 1) to a specific pixel (pixel 2) that has different color from pixel 2? Or how can I find a pixel in a specific distance from pixel 2 (like a...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.