Ask Your Question

Indira's profile - activity

2016-11-28 15:26:37 -0500 commented question Opencv java vs C++ in video capture

We moved to C++ due to different reasons. not using Java anymore. please see the above answer given by berak. I'm not from support team.im just user here..

2016-06-27 09:49:09 -0500 received badge  Self-Learner (source)
2016-06-27 07:54:36 -0500 answered a question find if line and polygon are intersecting in java opencv
    // Draw white colored line on black pixel Image for the given slot
    Mat lineFrame=blackImage.clone();
    Imgproc.line(lineFrame, start, end, new Scalar(255,255,255), 4);  

    // Draws white colored detected contour of moving loco on black pixel image
    Mat contourFrame=blackImage.clone();
    Imgproc.drawContours(contourFrame, array, array.indexOf(matImage), new Scalar(255, 255, 255));   

    // BitWise_and of line and contour gives the intersection points
    Mat result= new Mat();
    Core.bitwise_and(lineFrame, contourFrame, result);

    // Counts num of non zero pixels (intersection points)
    int count=Core.countNonZero(result);
    if(count>0){
        System.out.println("Intersected "+count);
        return true;
    }
    else{
        return false;
    }
2016-06-24 17:18:27 -0500 commented answer find if line and polygon are intersecting in java opencv

Thank you. Solved it. but not based on contours. Using countNonZero. this time i drew poligon and line on blank image and found count.

2016-06-22 20:50:25 -0500 asked a question find if line and polygon are intersecting in java opencv

I need help in opencv java. Is there any java api that finds if a line and polygon are intersecting?

It would be very helpful if anyone could answer this asap. thanks in Advance.

2016-06-05 16:55:38 -0500 asked a question Opencv java vs C++ in video capture

I'm creating a project that needs to capture live camera video feeds continuously all the time and does processing on each frame. Processing involves locating a particular object of interest when it is moving. i have done this project using Opencv java wrappers videocapture,BackgroundSubtracterMOG etc. I was successful in doing this and happy about it.

I have tested my application using 4 threads and each thread reading a different video and processing frames. my machine configuration is 4.00 GB RAM and 64 bit OS and Intel Core i5 . The results were not bad. i have not tested it yet on real time camera feeds though. In future we may have to increase number of threads based on no of cameras we use.

Recently i was questioned about speed overhead of reading videos using java compared C++.
i know there would be slight speed overhead while using Java wrappers compared to C++ calls.

1) but I want to understand how big is the impact and need a suggestion if i really need to switch to c++ esp for continuous capture of video frames as explained above and re-implement the same code in C++? . I'm completely new to c++ and i have to learn c++ and re-implement it again.

2) if i have to switch to C++, then why the video capture wrappers were provided in java ?.

3) And also I observed in java version that when i reduce the frame size of video captured the speed got improved significantly. so what is it really that impacts the performance in video capture?

This is very important for me right now. It would be very helpful if i could get answer ASAP . Thanks in Advance.

2016-06-02 16:46:18 -0500 received badge  Student (source)
2016-06-02 13:20:34 -0500 asked a question BackgroundSubtractorMOG2 errors in java

I'm using BackgroundSubtractorMOG2 bmog=org.opencv.video.Video.createBackgroundSubtractorMOG2(100, 30, false) in my java code for detecting movements in a video. Though it shows the movements i get the following errors when it is run.
whats the below error ?
I need to detect specific objects movements in a video.Is there any better way of detecting movements in a video other than the above api?

OpenCL program build log: -D CN=3 -D NMIXTURES=5 -D SHADOW_DETECT -D INTEL_DEVICE :161:13: error: call to 'mad' is ambiguous T_MEAN dD = mad(a, c_mean, -pix); ^~~ <stdin>:1677:37: note: candidate function float __attribute__((overloadable)) mad(float a, float b, float c); ^ <stdin>:1680:38: note: candidate function float4 __attribute__((overloadable)) mad(float4 a, float4 b, float4 c); ^ :201:11: error: call to 'mad' is ambiguous meanVal = mad(c_weight, c_mean, meanVal); ^~~ <stdin>:1677:37: note: candidate function float __attribute__((overloadable)) mad(float a, float b, float c); ^ <stdin>:1680:38: note: candidate function float4 __attribute__((overloadable)) mad(float4 a, float4 b, float4 c); ^ 6 diagnostics generated.

Can some one help me on this please?

2016-05-25 15:31:14 -0500 asked a question Video capture of multiple cameras

I need to work on a requirement that needs reading multiple camera (around 20 cameras) feeds using multi threading.

  • Is there any limitation on number of cameras that can be used?

  • are there any specification for type of cameras to use or any camera would work in video capture?

  • I want to understand how cameras are indexed as 0,1,2.. in video capture. and how do i identify cameras based on index? because i need to define specific properties for each camera based on its location.

  • are these indexes always same for each camera even when application is restarted?

I do not have multiple cameras available now to test these. i just want to understand before proceeding.**

2016-04-13 14:23:54 -0500 commented answer How different is Open CV train cascading from IBM Visual Recognition

I'm new to this area.Could you just brief me about the difference between object and scene recognition.i was thinking that we train the classifier and use that to detect object interest in a image/video. when I saw the same kind implementation in https://visual-recognition-demo.myblu... i got this doubt. please brief the difference between these two.

2016-04-12 09:13:29 -0500 received badge  Enthusiast
2016-04-11 14:30:03 -0500 asked a question How different is Open CV train cascading from IBM Visual Recognition

How different is Open CV train cascading from IBM Visual Recognition ? Is IBM visual recognition using open CV internally? . IBM is providing a service to get the classifier. i could see that it gives only score and the object name.But does it give the annotation of the object where it is located ? For my requirement i need to identify and annotate (location) the object of interest in a video. So i want to understand the differences between these two and need to decide which is best way to go with whether to create our own trained classifier xml or to use IBM service for it.

2016-04-08 15:25:44 -0500 asked a question Compilation fails for text module in OpenCV

i found that there is a module for text detection implemented by openCV. https://github.com/Itseez/opencv_cont... I'm trying to compile this module with opencv 2.4.1. all the modules are compiling except the text module. I'm new to cpp .please let me know if i'm missing anything while compiling.

I getting so many errors with this while compiling. Following are few of the errors. ......\modules\text\src\erfilter.cpp(64): error C2039: 'ml' : is not a member of 'cv' 19>......\modules\text\src\erfilter.cpp(64): error C2871: 'ml' : a namespace with this name does not exist 19>......\modules\text\src\erfilter.cpp(66): error C2039: 'ml' : is not a member of 'cv' 19>......\modules\text\src\erfilter.cpp(66): error C2871: 'ml' : a namespace with this name does not exist

\modules\text\src\erfilter.cpp(1031): error C2653: 'Error' : is not a class or namespace name 19>......\modules\text\src\erfilter.cpp(1031): error C2065: 'StsBadArg' : undeclared identifier 19>......\modules\text\src\erfilter.cpp(1035): error C2653: 'Error' : is not a class or namespace name 19>......\modules\text\src\erfilter.cpp(1035): error C2065: 'StsBadArg' : undeclared identifier 19>......\modules\text\src\erfilter.cpp(1046): error C2653: 'DTrees' : is not a class or namespace name 19>......\modules\text\src\erfilter.cpp(1046): error C2065: 'PREDICT_SUM' : undeclared identifier 19>......\modules\text\src\erfilter.cpp(1046): error C2039: 'RAW_OUTPUT' : is not a member of 'CvStatModel'

odules\text\src\erfilter.cpp(3215): error C2665: 'cv::abs' : none of the 2 overloads could convert all the argument types 19> D:\CV-ALL\opencv2-dup\opencv\modules\core\include\opencv2/core/mat.hpp(1410): could be 'cv::MatExpr cv::abs(const cv::Mat &)' 19> D:\CV-ALL\opencv2-dup\opencv\modules\core\include\opencv2/core/mat.hpp(1411): or 'cv::MatExpr cv::abs(const cv::MatExpr &)' 19> while trying to match the argument list '(float)'

modules\text\src\ocr_beamsearch_decoder.cpp(57): error C2039: 'ml' : is not a member of 'cv' 19>......\modules\text\src\ocr_beamsearch_decoder.cpp(57): error C2871: 'ml' : a namespace with this name does not exist 19>......\modules\text\src\ocr_beamsearch_decoder.cpp(565): error C2653: 'Error' : is not a class or namespace name 19>......\modules\text\src\ocr_beamsearch_decoder.cpp(565): error C2065: 'StsBadArg' : undeclared identifier 19>......\modules\text\src\ocr_beamsearch_decoder.cpp(692): error C2653: 'Error' : is not a class or namespace name 19>......\modules\text\src\ocr_beamsearch_decoder.cpp(692): error C2065: 'StsOutOfRange' : undeclared identifier 19> ocr_hmm_decoder.cpp

2016-04-05 14:06:33 -0500 received badge  Editor (source)
2016-04-05 14:06:07 -0500 asked a question while running opencv_traincascade.exe ,numPos is always taking a value as 2000 instead of taking the passed value

Following is the command with parameters i have been trying to create classifier. opencv_traincascade.exe -data trained_classifiers -vec final1.vec -bg negatives.txt -numpos 80 -numNeg 12 -numStages 10 -precalcValBufSize 200 -precalcIdxBufSize 1000 -minHitRate 0.995 -maxFalseAlarmRate 0.5 -w 20 -h 20

Info about Image used : positive image used :8 ( size 380x187) negative images used :12 ( size 380x187) Positive Samples generated :96 , created VEC file using 96 images.

Command used to create Postive Samples . i have repeated this command for 8 images. opencv_createsamples -img positive_images\Image1.jpg -bg negatives.txt -info ps1\info1.txt -maxxangle 0.1 -maxyangle 0.1 -maxzangle 0.1 -bgcolor 255 -bgthresh 8 -w 20 -h 20

Command used to create vec file opencv_createsamples -info info.txt -bg negatives.txt -vec final1.vec -num 96 -w 20 -h 20

It generated VEC file with 96 files. But when i run the opencv_traincascade.exe as given intially, it displays the parameters and the error message as below and crashes at stage 0 . Though i have given numpos as 80, it is always showing as 2000 when the command was run. please help me in this where i'm doing wrong. I'm stuck with this and not able to proceed. I could not find solution anywhere.

PARAMETERS: cascadeDirName: trained_classifiers vecFileName: final1.vec bgFileName: negatives.txt numPos: 2000 numNeg: 12 numStages: 10 precalcValBufSize[Mb] : 200 precalcIdxBufSize[Mb] : 1000 acceptanceRatioBreakValue : -1 stageType: BOOST featureType: HAAR sampleWidth: 20 sampleHeight: 20 boostType: GAB minHitRate: 0.995 maxFalseAlarmRate: 0.5 weightTrimRate: 0.95 maxDepth: 1 maxWeakCount: 100 mode: BASIC

===== TRAINING 0-stage ===== <begin pos="" current="" samples:="" 1="" pos="" current="" samples:="" 2="" ........="" .......="" pos="" current="" samples:="" 96<="" p="">

OpenCV Error: Bad argument (Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file. in CvCascadeImageReader::PosReader::get, file C:\builds\2_4_PackSlave-win32-vc12-shared\opencv\apps\traincascade\imagestorage.cpp, line 154

Qs 1.Why is numpos is taking 2000 instead of 80 ? and 2. why is it crashing ?