Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

am not getting "histogram plot of image".this code give only "image" in output.give solution

#include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc.hpp"

include <iostream>

include <stdio.h>

using namespace cv; using namespace std;

/* @function main */ int main(int argc, char* argv) { Mat src, dst; char* source_window = "Source image"; char* equalized_window = "Equalized Image"; /// Load image src = imread("F:\abc.jpg", 1);

if (!src.data)
{
    cout << "Usage: ./Histogram_Demo <F:\\abc.jpg>" << endl;
    return -1;
}

/// Convert to grayscale
cvtColor(src, src, CV_BGR2GRAY);
/// Apply Histogram Equalization
equalizeHist(src, dst);

/// Display results
namedWindow(source_window, CV_WINDOW_AUTOSIZE);
namedWindow(equalized_window, CV_WINDOW_AUTOSIZE);

imshow(source_window, src);
imshow(equalized_![image description](http://)window, dst);

/// Wait until user exits the program
waitKey(0);

return 0;

}

I am not getting a "histogram plot of image".this image". This code give gives only "image" in output.give solutionoutput. Give me the solution.

#include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc.hpp"

include <iostream>

include <stdio.h>

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace cv;
using namespace std;

/* std; /** @function main */ int main(int argc, char* char** argv) { Mat src, dst; char* source_window = "Source image"; char* equalized_window = "Equalized Image"; /// Load image src = imread("F:\abc.jpg", 1);

imread("F:\\abc.jpg", 1);

    if (!src.data)
 {
     cout << "Usage: ./Histogram_Demo <F:\\abc.jpg>" << endl;
     return -1;
 }

 /// Convert to grayscale
 cvtColor(src, src, CV_BGR2GRAY);
 /// Apply Histogram Equalization
 equalizeHist(src, dst);

 /// Display results
 namedWindow(source_window, CV_WINDOW_AUTOSIZE);
 namedWindow(equalized_window, CV_WINDOW_AUTOSIZE);

 imshow(source_window, src);
 imshow(equalized_![image description](http://)window, dst);

 /// Wait until user exits the program
 waitKey(0);

 return 0;
}

}

I am not getting a "histogram plot of image". This code gives only "image" in output. Give me the solution.

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>

using namespace cv;
using namespace std;

/**  @function main */
int main(int argc, char** argv)
{
    Mat src, dst;
    char* source_window = "Source image";
    char* equalized_window = "Equalized Image";
    /// Load image
    src = imread("F:\\abc.jpg", 1);

    if (!src.data)
    {
        cout << "Usage: ./Histogram_Demo <F:\\abc.jpg>" << endl;
        return -1;
    }

    /// Convert to grayscale
    cvtColor(src, src, CV_BGR2GRAY);
    /// Apply Histogram Equalization
    equalizeHist(src, dst);

    /// Display results
    namedWindow(source_window, CV_WINDOW_AUTOSIZE);
    namedWindow(equalized_window, CV_WINDOW_AUTOSIZE);

    imshow(source_window, src);
    imshow(equalized_![image description](http://)window, dst);

    /// Wait until user exits the program
    waitKey(0);

    return 0;
}