I am aware my question is similar to:
OpenCV 2.0 C++ API using imshow: returns unhandled exception and "bad-flag"
Though I hv tried all the suggested and verified solutions from this page as well as other related pages, I still face the same problem of corrupted window names. Here is my code:
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "cxcore.h"
#include <math.h>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include"ip.h"
#include"histogram.h"
#include <opencv2\highgui\highgui.hpp>
#include "opencv2/core/core.hpp"
using namespace cv;
using namespace std;
void main()
{
IplImage *img01 = cvLoadImage("E:\liberty.jpg",CV_LOAD_IMAGE_GRAYSCALE);
cv::Mat img1(img01, false);
cv::namedWindow("Image 1");
cv::imshow("Image 1",img1);
cv::waitKey(0);
cv::destroyWindow("Image 1");
}
What should i do?Please help.