javacv

Equivalent of OpenCV statement in Java using JavaCV

天涯浪子 提交于 2019-12-21 04:50:13
问题 I want to know how to construct the following C++ statement in OpenCV using JavaCV: float* p = (float*)cvGetSeqElem(circles, i); int radius = cvRound(p[2]); To get the Radius of a circle detected using cvHoughCircles(). Obviously Java doesn't use pointer so I have no idea how to do this in Java. The code I have so far so you can see it context: lines = cvHoughCircles(frame2, storage, CV_HOUGH_GRADIENT, 1, 50, 300, 60, 10, 600); for (int i = 0; i < lines.total(); i++) { //Would like the code

Is there a way to detect the main ROI?

混江龙づ霸主 提交于 2019-12-21 02:46:15
问题 i want detect the important ROI Element in a picture. (i want to get the position) I've tested a reverted SeamCarving-Method. I hoped, that the most importand Area in a picture have the most energylevel. I've generated one vertical and one horizontal Seam and took the intersection. But this method don't seem to be perfect. Some examples: good detection: good detection http://img713.imageshack.us/img713/2928/seamcastle.jpg good detection http://img39.imageshack.us/img39/9584/seamente.jpg good

JavaCV + Android Studio + gradle- possible?

旧街凉风 提交于 2019-12-20 09:06:13
问题 I'm trying use JavaCV with Android Studio and Gradle. I wrote such code fragment: repositories { mavenCentral() maven { url "http://maven2.javacv.googlecode.com/git/" } } dependencies { compile files('libs/android-support-v4.jar') compile group: 'com.googlecode.javacpp', name: 'javacpp', version: '0.5' compile group: 'com.googlecode.javacv', name: 'javacv', version: '0.5' } and I see imported libraries in dir External Libraries. So I tried to run this: ... IplImage zdjecie=cvLoadImage

Prograurding android project using Javacv gives exception

懵懂的女人 提交于 2019-12-20 03:15:13
问题 Hi i am developing an app with Javacv. The app works fine until i proguard the build. After proguarding, the app crashes at the place of jni function call. -dontshrink -dontoptimize -dontpreverify -dontwarn android.support.** -keep class com.googlecode.javacv.** -dontwarn com.googlecode.javacv.** -keep class com.googlecode.javacpp.** -dontwarn com.googlecode.javacpp.** -keepclasseswithmembernames class * { native <methods>; } -keepattributes *Annotation* I can't find any answer that solves my

javaCV Android, Strange colors on overlay while streaming to rtmp server

我的梦境 提交于 2019-12-19 17:45:49
问题 I wanna stream to facebook live from android. I was able to adapt an existing example for streaming to FB. That first step more or less works (audio is still a problem, but not in the scope her). I can stream to FB. I now wanna overlay the stream with a transparent png image. I am creating a FFmpegFrameFilter on start up by: try{ filter = new FFmpegFrameFilter("movie="+path+"/image.png [logo];[in][logo]overlay=0:0:format=rgb [out]",imageWidth, imageHeight); filter.start(); }catch (FrameFilter

Looping through OpenCV Mat in Java bindings

放肆的年华 提交于 2019-12-18 17:13:29
问题 I am trying to convert a C++ method from a previous answer I received using OpenCV to Java using OpenCV Java bindings C++ code: cv::Mat gray; cv::Mat element = cv::getStructuringElement(cv::MORPH_CROSS, cv::Size(2 * erosion_size + 1, 2 * erosion_size + 1), cv::Point(erosion_size, erosion_size) ); cv::erode(gray, gray, element); // Scan the image searching for points and store them in a vector std::vector<cv::Point> points; cv::Mat_<uchar>::iterator it = gray.begin<uchar>(); cv::Mat_<uchar>:

Playing a video with JavaCV and FFmpeg

只谈情不闲聊 提交于 2019-12-18 15:49:42
问题 So, I'm developing a custom video player for Android but I need to play more than the android supported video files (mp4, 3gp...), like wmv, avi, flv. At this time I do already convert any video type to .mp4 and I'm able to play them after recoding, but I have no idea how can I play those wmv , avi files without recoding them to mp4 video formats. Is there any way I can play any video on Android without recoding them? JavaCV + FFmpeg library already working, just don't know how to do that. By

Javacv: Decoding H.264 “live” stream coming from red5 server on android device

两盒软妹~` 提交于 2019-12-18 02:57:10
问题 Here is my problem, I have implemented a server side application using Red5, which sends H.264 encoded live stream, on client side the stream is received as byte[] In order to decode it on Android client side i have followed the Javacv-FFmpeg library. The code for decoding is as follows public Frame decodeVideo(byte[] data,long timestamp){ frame.image = null; frame.samples = null; avcodec.av_init_packet(pkt); BytePointer video_data = new BytePointer(data); avcodec.AVCodec codec = avcodec

Detect orientation of a recorded video in android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 02:41:29
问题 I want to make my custom media player and requires orientation info of video (for detecting it is recorded from front or back camera). for jpeg images i can use ExifInterface.TAG_ORIENTATION but for video how i can find this information. I tried to grab frame from video file and convert it into jpeg but again it always provides orientation 0 in all cases. Please help me. Thanks in advance. 回答1: Api level 17 later, we can extract the orientation of video: MediaMetadataRetriever

How to identify square or rectangle with variable lengths and width by using javacv?

余生颓废 提交于 2019-12-17 22:27:09
问题 I'm developing project using java to identify components using opencv package but I'm new to javacv and I just want to know how to identify rectangles in a particular source image please can some experience person give some basic guide line to archive this task. I try to use template matching on here but it can identify exact size rectangle only. But In my case I need to identify variable length rectangle ? import java.util.Arrays; import static com.googlecode.javacv.cpp.opencv_core.*; import