selvineduardo / javacv Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/javacv
License: GNU General Public License v2.0
Automatically exported from code.google.com/p/javacv
License: GNU General Public License v2.0
What steps will reproduce the problem?
1. Running the code sample provided
public class ExampleDifference {
public static void main(String[] args) {
new JavaCvErrorCallback().redirectError();
// memoryLeakExample();
slowDownExample();
}
// In this example we are reusing the CvMemStorage object (but NOT calling
// cvClearMemStorage).
//
// In this case after 20,000 iterations the time per iteration has doubled
// from 6ms to 11ms however the memory usage has remained stable throughout
// at only around 20MB
//
private static void slowDownExample() {
String imageFile = "test.png";
IplImage image = cvLoadImage(imageFile, CV_LOAD_IMAGE_GRAYSCALE);
IplImage edge = IplImage.create(image.width, image.height, image.depth,
image.nChannels);
cvCanny(image, edge, 1000, 1200, 3);
CvMemStorage mem = CvMemStorage.create();
long totalTime = 0;
int iteration = 0;
while (true) {
iteration++;
long start = System.currentTimeMillis();
CvSeq hough = cvHoughLines2(edge, mem.getPointer(),
CV_HOUGH_STANDARD, 1, Math.PI
/ TuningParameter.houghAnalysisResolution, 1000, 0,
0);
long end = System.currentTimeMillis();
long time = end - start;
totalTime += time;
if (iteration % 100 == 0) {
System.out.println("Iteration - " + iteration
+ " average time per iteration " + (totalTime / 100));
totalTime = 0;
}
}
}
// In this case, after 20,000 iterations the time per iteration remains
// stable (at 7ms on my box), but the memory usages has increased
// continuously to 180MB
//
private static void memoryLeakExample() {
String imageFile = "test.png";
IplImage image = cvLoadImage(imageFile, CV_LOAD_IMAGE_GRAYSCALE);
IplImage edge = IplImage.create(image.width, image.height, image.depth,
image.nChannels);
cvCanny(image, edge, 1000, 1200, 3);
long totalTime = 0;
int iteration = 0;
while (true) {
iteration++;
long start = System.currentTimeMillis();
CvMemStorage mem = CvMemStorage.create();
CvSeq hough = cvHoughLines2(edge, mem.getPointer(),
CV_HOUGH_STANDARD, 1, Math.PI
/ TuningParameter.houghAnalysisResolution, 1000, 0,
0);
cvClearMemStorage(mem);
mem.release();
cvReleaseMemStorage(mem.pointerByReference());
long end = System.currentTimeMillis();
long time = end - start;
totalTime += time;
if (iteration % 100 == 0) {
System.out.println("Iteration - " + iteration
+ " average time per iteration " + (totalTime / 100));
totalTime = 0;
}
}
}
}
What is the expected output? What do you see instead?
See comments for detail. In the first case I see a slow down over time, in the
second case I see a memory leak
What version of the product are you using? On what operating system?
- Lastest precompiled dlls for OpenCV 2.1.0
- Window 7 64bit
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 14 Jan 2011 at 3:55
Hi Samuel,
Is Flann in JavaCV? I was looking at cv and cvcore and didn't find them
Thanks!
Original issue reported on code.google.com by [email protected]
on 15 Oct 2010 at 6:53
What steps will reproduce the problem?
Hello Samuel,
I have been experimenting with cvFindContours & cvApproxPoly.
I have noticed when the polygon count is greater than 18(ish) it will take >
10 seconds to process. I don't seem to get the same behavior in a similar .c
program. I was guessing this had to do with the amount of data transported
through the jna call. 6 Polygons require ~1 second. This makes "real time"
processing a bit of a challenge.
I was initially hoping to filter some of the polygons out based on area, but
noticed cvContourArea is commented out. Was this intentional?
I suspect that this is not a problem with the your great code, but just an area
where OpenCV has a significant amount of data being processed as return values
or passed with pointers, and the JNA wrapper incurs a significant performance
loss.
With that in mind I was wondering what you might recommend as a strategy? The
amount of data when you isolate the polygons you are interested in is
surprisingly sparse. For example, I am only interested resulting bounding
perimeter and centroid which consists of a few points. The problem is, to get
there, a large amount of data needs to be passed back and forth.
I could write my own blob function in c and jna wrap that with minimal data
exchange. I believe they have done that at OPENCV
(http://ubaa.net/shared/processing/opencv/). This works, but seems rather
fragile in the long run. It would need to be maintained, remain compatible
with Linux, Windows, Mac, remain compatible with opencv releases.. etc... etc...
I wish opencv had a blob function with a variety of parameters and a simple
(lean) data structure passed back. Alas, there seems to be a considerable
amount of disparity in the subject. The blobslib must be separately downloaded
from opencv and other have similar projects have sprung up (e.g.
http://code.google.com/p/cvblob/)
I guess after rambling on for a while, the best long term solution would be to
extend your JNA code to wrap the blobslib from opencv. Is this of interest to
you?
I will start looking into the details.
Best Regards,
Greg.
Original issue reported on code.google.com by [email protected]
on 11 Jul 2010 at 2:46
Hi Samuel,
before all, thanks for the great job did with wrapper :)
I'm trying to implement a simple motion-detection algorithm (and maybe, when
it's work, i can upload it into the samples code), but I've encountered a weird
problem.
My algorithm works in this manner:
1) Take current frame and the previous one, in this way:
while (canvasFrame.isVisible() && (frame = grabber.grab()) != null) {
cvSmooth(frame, frame, CV_GAUSSIAN, 9, 9, 2, 2);
if(image == null) {
image = IplImage.create(frame.width, frame.height, IPL_DEPTH_8U, 1);
cvCvtColor(frame, image, CV_RGB2GRAY);
}
else {
prevImage = IplImage.create(frame.width, frame.height, IPL_DEPTH_8U, 1);
prevImage = image;
image = IplImage.create(frame.width, frame.height, IPL_DEPTH_8U, 1);
cvCvtColor(frame, image, CV_RGB2GRAY);
}
if(diff == null)
diff = IplImage.create(frame.width, frame.height, IPL_DEPTH_8U, 1);
2) then if the two images was acquired correctly, I do the difference and
threshold it:
if(prevImage != null) {
cvAbsDiff(image, prevImage, diff);
cvThreshold(diff, diff, 64, 255, CV_THRESH_BINARY);
}
This works fine, but when I close the java-application and I rerun it, this
error appears: Buffers have not been created, and it appears continuosly for a
couple of attempts then it works again.
May it be related to the SSE compiled stuff?
Any help will be greatly appreciated :)
What steps will reproduce the problem?
1. Simply compiling and running the program
What is the expected output? What do you see instead?
Working code, I've got instead an error
What version of the product are you using? On what operating system?
Netbeans 6.8 under Ubuntu 10.04 (amd64 architecture), and OpenCV 2.1
Original issue reported on code.google.com by [email protected]
on 30 Sep 2010 at 10:40
What steps will reproduce the problem?
Histogram Equalization:
public BufferedImage Equalize(BufferedImage img)
{
IplImage img = IplImage.createFrom(img);
IplImage out = cvCreateImage(cvSize(img.width, img.height), IPL_DEPTH_8U, 1);
// Perform histogram equalization
cvEqualizeHist( out, out );
BufferedImage eqimg = out.getBufferedImage();
out.release();
return eqimg;
}
What is the expected output? What do you see instead?
The returned equalized image "eqimg" is not displayable on my GUI. The "img" I
pass into the function however works fine, but not the returned "eqimg".
What version of the product are you using? On what operating system?
Lastest javacv version, Windows 7.
Please provide any additional information below.
Even if I perform a simple grayscale conversion, it has the same problem:
public BufferedImage GrayConversion(BufferedImage img)
{
IplImage img = IplImage.createFrom(img);
IplImage out = cvCreateImage(cvSize(img.width, img.height), IPL_DEPTH_8U, 1);
BufferedImage grayimg = out.getBufferedImage();
out.release();
return grayimg;
}
Hence, I might be doing something wrong in the following line?:
IplImage out = cvCreateImage(cvSize(img.width, img.height), IPL_DEPTH_8U, 1);
Original issue reported on code.google.com by [email protected]
on 4 Oct 2010 at 11:19
Hello Samuel,
Hope you are doing well. I believe I have found a bug in cvGet2D(image, x,y).
It behaves as if the x coordinate is actually the y coordinate. I passed in a
320 x 240 image and as soon as x gets to be 240 it throws an out of range
exception. I've downloaded the latest version and this is still occurring.
Best Regards,
Greg.
P.S. Wow, had a lot of imports to change on that last update :D !
What steps will reproduce the problem?
1.pass in 320 x 240 image
2.when x becomes > 240 error is thrown
What is the expected output? What do you see instead?
return the pixel scalar
What version of the product are you using? On what operating system?
the latest release
Fedora Core 13
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 20 Nov 2010 at 7:22
What steps will reproduce the problem?
Just trying to run the code.
What is the expected output? What do you see instead?
I expect to a window streaming the video. But I get the following error :
java.lang.Exception: cvCreateFileCapture() Error: Could not create camera
capture.
at name.audet.samuel.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:93)
at mainPrg.main(mainPrg.java:22)
What version of the product are you using? On what operating system?
OpenCV 2.0 on Windows 7 Professinal
Please provide any additional information below.
I have recompiled the OpenCV source code without SSE and OpenMP instructions
(as suggested).
I'm attaching the code :
Original issue reported on code.google.com by [email protected]
on 3 Sep 2010 at 4:06
Attachments:
What steps will reproduce the problem?
1. Create new project in Eclipse for example
2. Paste the sample code Test2
3. Run
If I compile OpenCV in 32 bits
- compiling the c examples works, and they work properly
- your code example fails with the output :
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load
library 'cxcore': dlopen(/usr/local/lib/libcxcore.dylib, 9): no suitable image
found. Did find:
/usr/local/lib/libcxcore.dylib: mach-o, but wrong architecture
/usr/local/lib/libcxcore.dylib: mach-o, but wrong architecture
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:199)
at name.audet.samuel.javacv.jna.Loader.load(Loader.java:44)
at name.audet.samuel.javacv.jna.cxcore.<clinit>(cxcore.java:115)
at name.audet.samuel.javacv.JavaCvErrorCallback.redirectError(JavaCvErrorCallback.java:95)
at com.Test.main(Test.java:14)
If I compile OpenCV in 64 bits
- compiling the c examples fails with the output :
compiling camshiftdemo.c
ld warning: in /usr/local/lib/libml.dylib, file is not of required architecture
ld warning: in /usr/local/lib/libcvaux.dylib, file is not of required
architecture
- compiling your code example fails with the output :
Exception in thread "main" java.lang.Exception: cvRetrieveFrame() Error: Could
not retrieve frame.
at name.audet.samuel.javacv.OpenCVFrameGrabber.grab(OpenCVFrameGrabber.java:149)
at com.Test.main(Test.java:33)
What version of the product are you using? On what operating system?
Mac Os X 1.5, on Macbook bought in 2009 (so 64 bits)
Original issue reported on code.google.com by [email protected]
on 14 Sep 2010 at 3:40
Hi Samuel,
Congrats for such a great tool!
On my project, I need to pass a webcam image that I am controlling with a non
javacv controller, onto javacv to extract the face only (face detector), and
return that reduced image back to my main project. For this, I am passing a
BufferedImage from my
project to my javaCV module, and then I need to convert it to IplImage to do
all the
processing. However, the conversion from BufferedImage to IpllImage,
as I saw online doesn't seem to work, and I wonder what am I doing
wrong? Here is what I'm doing:
public BufferedImage doFaceDetection(BufferedImage origbffimg)
{
...
IplImage grabbedImage = IplImage.createFrom(origbffimg);
... (do processing, and return the chopped BufferedImage of my face)
}
It does not crash, and it compiles no errors, but it seems to be
failing to do a proper conversion at: IplImage grabbedImage =
IplImage.createFrom(origbffimg);
In fact, I tried a very simple example, to make sure that my problem
was on the conversion part:
public void dumbTest(BufferedImage a)
{
IplImage b = IplImage.createFrom(a); //convert BufferedImage "a" into IplImage "b"
BufferedImage c = b.getBufferedImage(); // convert IplImage "b" from previous step, back into a BufferedImage "c"
// "c" should be the same as "a", but when debugging stepping into, I realised
they were not!
}
1. What might I be doing wrong?
2. An additional short question: I eliminated the random rotaion of
the plane you were performing on your sample. However, I am not allowed to
remove the
cvRodrigues2(randomAxis2, randomR2, null) function. If I remove it,
then it crashes on Runtime at: CvHaarClassifierCascade cascade = new
CvHaarClassifierCascade(cvLoad(cascadeName));
Any idea why, since anyway now I'm not using neither randomAxis2 nor
randomR2? Otherwise, how can I safely eliminate all the random plane
rotation part?
Many thanks, and keep the hard work for such a great tool! :)
What steps will reproduce the problem?
1. IplImage b = IplImage.createFrom(a); //convert BufferedImage "a" into
IplImage "b"
2. BufferedImage c = b.getBufferedImage(); // convert IplImage "b" from
previous step, back into a BufferedImage "c"
What is the expected output? What do you see instead?
// From the above code, I would expect "c" to be the same as "a", but when
debugging stepping into, I realised they were not!
What version of the product are you using? On what operating system?
OS: Tried it on a Windows 7 machine, JavaCV binary package (2010-07-30)
Please provide any additional information below.
Many thanks!
Original issue reported on code.google.com by [email protected]
on 25 Sep 2010 at 9:05
What steps will reproduce the problem?
1. Install javacv (and prerequirements) on a Mac
2. Try the Demo.java example given on the javacv homepage
3. This seems to work fine, and at the end it creates an "output.avi" file.
However, when you open this file, it seems to be corrupted. It does play, but
it looks very odd with bright and dark horizontal lines, duplications, strange
colours, etc, and the speed is by far quicker than it should be (hence, less
duration).
Problem 1 (odd display) may have to do with codecs? However, I tried installing
many codecs, or moving the video to another machine that has pretty much all
popular codecs, and it looks the same everywhere. I tried modifying the
encoding format used, but the OpenCVFrameRecorder does not allow to modify the
"codecID", which has it set to CV_FOURCC_DEFAULT. For this reason, I created my
own OpenCVFrameRecorderVersion2, and tried using CV_FOURCC('D','I','V','X') or
CV_FOURCC('P','I','M','1'), etc, but none work fine. Then I tried to run it on
a Windows machine that has all the popular codecs installed, but the current
javacv version crashes at line "Loader.load(opencv_objdetect.class);" of the
website example, as stated in another Issue opened.
Problem 2 (too quick movie recorded with short duration) may have to do with
the "this.frameRate = 30" bit of OpenCVFrameRecorder, which cannot be modified
either (unless I create my own OpenCVFrameRecorderVersion2 class)? Perhaps by
modifying that value it takes more frames per sec, and becomes closer to
real-time?
What is the expected output? What do you see instead?
To have an output.avi video that represent very well what I did in front of the
webcam, in terms of display and speed, but I get a video with bright and dark
horizontal lines, duplications of my face, odd colours, and very very high
speed (short duration), likely because very few frames were grabbed when
recording.
What version of the product are you using? On what operating system?
Latest version, on a Mac OS X (Snow Leopard)
Please provide any additional information below.
Sidenote question: would javacv allow to record both audio and visual channel
simmultaneously, so that I can hear me speaking while running output.avi, or
even a separate but synchronised .wav file?
Many thanks!
Steve
Original issue reported on code.google.com by [email protected]
on 23 Feb 2011 at 6:49
What steps will reproduce the problem?
CvPOSITObject positObj;
double focalLength;
CvTermCriteria criteria;
float[] rotationMatrix = new float[9];
float[] translationVector = new float[3];
static final Point2f[] imagePoints = {new Point2f(-48, -224),
new Point2f(-287, -174),
new Point2f(132, -153),
new Point2f(-52, 149)};
static final Point3f[] points = {new Point3f(0, 0, 0),
new Point3f(0, 0, 10),
new Point3f(10, 0, 0),
new Point3f(0, 10, 0)};
criteria = new CvTermCriteria(
cxcore.CV_TERMCRIT_EPS | cxcore.CV_TERMCRIT_ITER, 100, 1.0e-4f);
CvPoint2D32f[] cvImagePoints = CvPoint2D32f.createArray(imagePoints.length);
for (int i = 0; i < cvImagePoints.length; i++)
{
double x = imagePoints[i].x;
double y = imagePoints[i].y;
// do nothing if any points are invalid.
cvImagePoints[i] = new CvPoint2D32f(x,y);
}
targetPoints = CvPoint3D32f.createArray(points.length);
for (int i = 0; i < points.length; i++)
{
targetPoints[i] = new CvPoint3D32f(points[i].x, points[i].y,
points[i].z);
}
positObj = CvPOSITObject.create(targetPoints);
cvPOSIT(positObj, cvImagePoints, focalLength, criteria.byValue(),
rotationMatrix,
translationVector);
What is the expected output? What do you see instead?
I expect valid rotation matrix and translation vector.
Instead all array entries are NaN.
The SAME code (essentially) in C++ works perfectly.
What version of the product are you using? On what operating system?
OpenCV 2.1, Latest, as far as I can tell, JavaCV
Please provide any additional information below.
I have tried various ways of creating the structures to use in the call to
cvPOSIT with no change in the result. I have since written a C++ version to
process my intended data with full success, but my whole application requires
Java, so I would like to know how to debug this or interpret how to properly
get the data into the call.
Original issue reported on code.google.com by [email protected]
on 15 Jan 2011 at 5:38
What steps will reproduce the problem?
1. Compile and run the code
What is the expected output? What do you see instead?
This example should fully functional.
What version of the product are you using? On what operating system?
This example should work under all operating systems and all javaCV versions.
Please provide any additional information below.
It would be nice if anyone will extend the code or add a new functionality.
Original issue reported on code.google.com by [email protected]
on 21 Jan 2011 at 9:30
Attachments:
What steps will reproduce the problem?
1. compiled open cv 2.1 without sse,sse2, fast math and -o3 options, downloaded
latest jna and javacv and correctly set the library path with eclipse
2.downloaded test2.class with eclipse
3.runned
What is the expected output? What do you see instead?
[ 0.99636316, 0.042701807, -23.595554
-0.043815516, 0.99894774, -4.3367324
2.283744E-4, 5.2293086E-5, 0.9971857 ]
OpenCV Error: Bad argument (Invalid classifier cascade)
in function cvHaarDetectObjects,
C:\Users\etekno\Desktop\OpenCV-2.1.0\src\cv\cvhaar.cpp(1007)
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Unknown Source)
at com.googlecode.javacv.JavaCvErrorCallback.callback(JavaCvErrorCallback.java:67)
at com.googlecode.javacv.jna.cv.cvHaarDetectObjects(Native Method)
at com.googlecode.javacv.jna.cv.cvHaarDetectObjects(cv.java:2328)
at Test2.main(Test2.java:72)
What version of the product are you using? On what operating system?
i'm using eclipse galileo on windows7 Professional 64bit.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
Please provide any additional information below.
Before i tried recompiling opencv 2.1 many times, i needed to remove the sse,
sse2 AND fastmath, -o3 options to not get blue screen crashes after trying to
stop the test2.class.
Now recompiled like that it does not crash all the system but still gives me
the error written above while it pops out a dialog telling me that c++ runtime
library has terminated in an unusual way.
While playing the test2.class the cam led correctly lights, it pops a frame on
the screen but i can't see the image because it's too small and then it
crashes. I tried with the built in cam on my laptop and a usb cam.
Do i need to remove some other options with cmake gui? it can be a 64bit
problem?
I managed to work with opencv and java with the processing + opencv.jar
libraries but it works only on version 1.0 that is SLOW and also less
functionalities. Then i finally found your project and i'd really like to use
it for my thesis :-/
Original issue reported on code.google.com by [email protected]
on 28 Dec 2010 at 1:25
Because I believe that examples are the easiest way how to use JavaCV, I am
sending a sample of running SIFT on images.
In the attached code I am sending en example how to use OpenCV surf to extract
features from an image.
What steps will reproduce the problem?
1. Compile and run the code
What is the expected output? What do you see instead?
Obtaining information about point of interest.
It would be nice to extend the code so we can:
1) Extract points of interest. The code in C is the following:
CvSeqReader img_reader = new CvSeqReader();
cvStartReadSeq( imageDescriptors, img_reader, 0 );
for (int i = 0; i < imageDescriptors.size(); i++) {
float descriptor = (float) img_reader.ptr;
CV_NEXT_SEQ_ELEM(img_reader.seq.elem_size, img_reader);
memcpy(img_ptr, descriptor,
length * com.sun.jna.Native.getNativeSize(Float.class));
img_ptr += length;
}
2) make the whole example functional as in find_obj.cpp
(https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/find_obj.cpp?re
v=2270).
The code to be fixed is commented at the moment.
What version of the product are you using? On what operating system?
This should work under all the version and operating systems
Original issue reported on code.google.com by [email protected]
on 21 Jan 2011 at 9:21
Attachments:
What steps will reproduce the problem?
1.i install OpenCV-2.2.0-win32-vs2010 in c:\openCV
2.Then i create a new project in the NETBEANS at windows XP platform
Then i add javaCV and JNA in the library of the projrct in the netbeans
3.Then i use the following code
import static com.googlecode.javacv.jna.cv.CV_BGR2GRAY;
import static com.googlecode.javacv.jna.cv.cvCvtColor;
import static com.googlecode.javacv.jna.cv.cvHaarDetectObjects;
import static com.googlecode.javacv.jna.cxcore.CV_AA;
import static com.googlecode.javacv.jna.cxcore.IPL_DEPTH_8U;
import static com.googlecode.javacv.jna.cxcore.cvGetSeqElem;
import static com.googlecode.javacv.jna.cxcore.cvLoad;
import static com.googlecode.javacv.jna.cxcore.cvPoint;
import static com.googlecode.javacv.jna.cxcore.cvRectangle;
import static com.googlecode.javacv.jna.highgui.cvLoadImage;
import static com.googlecode.javacv.jna.highgui.cvSaveImage;
import com.googlecode.javacv.JavaCvErrorCallback;
import com.googlecode.javacv.jna.cv.CvHaarClassifierCascade;
import com.googlecode.javacv.jna.cxcore.CvMemStorage;
import com.googlecode.javacv.jna.cxcore.CvPoint;
import com.googlecode.javacv.jna.cxcore.CvRect;
import com.googlecode.javacv.jna.cxcore.CvScalar;
import com.googlecode.javacv.jna.cxcore.CvSeq;
import com.googlecode.javacv.jna.cxcore.IplImage;
import java.io.IOException;
public class test {
// The cascade definition to be used for detection.
private static final String CASCADE_FILE = "haarcascade_frontalface_alt.xml";
public static void main(String arg[])throws Exception
{
// This will redirect the OpenCV errors to the Java console to give you
// feedback about any problems that may occur.
new JavaCvErrorCallback().redirectError();
// Load the original image.
IplImage originalImage= cvLoadImage("E:\\PhotoGallery\\Sceneries\\golf insignia.jpg",1);
// We need a grayscale image in order to do the recognition, so we
// create a new image of the same size as the original one.
IplImage grayImage = IplImage.create(originalImage.width, originalImage.height, IPL_DEPTH_8U, 1);
// We convert the original image to grayscale.
cvCvtColor(originalImage, grayImage, CV_BGR2GRAY);
CvMemStorage storage = CvMemStorage.create();
// We instantiate a classifier cascade to be used for detection, using the cascade definition.
CvHaarClassifierCascade cascade = new CvHaarClassifierCascade(cvLoad(CASCADE_FILE));
// We detect the faces.
CvSeq faces = cvHaarDetectObjects(grayImage, cascade, storage, 1.1, 1, 0);
//We iterate over the discovered faces and draw yellow rectangles around them.
for(int i = 0; i < faces.total; i++)
{
CvRect r =new CvRect(cvGetSeqElem(faces, i));
cvRectangle(originalImage, cvPoint(r.x, r.y), cvPoint(r.x + r.width, r.y + r.height), CvScalar.YELLOW, 1, CV_AA, 0);
}
// Save the image to a new file.
cvSaveImage("E:\\PhotoGallery", originalImage);
}
}
What is the expected output? What do you see instead?
i except the output images with rectangles at the faces , But u got the
following error
run:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load
library 'cxcore': The specified module could not be found.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:199)
at com.googlecode.javacv.jna.Loader.load(Loader.java:44)
at com.googlecode.javacv.jna.cxcore.<clinit>(cxcore.java:113)
at com.googlecode.javacv.JavaCvErrorCallback.redirectError(JavaCvErrorCallback.java:95)
at samplejavacv.test.main(test.java:43)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
What version of the product are you using? On what operating system?
I am using NETBEANS 6.9.1 in WINDOWS XP professional platform
But one doubt : may i need to build the openCV with cmake ? (here i didn't do
that)
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 29 Dec 2010 at 3:49
What steps will reproduce the problem?
1.import static com.googlecode.javacv.jna.cv.v20.cvCalcImageHomography;
2.call cvCalcImageHomography in java code
3.
What is the expected output? What do you see instead?
"Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load
library 'cv': ÕҲ»µ½ָ¶¨µÄģ¿顣" <-- Unrecognizable message.
What version of the product are you using? On what operating system?
opencv 2.1, windows xp
Please provide any additional information below.
I didn't find cvCalcImageHomography in "cv" but found it in "cv.v20", "cv.v10"
and "cv.v11", so I tried invoking them but got above exception. Does it mean
cvCalcImageHomography is not supportted in v21? And the same to function
cvFindHomography.
Original issue reported on code.google.com by [email protected]
on 31 Jan 2011 at 6:33
Hello,
Hope you are doing well.
Yes it now gets past creating the model..
Unfortunately, I get a crash now in cvUpdateBGStatModel (see below). As I said
previously I'm just trying to port over the bgfg_segm.c from the samples.
Hopefully, I'm not out of sync somewhere. I do not want to be wasting your
time.
I can successfully run the bgfg_segm.c sample from an ecllipse cpp debugger.
Is there anything I can do to help?
Below the code is a thread stack dump of the crash.
Regards,
Greg.
CvGaussBGStatModelParams params = new CvGaussBGStatModelParams();
params.win_size=2;
params.n_gauss=5;
params.bg_threshold=0.7;
params.std_threshold=3.5;
params.minArea=15;
params.weight_init=0.05;
params.variance_init=30;
bg_model = v21.cvCreateGaussianBGModel( grey, null );
//bg_model = cvCreateFGDStatModel( temp );
}
v21.cvUpdateBGStatModel(image, bg_model, update_bg_model ? -1 : 0);
Thread Stack @ cvUpdateBGStatModel
Current thread (0x997d3c00): JavaThread "Thread-4" [_thread_in_native,
id=11408, stack(0x05d0f000,0x05d60000)]
siginfo:si_signo=SIGSEGV: si_errno=0, si_code=2 (SEGV_ACCERR),
si_addr=0x99572014
Registers:
EAX=0x00000003, EBX=0x026a1988, ECX=0x99572010, EDX=0x00000001
ESP=0x05d5e5b0, EBP=0x00000005, ESI=0x99571f01, EDI=0x99571fb0
EIP=0x02605dd0, CR2=0x99572014, EFLAGS=0x00010206
Top of Stack: (sp=0x05d5e5b0)
0x05d5e5b0: 3d4ccccd 00000000 00000000 00000000
0x05d5e5c0: 00000000 44610000 00000000 41c80000
0x05d5e5d0: 40800000 42080000 41c00000 42040000
0x05d5e5e0: 40600000 997814cb 00000059 99757d80
0x05d5e5f0: 3f000000 43610000 3f333333 000000a0
0x05d5e600: 00000004 00000140 00000081 9956e810
0x05d5e610: 05d5e85c 000003c0 000000f0 0000c800
0x05d5e620: 00220008 026a1988 000000f0 05d5e7e8
Instructions: (pc=0x02605dd0)
0x02605dc0: 48 8d b4 26 00 00 00 00 89 c1 c1 e1 05 8d 0c 0f
0x02605dd0: d9 41 04 d8 cb d9 51 04 de c2 d9 01 d8 cb d9 19
Stack: [0x05d0f000,0x05d60000], sp=0x05d5e5b0, free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libcvaux.so+0x7bdd0]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.sun.jna.Function.invokeInt(I[Ljava/lang/Object;)I+0
j
com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;Z)Ljava/lang/Obj
ect;+315
j
com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)
Ljava/lang/Object;+214
j
com.sun.jna.CallbackReference$NativeFunctionHandler.invoke(Ljava/lang/Object;Lja
va/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+198
j
$Proxy13.callback(Lname/audet/samuel/javacv/jna/cxcore$IplImage;Lname/audet/samu
el/javacv/jna/cvaux$CvBGStatModel;D)I+27
j
name.audet.samuel.javacv.jna.cvaux$v21.cvUpdateBGStatModel(Lname/audet/samuel/ja
vacv/jna/cxcore$IplImage;Lname/audet/samuel/javacv/jna/cvaux$CvBGStatModel;D)I+2
1
j
com.myrobotlab.image.OpenCVFilterFGBG.process(Lname/audet/samuel/javacv/jna/cxco
re$IplImage;Ljava/util/HashMap;)Lname/audet/samuel/javacv/jna/cxcore$IplImage;+1
45
j com.myrobotlab.service.OpenCV$VideoProcessor.run()V+204
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
Original issue reported on code.google.com by [email protected]
on 8 Jul 2010 at 2:14
What steps will reproduce the problem?
1. Add the Jar files to the project in Eclipse.
2. The project will compile and begin to run just fine.
3. The first JavaCV statement it reaches will cause it to crash saying, "The
source attachment does
not contain the source for the file Loader.class."
What is the expected output? What do you see instead?
I expect it to run over the line of code: new
JavaCvErrorCallback().redirectError();
Instead, it crashes.
What version of the product are you using? On what operating system?
I am using the most recent version as of 5:07 PST on Tuesday, May 4, 2010. I am
running Mac OS
X 10.6.3.
Please provide any additional information below.
When I downloaded the link you had for jna.jar, it gave me a folder called
jna.jar instead of a jar
file. I then went into the folder with all the classes and used the manifest
file to create a new jar. I
used that new jar as my jna.jar file.
I also added the javacv.jar, ffmpeg-java.jar, procamlib.jar, and
procamtracker.jar files, even
though I am not using a camera. I am decoding a byte array. The code compiles
just fine. I am
not sure what else you would need from me. Thank you.
Original issue reported on code.google.com by [email protected]
on 5 May 2010 at 12:13
Does JavaCV have a machine learning algorithm like OpenCV??
If so, can you post some samples??
I need it for my image classification alogrihtm. Thanks:D
Original issue reported on code.google.com by [email protected]
on 11 Jul 2010 at 10:24
Hi,
is it possible to do face recognition using javacv?
i mean not face detection but i want to search for a person in a group of
images meaning i will input a picture and search for the person in other
pictures....
can this be done using javacv?
can we get more samples if this is possible and is there a documenation for the
functions that can be done using javacv....
thank you very much
Original issue reported on code.google.com by [email protected]
on 30 Jul 2010 at 7:12
What steps will reproduce the problem?
1. Executed the "Test2" example provided in the "Project Home" page
2. Executed a variance of the same (file attached "DetectFace.java"
What is the expected output? What do you see instead?
The expected output is to draw a rectagle around the detected objects, but
throws a runtime exception while calling cvCvtColor() method.
What version of the product are you using? On what operating system?
1. OpenCV 2.0
2. JDK 1.6
3. javacv downloded from this site
4. Java Native Access 3.2.5
5. Tried in Windows XP Professional and Windows 7 Ultimate
Please provide any additional information below.
* attached the java source code "DetectFace.java" with debug statements
* attached the log file created with the exception "hs_err_pid384.log"
Appreciate your valuable guidance on this.
Thanks in advance.
Regards,
Mohammed Sadiq
Original issue reported on code.google.com by [email protected]
on 7 Aug 2010 at 3:09
Attachments:
Also, in an attempt to do a workaround, discovered cvCopy appears to be missing
as well.
Original issue reported on code.google.com by [email protected]
on 16 Jul 2010 at 9:00
What steps will reproduce the problem?
1. Create any class which uses MarkerDetector
2. Use an image with marker (or video stream)
What is the expected output? What do you see instead?
- Array of markers which are in the image is expected
- I get an empty array all the time
- So I went and debugged it and I found that marker's id was always -1. So I
commented out the if condition where it checks if (m.id < 0) { continue;}
It then returned correct output.
Original issue reported on code.google.com by [email protected]
on 6 Dec 2010 at 9:39
public static void main(String[] args) {
IplImage image = cvLoadImage("c:\\teste.jpg");
if(image != null){
System.out.println("OK");
cvSmooth(image, image, CV_GAUSSIAN, 3, 0, 0, 0);
cvSaveImage("c:\\testecv.jpg", image);
}
}
What is the expected output? What do you see instead?
Save the cvImage
What version of the product are you using? On what operating system?
the last version on winxp
Please provide any additional information below.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x035f13e0, pid=4060, tid=3536
#
# JRE version: 6.0_21-b06
# Java VM: Java HotSpot(TM) Client VM (17.0-b16 mixed mode, sharing windows-x86
)
# Problematic frame:
# C [libhighgui200.dll+0xd13e0]
Original issue reported on code.google.com by [email protected]
on 24 Aug 2010 at 6:02
Hi Samuel,
thanks for your efforts with JavaCV.
Since me and a lot of other programmers are not very much familiar with
OpenCV, I would appreciate a few samples showing how e.g. the cvFindFace
function works.
Cheers,
Martin
Original issue reported on code.google.com by [email protected]
on 12 Mar 2010 at 11:24
Hi, thanks for making this great port for opencv to java.
But, I have a critical problem that prevents me from using the interface.
The problem is that jni*.dll files need dll files whose names are in format
OPENCV_*.dll BUT my the dlls residing in my opencv/bin directory have names in
format libopencv_*.dll.
Even if this problem can be solved with renaming the dlls, I wanted to notify
you about this issue. Because by default opencv dlls come in the format
libopencv_*.dll and using them in that way seems more convenient.
Cheers
Behlül
Original issue reported on code.google.com by [email protected]
on 23 Feb 2011 at 4:45
Hi Samuel,
Is Flann in JavaCV? I was looking at cv and cvcore and didn't find them
Thanks!
Original issue reported on code.google.com by [email protected]
on 15 Oct 2010 at 6:53
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 29 Dec 2010 at 3:42
What steps will reproduce the problem?
1. Use a newer version of JNA instead of JNA 3.2.5
2. Create a histogram of an image
What is the expected output? What do you see instead?
Creating a histogram produces the following exception:
Exception in thread "main" java.lang.IllegalArgumentException:
Structure class name.audet.samuel.javacv.jna.cxcore$CvArr$ByReference
has unknown size (ensure all fields are public)
What version of the product are you using? On what operating system?
I was using the javacv 7/30/10 and jna 3.2.8 (latest version) on windows 7
professional
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 9 Oct 2010 at 6:13
would be nice if IplImage could accept arrays and/or Buffers instead of
BufferedImage
Original issue reported on code.google.com by [email protected]
on 20 Oct 2010 at 7:18
What steps will reproduce the problem?
1. When I run Test2 example.
2. I have this message: "cvRetrieveFrame() Error: Could not retrieve frame."
3. It's the OpenCVFrameGraber class.
What version of the product are you using? On what operating system?
I installed all items described in the JavaCV web page.
I have MacOX 10.6.4.
OpenCV: I have the latest official version of OpenCV installed on the root. The
samples (samples/c) provided by OpenCV are working well, particularly the face
detection.
Please provide any additional information below.
For Test2: The webcam turned on when I run the program. The Canvas Frame
entitled "Some title" appear on the screen, before I got the message error.
ps: thanks for the good job, I would like to use JavaCV in my work, but I am
still afraid of getting such kind of errors. Do you have any idea from where
comes the problem? Thanks.
Original issue reported on code.google.com by [email protected]
on 24 Sep 2010 at 8:38
Hi,
Is there a performant method to convert a java.awt.image or an array of
floats or int to an IplImage?
I tried set2D, but it's slow, like 7 seconds for 200x200 on 2GHz.
Original issue reported on code.google.com by [email protected]
on 20 Apr 2010 at 3:58
Is there a way to implement something like this piece of code written in C++ to
Java?
IplImage* img=cvCreateImage(cvSize(640,480),IPL_DEPTH_8U,3);
((uchar *)(img->imageData + i*img->widthStep))[j*img->nChannels + 0]=111;
where i,j are image coordinates. Code found at:
http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/index.html
Since this makes use of pointers, I was wondering if it is possible to do it in
Java. It may be a simple fix (I'm missing something) or it may not be possible
to do.
What I'm trying to do is access the colour channels of a particular pixel. I
have got it working with the cvGet2D method but the program got quite slow when
looping this method. Maybe using this new method will be faster (that is the
case in C++).
Thanks in advance
Original issue reported on code.google.com by [email protected]
on 27 Aug 2010 at 9:03
What steps will reproduce the problem?
1. Install all prerequired software as instructed in the website
2. Create a java project and add the Demo.java example provided in the javacv
homepage
3. Add all the javacv jar libraries (Netbeans)
4. Run/Debug the project -> it crashes at Loader.load(opencv_objdetect.class);
What is the expected output? What do you see instead?
Not to crash. I have everything installed, I have tried older versions in the
past that run on this machine (when it used name.audet.samuel.javacv.jna...
instead of com.googlecode.javacv.cpp...
(by the way, notice the missing semi-colon at line "import
com.googlecode.javacv.cpp.*" if you would like to correct it
What version of the product are you using? On what operating system?
Latest version, downloaded today. Windows 7. However, it seems to run fine on a
Mac, but that the video recorded seems to be wrongly encoded and looks very odd
(but I guess this is a separate issue I can open in another thread).
Please provide any additional information below.
It compiles fine, but it crashes at:
Loader.load(opencv_objdetect.class);
Information:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
C:\Users\myuser\AppData\Local\Temp\jniopencv_core1024071573664674187.dll: Can't
find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1003)
at com.googlecode.javacpp.Loader.load(Loader.java:308)
at com.googlecode.javacpp.Loader.load(Loader.java:258)
at com.googlecode.javacv.cpp.opencv_core$CvPoint.<clinit>(opencv_core.java:1733)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:280)
at com.googlecode.javacpp.Loader.load(Loader.java:258)
at com.googlecode.javacv.cpp.opencv_core$CvSize.<clinit>(opencv_core.java:2047)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:280)
at com.googlecode.javacpp.Loader.load(Loader.java:258)
at com.googlecode.javacv.cpp.opencv_core$CvScalar.<clinit>(opencv_core.java:2151)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:280)
at com.googlecode.javacpp.Loader.load(Loader.java:258)
at com.googlecode.javacv.cpp.opencv_core$CvErrorCallback.<clinit>(opencv_core.java:3962)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:280)
at com.googlecode.javacpp.Loader.load(Loader.java:258)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:120)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:280)
at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:87)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:280)
at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:88)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:280)
at com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:85)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.googlecode.javacpp.Loader.load(Loader.java:280)
at javacvvidrec.Demo.main(Demo.java:23)
Java Result: 1
BUILD SUCCESSFUL (total time: 31 seconds)
Original issue reported on code.google.com by [email protected]
on 23 Feb 2011 at 6:33
What steps will reproduce the problem?
1.Run cvAdaptiveThreshold on an image.
2.Set up the contour variables as demonstrated in the JavaCV example (with
contourPointer and contour).
3.Get the contours using cvFindContours with the same method demonstrated in
the main JavaCV example (on the front page).
4. Try getting the CvSeq variable from contourPointer using
PointerByReference():
CvSeq contours = contourPointer.getStructure();
What is the expected output? What do you see instead?
We expect to get a CvSeq containing all the contours found. Instead, there is a
stack overflow error, seemingly occuring due to repeated pointer to object
casts at the C/C++ level.
What version of the product are you using? On what operating system?
I am using Java 1.6, JDK 6, OpenCV 2.1.0, JNA 3.2.5, and JavaCV 20100730. This
is on the Windows XP OS.
Please provide any additional information below.
Converting to cvThreshold instead of cvAdaptiveThreshold (as in the example)
fixes the error. However, I am in need of adaptive thresholding for this
particular program.
Thank you for your work porting this to Java, it's immensely helpful.
Hopefully, you'll be able to help me figuring out this minor error.
- Nick
Original issue reported on code.google.com by [email protected]
on 7 Aug 2010 at 12:23
What steps will reproduce the problem?
1. Running the calibration
2. The entire calibration is done normally, when the last capture is done the
error occurs.
What is the expected output? What do you see instead?
Expected to get the calibration matrices. Instead the calibration fails and
returns the error below.
Please provide any additional information below.
I am using windows 7, but i'm running all 32-bit software.
The error is reported as follows in NetBeans:
Sep 15, 2010 9:00:25 PM name.audet.samuel.procamcalib.CalibrationWorker
doInBackground
SEVERE: Could not perform calibration
java.lang.Exception: flycaptureConvertImage() Error 2
at name.audet.samuel.javacv.FlyCaptureFrameGrabber.grab(FlyCaptureFrameGrabber.java:411)
at name.audet.samuel.javacv.FrameGrabber$Array.grab(FrameGrabber.java:238)
at name.audet.samuel.procamcalib.CalibrationWorker.calibrateColor(CalibrationWorker.java:469)
at name.audet.samuel.procamcalib.CalibrationWorker.doInBackground(CalibrationWorker.java:234)
at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Original issue reported on code.google.com by [email protected]
on 15 Sep 2010 at 7:06
Eclipse shows an error when trying to use cvWarpPerspective with the
arguments (CvArr src, CvArr dst, CvMat map_matrix).
To be able to use this function, we have to use the following prototype:
cvWarpPerspective(CvArr src, CvArr dst, CvMat map_matrix,
int flags/*=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS*/,
CvScalar.ByValue fillval/*=cvScalarAll(0)*/)
Original issue reported on code.google.com by [email protected]
on 9 May 2010 at 4:57
What steps will reproduce the problem?
1. When I make repeated calls to cvHaarDetectObjects(), it will eventually
crash.
What is the expected output? What do you see instead?
I expect it to return a CvSeq object, but instead it will crash.
What version of the product are you using? On what operating system?
I am using the latest version of the product, and I have tried it on both
Windows and MacOS X.
While the actual output of the error on each machine is slightly different, the
problem is in the
same location.
Please provide any additional information below.
I have attached the code that I am using (FindFaces.java), which is rather
straightforward. Also, I
have included the error logs that were produced on the Windows machine as well
as a mediocre
one I generated from the Mac OS X machine. They are the same physical machine.
This may be related strictly to JNI, but I wanted to post here before I went
there.
Original issue reported on code.google.com by [email protected]
on 18 May 2010 at 10:50
Attachments:
What steps will reproduce the problem?
Hi Samuel,
i am trying to find circles using your javacv library. But i'm having trouble
getting it to work. So i thought maybe you could help with some tips :)
I have an image that i convert to grayscale, then smooth it, then find edges
using canny. After that i run cvFindContours and would like to go through the
found contours using cvFitEllipse2 to find its bounding box and calculate by
its height and width if it could be a circle.
The code looks like this. I left parts out because i build a gui around it to
add visual parameter tweaking later:
// Prepare image to detect objects.
IplImage imageToDetectObjects = inputImage.getCopy().getOpenCVImage();
// convert to grayscale
IplImage src = imageToDetectObjects.clone();
int width = src.width;
int height = src.height;
IplImage dst = cvCreateImage(new CvSize(width, height).byValue(), IPL_DEPTH_8U,
1);
cvCvtColor(src, dst, CV_RGB2GRAY);
imageToDetectObjects = dst.clone();
// smooth it, otherwise a lot of false circles may be detected
cvSmooth(imageToDetectObjects, imageToDetectObjects, CV_GAUSSIAN, 9, 9, 2, 2);
// create binary image
IplImage binImage = imageToDetectObjects.clone();
cv.cvCanny(imageToDetectObjects, binImage, 0.3, 0.5, 3);
imageToDetectObjects = binImage.clone();
.
.
.
// find contours
memoryStorage = CvMemStorage.create();
CvSeq.PointerByReference contourPointer = new CvSeq.PointerByReference();
int contourPointerSize =
com.sun.jna.Native.getNativeSize(CvContour.ByValue.class);
CvSeq contourList = new CvSeq();
cvFindContours(imageToDetectObjects, memoryStorage, contourPointer,
contourPointerSize, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);
contourList = contourPointer.getStructure();
double circleError = 0.50;
// check if contour is circle
while (contourList != null) {
if (contourList.elem_size >= 6) {
CvBox2D box = cvFitEllipse2(contourList);
CvSize size = new CvSize((int) (box.size.width * 0.5), (int) (box.size.width * 0.5));
double smallAxis, longAxis;
if (size.width < size.height) {
smallAxis = size.width;
longAxis = size.height;
} else {
smallAxis = size.height;
longAxis = size.width;
}
float circleMeasure = (float) ((longAxis - smallAxis) / longAxis);
if (circleMeasure < circleError) {
circleList.add((double) box.center.x);
circleList.add((double) box.center.y);
circleList.add((double) ((size.width + size.height) / 2));
}
}
contourList = contourList.h_next;
}
What is the expected output? What do you see instead?
Now when i debug it, as soon as i hit the line
CvBox2D box = cvFitEllipse2(contourList);
i get the error message:
"OpenCV Error: Incorrect size of input array (Number of points should be >= 6)
in unknown function, file ..\..\..\..\ocv\opencv\src\cv\cvshapedescr.cpp, line
972"
So i am wondering if im doing something fundamentaly wrong here? Maybe you have
an idea?
What version of the product are you using? On what operating system?
I'm using the 2010-07-30 release of javacv and OpenCV 2.1.0 with Eclipse Helios
on Windows XP.
Best Regards,
Chris
Original issue reported on code.google.com by [email protected]
on 10 Oct 2010 at 1:35
What steps will reproduce the problem?
1. Attempt to use JavaCV objects (say, create an IplImage) without root access.
What is the expected output? What do you see instead?
One would expect the program to run without issues, creating the IplImage.
The output we get is the following:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load
library 'highgui': libcv.so.2.1: cannot open shared object file: No such file
or directory
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:200)
at name.audet.samuel.javacv.jna.Loader.load(Loader.java:44)
at name.audet.samuel.javacv.jna.highgui.<clinit>(highgui.java:76)
at com.hid.iod.imageprocessing.HidImage.<init>(TestImage.java:77)
The exact line where it fails is:
originalImage = cvLoadImage(location);
This is the first line in my code which summons a JavaCV object
What version of the product are you using? On what operating system?
I am using Java 1.6, JDK 6, OpenCV 2.1.0, JNA 3.2.5, and JavaCV 20100730. This
is on RedHat Enterprise Linux Server Release 5.5 (Tikanga).
Please provide any additional information below.
The opencv libraries are in /usr/local/lib64/, which has chmod 777 (rwx for
all).
Original issue reported on code.google.com by [email protected]
on 28 Dec 2010 at 7:37
What steps will reproduce the problem?
1. Would like to use cvCornerFast(IGray, inFASTThreshhold, inNpixels,
inNonMaxSuppression, &numCorners, & corners) in javacv but the function is not
available?...
2. Can't find the function
What is the expected output? What do you see instead?
- No errors in eclipse, how ever there is compilation problems
What version of the product are you using? On what operating system?
- The latest javacv running on windows 7, 64 bit (not that it should make that
big of a difference)
Please provide any additional information below.
Thanks in advance!
Original issue reported on code.google.com by [email protected]
on 29 Oct 2010 at 7:36
i get the following after creating a file named telda and placing the same code
for test2.....
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load
library 'cxcore': The specified module could not be found.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:199)
at name.audet.samuel.javacv.jna.Loader.load(Loader.java:44)
at name.audet.samuel.javacv.jna.cxcore.<clinit>(cxcore.java:115)
at name.audet.samuel.javacv.jna.highgui.<clinit>(highgui.java:73)
at name.audet.samuel.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:96)
at Telda.main(Telda.java:21)
the thing is that i tried to install it b4 i'm using windows 7 home premium, it
installed and worked, i had to reformat now i don't know what i am missing, i
installed opencv from sourceforge, i added the path to all users.
now i don't know whats the problem,
please help
thank you very very much
Original issue reported on code.google.com by [email protected]
on 26 Jul 2010 at 5:42
What steps will reproduce the problem?
1. attempting to port bgfg_seg.cpp to java
2. attempt to initialized with cvCreateGaussianBGModel using null for the
CvGaussBGStatModelParams and attempted with CvGaussBGStatModelParams with the
following parameters
params.win_size=2;
params.n_gauss=5;
params.bg_threshold=0.7;
params.std_threshold=3.5;
params.minArea=15;
params.weight_init=0.05;
params.variance_init=30;
What is the expected output? What do you see instead?
initialization
What version of the product are you using? On what operating system?
2.1 - fedora core 12
Please provide any additional information below.
Hello Everyone, and hello again Samuel
I have been tinkering with your fantastic jna interface with opencv for a
while.. Of course every issue I've encountered so far has always been with my
own source and this probably is not an exception, but I still have not figured
it out.
Any direction or info you might provide will be greatly appreciated.
Best Regards,
Greg.
Original issue reported on code.google.com by [email protected]
on 30 Jun 2010 at 7:28
I tried to create a simple sample using cv SURF feature but got the
following error. Could you take a look what I did wrong or provide a simple
example how to use cv SURF function? Thanks.
OpenCV Error: Assertion failed (CV_MAT_TYPE(img->type) == CV_8UC1) in
unknown function, file ..\..\..\..\ocv\opencv\src\cv\cvsurf.cpp, line 698
Here is the junit test I tried to run:
@Test
public void shouldRetrieveSURFPoint() throws Exception {
ObjectFinder finder = new ObjectFinder(cvLoadImage("lily.jpg"));
Settings setting = finder.getSettings();
assertNotNull(setting);
}
Original issue reported on code.google.com by [email protected]
on 25 May 2010 at 3:36
What steps will reproduce the problem?
1.Compile the java code.
2.Run the class file and specify the input image file, for example, java CvTest
cloud.jpg
3.The error message will display
What is the expected output? What do you see instead?
It is a fairly simple javacv code and the expected output is "Program
terminated normally". Instead I saw a fatal JVM error. The screenshot is
included in the attached file.
What version of the product are you using? On what operating system?
I am using OpenCV 2.1.0 and the latest version of javacv.
(javacv-bin-20101104.zip from the download page). The Java version I use is as
follows:
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Server VM (build 17.1-b03, mixed mode)
The operating system is Ubuntu 10.04 LTS
Please provide any additional information below.
1. I wrote a C++ version of the CvTest class. It works on my machine using
OpenCV.
2. Besides cvSmooth() method, cvFilter2D also crashed in the same environment.
3. The CvTest.java is the source file. I also included a sample image.
4. The search results I found on the Internet suggest some relation between
this error and the SSE instructions. But I found few details about how to fix
this problem.
Original issue reported on code.google.com by [email protected]
on 27 Nov 2010 at 4:38
Attachments:
Hi Samuel!!!
First of all you thank you for this interface. But i have problem with
cvContourArea. I use Opencv 2.1 and i use this method like this result =
Math.abs(cvContourArea( contour , CV_WHOLE_SEQ, 0)); . And i get this error
"OpenCV Error: Bad argument (Input array is not a valid matrix)".
The whole error part is
OpenCV Error: Bad argument (Input array is not a valid matrix)
in function , ..\..\..\src\cv\cvutils.cpp(53)
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1206)
at name.audet.samuel.javacv.JavaCvErrorCallback.callback(JavaCvErrorCallback.java:67)
at name.audet.samuel.javacv.jna.cv$v21.cvContourArea(Native Method)
at openCV.opencv.main(opencv.java:70)
How can i solve this problem?
Thanks in advance.
Regards,
Engin Öz
Original issue reported on code.google.com by [email protected]
on 15 Oct 2010 at 3:52
Attachments:
Its not a Problem, but a Question. Related to FFmpegFramegrabber Class.
Short Version: How can I use a function like this:
DeprecatedFunctions.avpicture_deinterlace(dst, src, pix_fmt, width, height);
This Function is "Deprecated". What is current workaround when I have
interlaced video material? How can I deinterlace the picture within the
FFmpegFramegrabber class?
What version of the product are you using? On what operating system?
Win7 64bit
OpenCv 2.1.0
Original issue reported on code.google.com by [email protected]
on 9 Dec 2010 at 10:59
What steps will reproduce the problem?
1. I open Eclipse, and I create a new project, as described here :
http://code.google.com/p/javacv/
2. In that new project, only one small class with a call to a opencv function
(I used the first sample code)
What is the expected output? What do you see instead?
I have the following error :
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load
library 'cxcore': dlopen(libcxcore.dylib, 9): image not found
What version of the product are you using? On what operating system?
I am on Mac Os X 1.5 (macbook). I downloaded the latest version of Javacv, and
used the SVN of OpenCV to compile.
Please provide any additional information below.
I installed OpenCV (with cmake), and I can compile and run the examples
included. So that works.
I compiled it without SSE support, and with the correct architecture (i386).
The library was installed in /usr/local/lib/libopencv_...
Maybe I did something wrong, but I really followed the documentation, and I end
up with that, so maybe it is really the documentation that has a problem.
Original issue reported on code.google.com by [email protected]
on 13 Sep 2010 at 11:33
What steps will reproduce the problem?
1.I open Eclipse, and I create a new project.
2. I add javacv-src-20100730.zip, javacv-bin-20100730.zip, and jna.jar to my
project. I have copy this files in OpenCV2.1>lib
2.I write a simple code that you put in the example.
What is the expected output? What do you see instead?
I run but it has errors. "the import name cannot be resolved". I had written
this 'import static name.audet.samuel.javacv.jna.cxcore.*;'.
What version of the product are you using? On what operating system?
I use Eclipse for java and OpenCV2.1. I dont' know what the problem is, can you
help me, please?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 26 Oct 2010 at 6:59
What steps will reproduce the problem?
1. Simply run Test2.java on the javacv home page.
I am expecting a frame with a webcam(attached to my PC) image generated.
It returns an error below :
--------------------------------------------------------------------------
Exception in thread "main" java.lang.IllegalArgumentException: Width (0) and
height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
at sun.awt.image.SunVolatileImage.getBackupImage(SunVolatileImage.java:207)
at sun.awt.image.VolatileSurfaceManager.getBackupSurface(VolatileSurfaceManager.java:235)
at sun.awt.image.VolatileSurfaceManager.initialize(VolatileSurfaceManager.java:91)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:58)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:67)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:78)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:72)
at sun.awt.windows.WComponentPeer.createVolatileImage(WComponentPeer.java:501)
at java.awt.Component.createVolatileImage(Component.java:3021)
at java.awt.Component$BltBufferStrategy.createBackBuffers(Component.java:3558)
at java.awt.Component$BltBufferStrategy.<init>(Component.java:3544)
at java.awt.Component.createBufferStrategy(Component.java:3264)
at java.awt.Canvas.createBufferStrategy(Canvas.java:166)
at java.awt.Component.createBufferStrategy(Component.java:3204)
at java.awt.Canvas.createBufferStrategy(Canvas.java:141)
at name.audet.samuel.javacv.CanvasFrame.init(CanvasFrame.java:173)
at name.audet.samuel.javacv.CanvasFrame.<init>(CanvasFrame.java:111)
at name.audet.samuel.javacv.CanvasFrame.<init>(CanvasFrame.java:107)
at Test2.main(Test2.java:16)
--------------------------------------------------------------------------
Using latest javacv.jar & jna.jar on windows xp. Using eclipse.
I am using JDK 1.5 update 21
Original issue reported on code.google.com by [email protected]
on 12 Oct 2010 at 6:24
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.