saving webcam image to bmp
In c/c++, I got a webcam image using v4l. I save it to a bmp file. Everything is fine except that there is a strip of data on the right of the image that doesn't make sense. The strip is thin (looks like 10pixels wide) and goes from top to bottom of the image. Am I doing anything wrong?
Heres how I do everything:
Setup webcam + errors etc...
get an image using the read(webcam_fd, buffer, width*height*3) for 24bit rgb image.
the I save by first saveing the bmp header stuff. Then the image 1byte at a time (changing the order of rgb properly).
Program closes everything and closes itself
Now I open the image and everything is fine (I'm upside down as expected) Except that strip there is a strip as I mentioned before. I have it print also the final settings which are
width 352, height 288, 24bit rgb.
But could I be missing or doing wrong. I might be needing to post some code. If this is not enough I'll post code after I comment it so it is more understandable, if noone asks I assume the above info is enough.
Thank you
|