javacv

OCR with javacv

烂漫一生 提交于 2019-12-06 03:19:24
I am making an OCR for my project and stuck on a point, Right now i am performing segmentation on the basis of contours its working fine with few images but there few more where it fails even when the image quality is good, I would appreciate if someone suggest me more accurate way, and if someone provide a code example, here is my current code. public static void imageBinarization(IplImage src, IplImage dst){ IplImage r, g, b, s; r = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 1); g = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 1); b = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 1); cvSplit

JavaCV video recorder orientation is not proper in portrait mode

▼魔方 西西 提交于 2019-12-05 20:51:43
问题 Hi i am using https://github.com/bytedeco/javacv/ for recording video. When using landscape mode orientation is fine but when i change the orientation to portrait mode the video is rotated -90 degree. Any body have an idea what i may be doing wrong. Here is the code. package org.bytedeco.javacv_android_example.record; import android.app.Activity; import android.content.Context; import android.content.pm.ActivityInfo; import android.hardware.Camera; import android.hardware.Camera

can't find dependent library javacv

眉间皱痕 提交于 2019-12-05 18:13:15
I have this code: package javacv; import static com.googlecode.javacv.cpp.opencv_core.*; import static com.googlecode.javacv.cpp.opencv_imgproc.*; import static com.googlecode.javacv.cpp.opencv_highgui.*; import javax.swing.JOptionPane; /** * * @author (Mahdi) */ public class JavaCv { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here try { IplImage img = cvLoadImage("mehdi.jpg"); cvShowImage("Hellow", img); cvSmooth(img, img, CV_GAUSSIAN, 13); cvShowImage("Blur", img); cvWaitKey(); cvReleaseImage(img); } catch

How to capture and record video from webcam using JavaCV

≡放荡痞女 提交于 2019-12-05 05:39:13
问题 I'm new to JavaCV and I have difficult time finding good tutorials about different issues on the topics that I'm interested in. I've succeed to implement some sort of real time video streaming from my webcam but the problem is that I use this code snippet which I found on the net : @Override public void run() { FrameGrabber grabber = new VideoInputFrameGrabber(0); // 1 for next // camera int i = 0; try { grabber.start(); IplImage img; while (true) { img = grabber.grab(); if (img != null) {

How to do canny edge detection in javacv/opencv?

烂漫一生 提交于 2019-12-05 05:06:35
问题 I'm currently working on image processing project and I need to detect edges from image. I thought to use canny edge detection for detect lines of the image, So i searched about canny edge detection using javacv on internet and I found some tutorials which gives the basic idea about canny edge detection technique but I could not be able to find any sample code regarding this. Please can someone provide simple sample edge detection code ? It’s really appreciate if you can provide code example

FFmpegFrameRecorder videoBroadcasting audio comes faster than video frame in 3G Network

我怕爱的太早我们不能终老 提交于 2019-12-05 02:44:59
问题 I'm using FFmpegFrameRecorder for video broadcast.Problem is audio comes faster than video frame.I'm using following code but unable to produce complete video there is problem in audio video timestamp. Java Code: import static com.googlecode.javacv.cpp.opencv_core.IPL_DEPTH_8U; import java.io.IOException; import java.nio.ShortBuffer; import android.app.Activity; import android.content.Context; import android.content.pm.ActivityInfo; import android.graphics.Bitmap; import android.graphics

How to edit this method to draw polygon using javacv?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 02:39:22
问题 I went through many turorials and cupple of questions in stackoverflow and I found following method which used to draw rectangles. public static void drawSquares( IplImage image, final CvSeq squares ) { if(!squares.isNull()){ CvSeq p = new CvSeq(squares.total()); cvCvtSeqToArray(squares, p, CV_WHOLE_SEQ); System.out.println(squares.total()); for(int i = 0; i < squares.total(); i ++ ) { CvPoint pts = new CvPoint(4); cvCvtSeqToArray(p.position(i), pts, CV_WHOLE_SEQ); // //cvBoundingRect(image,

identify contours in a image which are having same color using opencv or javacv?

早过忘川 提交于 2019-12-04 23:17:36
This question is related to my previous question in that question I used color image as input and it identify by using line color but I like to know how to identify that kind of image using gray-scale image. This is the gray-scale input image and have to identify And I need to identify following objects with its positions (x and y coordinates). Please can some one explain with simple code example to identify those objects and I need to identify connected lines of those objects as well (As shown in following image). Please be kind enough to explain this using simple code example. The concept of

Converting OpenCV matrix looping to JavaCV

ε祈祈猫儿з 提交于 2019-12-04 23:12:39
问题 Got the book 'Learning OpenCV' by O'Reilly not long ago, and since then I have been busy converting all of the example code I see there from OpenCV to JavaCV, usually followed by a little of my own modification too. All the while, I'm trying to keep to the pure OpenCV (C language) code as much as possible and avoid Java. For example, I implemented all of the interface elements directly through the OpenCV highgui package in JavaCV, rather than via Java Swing. By doing this I hope to both learn

Display two videos together then output as a merged video on a single screen

匆匆过客 提交于 2019-12-04 17:42:11
问题 This question may sound a little bit complex or ambiguous, but I'll try to make it as clear as I can. I have done lots of Googling and spent lots of time but didn't find anything relevant for windows. I want to play two videos on a single screen. One as full screen in background and one on top of it in a small window or small width/height in the right corner. Then I want an output which consists of both videos playing together on a single screen. So basically one video overlays another and