简体   繁体   English

将JPEG图像转换为黑白图像

[英]Converting JPEG Images to Black and White

Is there any specific way to convert jpeg images to black and white using C? 有没有什么特定的方法可以使用C将jpeg图像转换为黑白图像? I converted a .bmp image to black and white using C by simply extracting the headers (which in .bmp file is 54 bytes in length) and converting the RGB to the respective gray level using the formula. 我通过简单地提取标题(在.bmp文件中长度为54个字节)并使用公式将RGB转换为相应的灰度级,使用C将.bmp图像转换为黑白图像。 But how to do that in jpeg file? 但是如何在jpeg文件中做到这一点?

如果你有能力链接库,我强烈推荐OpenCV来完成这项任务: http//opencv.willowgarage.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM