Closed GoogleCodeExporter closed 9 years ago
Did you try cvEqualizeHist( img, out ) instead?
Original comment by samuel.a...@gmail.com
on 4 Oct 2010 at 11:32
Yes, but even wors; it compiles, but it crashes on Runtime..
How about the Grayscale conversion problem?
Original comment by pendieee...@hotmail.com
on 4 Oct 2010 at 12:04
I made some changes to that recently to fix issue #24. Can you try with this
test package instead and see what happens? thanks
http://www.ok.ctrl.titech.ac.jp/~saudet/javacv.jar
Original comment by samuel.a...@gmail.com
on 4 Oct 2010 at 1:12
Unfortunately it's still the same..
Original comment by pendieee...@hotmail.com
on 4 Oct 2010 at 2:36
If you are trying to convert a color image to a gray image, you should used the
cvCvtColor() function, as exemplified in the README.txt file:
// Let's try to detect some faces! but we need a grayscale image...
cvCvtColor(grabbedImage, grayImage, CV_BGR2GRAY);
Does the cvCvtColor() function work or not?
Original comment by samuel.a...@gmail.com
on 5 Oct 2010 at 11:43
That works perfect for grayscale!
However, we still have the problem with histogram equalization. In particular,
I have found that the problem might be with the cvCreateImage part: I created a
function to test just cvCreateImage, and in fact it does not work:
public BufferedImage testcvCreateImage(BufferedImage animg)
{
IplImage img = IplImage.createFrom(animg);
IplImage testimg = cvCreateImage(cvSize(img.width, img.height), IPL_DEPTH_8U, 1);
BufferedImage testBufferedimg = testimg.getBufferedImage();
return testBufferedimg; //NOT DISPLAYABLE
}
This might be causing the histogram equalization to fail? Or it may need to be
treated as a new, separate issue?
Original comment by pendieee...@hotmail.com
on 5 Oct 2010 at 12:35
What do you mean "NOT DISPLAYABLE"? What happens? testimg is an initialized
image, it's not going to contain anything interesting..
Original comment by samuel.a...@gmail.com
on 5 Oct 2010 at 1:33
True, I was doing it the wrong way. For future readers looking for a sample
code in javacv for histogram equalization, this sample function code works just
fine (thanks Samuel, you can now close this issue):
public BufferedImage Equalize(BufferedImage bufferedimg)
{
IplImage iploriginal = IplImage.createFrom(bufferedimg);
IplImage srcimg = IplImage.create(iploriginal.width, iploriginal.height, IPL_DEPTH_8U, 1);
IplImage destimg = IplImage.create(iploriginal.width, iploriginal.height, IPL_DEPTH_8U, 1);
cvCvtColor(iploriginal, srcimg, CV_BGR2GRAY);
cvEqualizeHist( srcimg, destimg );
BufferedImage eqimg = destimg.getBufferedImage();
return eqimg;
}
Original comment by pendieee...@hotmail.com
on 5 Oct 2010 at 2:29
Good!
Original comment by samuel.a...@gmail.com
on 8 Oct 2010 at 3:01
Original issue reported on code.google.com by
pendieee...@hotmail.com
on 4 Oct 2010 at 11:19