0

In desperate need of help!
Can someone please show me how to simply display a pgm image in c++.
I have no prior experience in multimedia programming.
Thank you!

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by stereomatching
0

1 : use 3rd libraries, ex : openCV, CImg
2 : study the format of pgm and encode by yourself

example of openCV

#include<opencv2\core\core.hpp>
#include<opencv2\highgui\highgui.hpp>

int main()
{
  cv::Mat img = cv::imread("lena.pgm", -1);
  cv::imshow("output image", img);

  cv::waitKey();

  return 0;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.