Menu
  • HOME
  • TAGS

rect.contain() does not show correct results

opencv,image-processing,javacv

according to your printed image size (7x7) but your dumped matrix data of 21 elements per row, you probably have a 3 channel data type which means your matrix in the first channel (.get(y,x)[0] )looks like [23, 26, 33, 49, 74, 80, 70; 22, 28, 45, 69, 82; 70, 61;...

Android JavaCV JAR inclusion issue with OpenCV_Core

android,javacv

For everyone else who may come across this issue, I was not including arm versions of the opencv and ffmpeg jars.

JAVACV cvResize type assertion failed

java,opencv,javacv

using cvConvert will help converting the image depth and nchannels at the same time. This will solve the problem of cvResize() because both images must have the same depth and number of channels. IplImage a = IplImage.create(img.width(), img.height(), img.depth(), img.nchannels()); cvConvert(img,a); ...

JavaCV applet does not shows video in web browser, only in desktop

java,applet,javacv

Thanks, Andrew Thompson! I enabled my Java Console and I could see several security bloks of JRE. So, I added the following lines to the java.policy, and it worked fine: permission java.util.PropertyPermission "org.bytedeco.javacpp.loadlibraries", "read"; permission java.util.PropertyPermission "org.bytedeco.javacpp.platform", "read"; permission java.security.AllPermission; permission java.lang.RuntimePermission "shutdownHooks"; ...

Proguard removing annotations in Android application

java,android,proguard,minify,javacv

I'm also using javacv and here's how my proguard file looks: ## JavaCV -keepattributes *Annotation*, Exceptions, Signature, Deprecated, SourceFile, SourceDir, LineNumberTable, LocalVariableTable, LocalVariableTypeTable, Synthetic, EnclosingMethod, RuntimeVisibleAnnotations, RuntimeInvisibleAnnotations, RuntimeVisibleParameterAnnotations, RuntimeInvisibleParameterAnnotations, AnnotationDefault, InnerClasses -keep class org.bytedeco.javacpp.** {*;} -dontwarn java.awt.** -dontwarn org.bytedeco.javacv.** -dontwarn org.bytedeco.javacpp.**...

JavaCV read video and record

android,ffmpeg,javacv

frameGrabber grabs both ImageFrames and Sound Frames if you need to work on VideoFrames or its count, Do like this Frame grabFrame = frameGrabber.grabFrame(); if (grabFrame == null) { // all frames are processed System.out.println("!!! Failed cvQueryFrame"); runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(RecordActivity.this, "Done !!!", Toast.LENGTH_SHORT).show(); }...

Combine videos using JavaCV for android

java,android,android-gradle,javacv

I had to add opencv-android-arm.jar and ffmpeg-android-arm.jar and also make armeabi into a .jar file

Watershed image segmentation JavaCv, Segmentation not taking place

java,opencv,javacv

After converting your image to greyscale. Take mean of the image and then convert it to binary. The segmentation will take place and will be visible to grey image which is commented in the second last line.

Passing Point2f [] as arguments for getAffineTransform() in Javacv

java,c++,opencv,javacv,affinetransform

I believe here is the answer: https://groups.google.com/d/msg/javacv/dbWTNCHFyeg/Q6k59GPavgsJ: Point2f is a Pointer, which works like a native array: http://bytedeco.org/javacpp-presets/opencv/apidocs/org/bytedeco/javacpp/opencv_core.Point2f.html And we can do things like that with a Pointer to access the elements of a native array: http://bytedeco.org/javacpp/apidocs/org/bytedeco/javacpp/Pointer.html#position-int- Check the README file for an example with CvPoint: https://github.com/bytedeco/javacv#sample-usage Now do the...

JavaCV generate video from images Crashes

android,video,ffmpeg,javacv

As discussed in this post https://groups.google.com/forum/#!topic/javacv/Q_jxavoWdZE I finally solved it by adding Loader.load(swresample.class); before creating FFmpegFrameRecorder object. Thank you....

Image Filtering/Manipulation Using JavaCv(Java wrapper for OpenCV) in Android

android,video-processing,javacv,iplimage

I would like to share the knowledge that I have acquired while using JavaCv for Image and Video filtering.I have been successful in developing my filters (Gray-scale, Vintage, Contrast, Sharpen, Blur & Smooth) using JavaCv. I could easily do Image filtering with Bitmap Manipulation, but it was too slow to...

javaCV Maven project

maven,javacv

According http://search.maven.org/#search|ga|1|bytedeco there does not exists a version of 1.0.-Snapshot. So you have to change the dependencies list to the old version: <dependency> <groupId>org.bytedeco</groupId> <artifactId>javacv</artifactId> <version>0.11</version> </dependency> and also for javacpp: <dependency> <groupId>org.bytedeco</groupId> <artifactId>javacpp-presets</artifactId> <version>0.11</version> </dependency> etc. I...

javacv runnable.jar have error when running it in rasberry pi

java,compilation,raspberry-pi,javacv

This means that an opencv.jar file is missing from your raspberry pi's classpath (or is the wrong version). See if you have the latest version, and/or the linux version needed for the PI*, then either include both in the /lib of your project or make sure it is added to...

FFmpegFrameGrabber start() fails

android,javacv

I solved this problem. The version of javacv used was 0.7 and this version had issues similar to this (from my understanding most versions below 0.10 had a similar issue). The latest version to as of the post date, is 0.11 and using this it solved my problems. I'm leaving...

JavaCV Getting current upload bitrate

java,android,ffmpeg,javacv

Got this to work. I added a callback to FrameRecorder and then I use this code to count it: total_size += video_pkt.size(); upload_bitrate = (double) (video_pkt.pts() >= 0 && total_size >= 0 ? total_size * 8 / (video_pkt.pts() / 1000.0) : -1); bitrateCallback.onFrameWrited(upload_bitrate); ...

LineSegmentDetector (openCV 3) in javacv

java,opencv,javacv,javacpp

It's now available here, which is eventually going to get merged with the master branch: https://github.com/bytedeco/javacpp-presets/blob/opencv-3.0/opencv/src/main/java/org/bytedeco/javacpp/opencv_imgproc.java#L2672...

JavaCV FFmpegFrameGrabber preload audio

audio,ffmpeg,javacv,preload

I found the solution in my particular code example. ShortBuffer.duplicate() doesn't do a deep copy so it was causing issues. Instead I had to create a new ShortBuffer and copy over the contents.

Feature Detection Opencv/Javacv not working

image,opencv,javacv,feature-detection

The CvMat was not initialized properly which was giving the error. descriptors[i] = new CvMat(null); Instead I put it like this which solved the problem. descriptors[i] = CvMat.create(1, 1); ...

FFmpegFrameRecorder calls record() 20 times but the resulting mp4 file only has 2 frames

ffmpeg,javacv

I figured it out: the issue was because I didn't know what I was doing. I was new to javacv, and I was assuming, based on this stackoverflow entry, that the number of frames in the resulting video should be equal to the number of record() calls. However, this is...

Lab-image values on both of a and b axises exceeds the range

java,opencv,image-processing,colors,javacv

Results for L*a*b* conversion on 8-bit images is automatically scaled: RGB <-> CIE Lab* (CV_BGR2Lab, CV_RGB2Lab, CV_Lab2BGR, CV_Lab2RGB). ... This outputs 0 <= L <= 100, -127 <= a <= 127, -127 <= b <= 127. The values are then converted to the destination data type: 8-bit images L <-...

Adding a new object to ArrayList is causing memory leak?

java,arraylist,memory-leaks,javacv

You are not leaking memory; the java GC effectively deallocates unreachable (unused) objects only when you are close to running out of memory; therefore you can see 1GB in the task manager even when 10 times less that that is actually being used by alive objects.

why the integral-image contains extra row and column of zeros?

matlab,opencv,image-processing,javacv,gaussian

There are 2 reasons. First one is purely mathematical. Say you have a row of 3 numbers (pixels). How many possible cumulative sums it generates? the answer is 4. You can take the sum of 0 first pixels, 1 pixel, 2 pixels or all the 3 pixels. The amount of...

Could not initialize class org.bytedeco.javacpp.avutil on OS X along with Maven in JavaCV

java,maven,opencv,javacv

As Samuel Audet mentioned, this issue got solved after using the "platform.dependencies" property. eg : $ mvn package exec:java -Dplatform.dependencies -Dexec.mainClass=Demo ...