Ask Your Question

Steven P. Goldsmith's profile - activity

2018-06-11 19:17:31 -0500 commented answer Creating Regions of Interest (ROI) by clustering fragmented contours

I corrected the link above. https://github.com/sgjava/install-opencv/tree/master/opencv-java/src/com/codeferm/opencv has

2018-06-11 19:14:03 -0500 edited answer Creating Regions of Interest (ROI) by clustering fragmented contours

I know this thread is old, but it's a common problem solved by http://www.pyimagesearch.com/2014/11/17/non-maximum-suppr

2018-06-11 19:13:34 -0500 edited answer Creating Regions of Interest (ROI) by clustering fragmented contours

I know this thread is old, but it's a common problem solved by http://www.pyimagesearch.com/2014/11/17/non-maximum-suppr

2018-03-06 03:11:58 -0500 received badge  Notable Question (source)
2017-12-12 10:47:49 -0500 edited question This encoder requires using the avcodec_send_frame() API

This encoder requires using the avcodec_send_frame() API Using opevcv 3.3.x dev from source (Ubuntu 16.04 on ARM) and I

2017-12-09 13:33:09 -0500 edited question This encoder requires using the avcodec_send_frame() API

This encoder requires using the avcodec_send_frame() API Using opevcv 3.3.x dev from source (Ubuntu 16.04 on ARM) and I

2017-12-09 12:55:57 -0500 asked a question This encoder requires using the avcodec_send_frame() API

This encoder requires using the avcodec_send_frame() API Using opevcv 3.3.x dev from source (Ubuntu 16.04 on ARM) and I

2017-03-12 10:42:50 -0500 received badge  Necromancer (source)
2017-03-02 10:53:04 -0500 answered a question Creating Regions of Interest (ROI) by clustering fragmented contours

I know this thread is old, but it's a common problem solved by http://www.pyimagesearch.com/2014/11/.... I've written something similar that will return multiple ROI based on moving average motion detection https://github.com/sgjava/install-ope...

image description

2017-03-02 08:58:54 -0500 asked a question VideoWriter.release lag

I built OpenCV 3.2.0-dev from source and I'm noticing that when I do VideoWriter.release in Python there's about a 10 second lag before the next statement is executed. Is there some type of internal buffer?

2016-05-21 08:20:08 -0500 asked a question OpenCV 3.1.0 contrib fails to build on ARM64

Building on ARMV8 platform I get:

 [ 29%] Building CXX object modules/dnn/3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/descriptor.cc.o
In file included from /home/test/opencv_contrib-3.1.0/modules/dnn/3rdparty/protobuf/src/google/protobuf/stubs/atomicops.h:59:0,
                 from /home/test/opencv_contrib-3.1.0/modules/dnn/3rdparty/protobuf/src/google/protobuf/stubs/once.h:81,
                 from /home/test/opencv_contrib-3.1.0/modules/dnn/3rdparty/protobuf/src/google/protobuf/descriptor.cc:53:
/home/test/opencv_contrib-3.1.0/modules/dnn/3rdparty/protobuf/src/google/protobuf/stubs/platform_macros.h:61:2: error: #error Host architecture was not detected as supported by protobuf
 #error Host architecture was not detected as supported by protobuf
2016-05-18 19:35:08 -0500 received badge  Self-Learner (source)
2016-05-18 19:15:23 -0500 answered a question Ubuntu 16.04 X86_64, -DWITH_QT=ON, OpenCV 3.1.0

Latest source worked, thanks for the comment!

2016-05-15 18:54:32 -0500 asked a question Ubuntu 16.04 X86_64, -DWITH_QT=ON, OpenCV 3.1.0

Using Ubuntu 16.04 X86_64 Desktop -DWITH_QT=ON and I get the errors below. -DWITH_QT=OFF and OpenCV and contrib build fine.

uname -a

4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

qmake --version

QMake version 3.0 Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

-DWITH_QT=ON

[ 72%] Linking CXX executable ../../bin/example_cvv_cvv_demo
../../lib/libopencv_cvv.so.3.1.0: undefined reference to `QComboBox::currentTextChanged(QString const&)'
../../lib/libopencv_cvv.so.3.1.0: undefined reference to `QFrame::sizeHint() const'
../../lib/libopencv_cvv.so.3.1.0: undefined reference to `vtable for cvv::qtutil::ShowInRawView'

(More unlinked references)

collect2: error: ld returned 1 exit status
modules/cvv/CMakeFiles/example_cvv_cvv_demo.dir/build.make:103: recipe for target 'bin/example_cvv_cvv_demo' failed
make[2]: *** [bin/example_cvv_cvv_demo] Error 1
CMakeFiles/Makefile2:8976: recipe for target 'modules/cvv/CMakeFiles/example_cvv_cvv_demo.dir/all' failed
make[1]: *** [modules/cvv/CMakeFiles/example_cvv_cvv_demo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
2015-12-29 15:28:07 -0500 answered a question OpenCV 3.1 x86 build not in opencv-3.1.0, where is it available?

You can build it on Ubuntu https://github.com/sgjava/install-opencv

2015-10-11 06:27:36 -0500 received badge  Popular Question (source)
2015-10-08 12:54:56 -0500 answered a question Opencv 3.0 java fatal error

I've seen this with building from master branch, Try source another day or try 3.0.0 release tag. Also, try another method signature and see if the same thing happens.

2015-10-08 12:53:23 -0500 received badge  Enthusiast
2015-10-07 13:31:10 -0500 asked a question ARM multicore support OpenCV 3.0.0

I've tried building OpenCV 3.0.0 on ODROID C1 using my script, but motion detection uses about 25% of all CPUs. The behavior is that most of the time 1 CPU is 100% and others times I see split between CPUs, but using no more than 25% of all the CPUs.

Using canny example it uses all 4 cores, but only uses about 50% of total capacity.

Using people detection it finally uses about 100% capacity.

I do not experience this issue using X86 with the same build script (both ARM and X86 use TBB), so I'm lead to suspect it could be something with the OS configuration, but I wanted to ask other's using Ubuntu and ARM. The ODROID shouldn't throttle the CPU until it hits 95C, but I'm never near that. Plus people detection works correctly spreading across all CPUs.

If I comment out all the code in motion detection and hit the first statement Imgproc.blur(mat, workImg, kSize) it sticks to one core and the other 3 are idle.

2015-05-11 19:30:40 -0500 commented answer Destroy Java 'Mat'-Object

See How to check for native memory leaks as an unpatched OpenCV 2.4.x or 3.0.0-dev will leak native memory since it relies on the finalize method which is generally bad practice. There's no guarantee if or when it will be called. I patch the Java source before and after compile to get access to the delete method which frees native memory.

2015-05-10 10:33:47 -0500 answered a question Java Calib3d.undistortImage OpenCV 3.0.0-dev

Use Imgproc class instead:

Imgproc.undistort(image, mat, cameraMatrix, distCoeffs, newCameraMtx);
2015-05-07 23:45:18 -0500 asked a question Java Calib3d.undistortImage OpenCV 3.0.0-dev

I'm able to run through frames and use calibrate methods in Calib3d, but when I call:

Calib3d.undistortImage(image, mat, newCameraMtx, distCoeffs);

I get:

Exception in thread "main" CvException [org.opencv.core.CvException: cv::Exception: /home/sgoldsmith/opencv-3.0.0/modules/calib3d/src/fisheye.cpp:409: error: (-215) (P.depth() == CV_32F || P.depth() == CV_64F) && (R.depth() == CV_32F || R.depth() == CV_64F) in function initUndistortRectifyMap ]

Looking at fisheye.cpp I see where it's failing the assertion:

CV_Assert((P.depth() == CV_32F || P.depth() == CV_64F) && (R.depth() == CV_32F || R.depth() == CV_64F));

and Java is calling:

private static native void undistortImage_1(long distorted_nativeObj, long undistorted_nativeObj, long K_nativeObj, long D_nativeObj);

It looks like P and R are not being passed or are incorrect format?

My parameters:

image: Mat [ 480*640*CV_8UC1, isCont=true, isSubmat=false, nativeObj=0x7f2088225040, dataAddr=0x7f2088536330 ]
newCameraMtx: Mat [ 3*3*CV_64FC1, isCont=true, isSubmat=false, nativeObj=0x7f2088226920, dataAddr=0x7f2088224fe0 ]
distCoeffs: Mat [ 5*1*CV_64FC1, isCont=true, isSubmat=false, nativeObj=0x7f2088285dd0, dataAddr=0x7f2088287e10 ]
2014-09-16 11:30:10 -0500 received badge  Critic (source)
2014-09-10 20:21:33 -0500 received badge  Editor (source)
2014-09-10 20:19:27 -0500 answered a question opencv 3.0.0-alpha build failure with tbb

I was able to figure this out after posting a bug.

Here's what I use now to get TBB enabled with OpenCV 3.0.0 master on GitHub:

x86

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_EIGEN=ON -D WITH_OPENGL=ON -D WITH_QT=OFF -D WITH_TBB=ON -D BUILD_SHARED_LIBS=ON -D BUILD_DOCS=ON -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON ..

armv7l

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_EIGEN=ON -D WITH_OPENGL=ON -D WITH_QT=OFF -D WITH_TBB=ON -D BUILD_SHARED_LIBS=ON -D BUILD_DOCS=ON -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON -D ENABLE_VFPV3=ON -D ENABLE_NEON=ON ..
2014-09-08 17:27:18 -0500 commented answer opencv 3.0.0-alpha build failure with tbb

The key here is -DBUILD_TBB=ON, if this is set the build will break regardless of the other settings.

2014-09-03 09:11:40 -0500 commented answer opencv 3.0.0-alpha build failure with tbb

Yea, TBB is essential for multi-core systems, even ARM. I'm happy to get all my Python and Java examples running. I'm sure TBB will be fixed over time. I'd rather not skip tests, but if I need to patch something I'm OK with that. I already patch the Java source and fix the memory leaks, etc.

2014-09-02 21:07:23 -0500 commented answer opencv 3.0.0-alpha build failure with tbb

BUILD_PERF_TESTS, BUILD_TESTS helped the build get to near 100%. I'm not using QT, so I'm not sure that's relevant. You can see I have Python and Java working using shared libs, but no TBB https://github.com/sgjava/install-opencv

2014-09-01 12:44:30 -0500 commented question opencv 3.0.0-alpha build failure with tbb

Perhaps, but this is the same build method I used with 2.4.9.0. Other than -DWITH_TBB=ON -DBUILD_TBB=ON, I'm not sure why the path would be different.

2014-08-28 17:57:41 -0500 asked a question opencv 3.0.0-alpha build failure with tbb

Ubuntu 14.04, x86_64 using:

cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON -DINSTALL_PYTHON_EXAMPLES=ON -DWITH_TBB=ON -DBUILD_TBB=ON -DWITH_V4L=ON -DWITH_OPENGL=ON -DWITH_OPENCL=ON -DWITH_EIGEN=ON -DWITH_OPENEXR=ON -DBUILD_JPEG=ON ..

make -j$(getconf _NPROCESSORS_ONLN)

fails with:

Linking CXX executable ../../bin/opencv_test_flann
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::initialize(int)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task::note_affinity(unsigned short)'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::internal::handle_perror(int, char const*)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_group_context::is_group_execution_cancelled() const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::terminate()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `typeinfo for tbb::task'
../../lib/libopencv_core.so.3.0.0: undefined reference to `vtable for tbb::task'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_group_context::init()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::default_num_threads()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::initialize(int, unsigned long)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_group_context::~task_group_context()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_test_flann] Error 1
make[1]: *** [modules/flann/CMakeFiles/opencv_test_flann.dir/all] Error 2

If I disable TBB build makes it 100%.

2014-07-11 20:24:53 -0500 commented question People detection using motion ROI

You can post questions on the GitHub site.

2014-07-11 20:24:20 -0500 answered a question People detection using motion ROI

You can post questions on the GitHub site.

2014-01-08 15:27:41 -0500 commented answer Install OpenCV on Ubuntu fail Java directory

To tell if it's OK without examples try:

ffmpeg (you should get ffmpeg version)

pkg-config --modversion opencv (you should get OpenCV version)

You can upgrade to OpenCV 2.4.8.0 by following https://github.com/sgjava/install-opencv#upgrades

2014-01-07 12:31:54 -0500 commented answer Install OpenCV on Ubuntu fail Java directory

No problem, I figure it's better to automate the many steps rather than a manual how-to process. Both Java and Python bindings are generated.

2014-01-07 11:00:32 -0500 commented answer Install OpenCV on Ubuntu fail Java directory

I'm not promoting a framework. If you actually took the time to look at the readme you'd see that it's an install script that actually works.

2014-01-07 09:52:11 -0500 answered a question Install OpenCV on Ubuntu fail Java directory

I'm not promoting a framework. If you actually took the time to look at the readme you'd see that it's an install script that actually works.

2014-01-06 18:43:57 -0500 answered a question Install OpenCV on Ubuntu fail Java directory
2014-01-06 13:32:14 -0500 asked a question Multiple architecture OpenCV install script plus Java patch

install-opencv

Please take a look at my install script and let me know if you run into any issues. A lot of the scripts online require the old libopencv-dev packages. The other problem I've found with other scripts is building ffmpeg. It's a trial and error process to get the compile args correct across various platforms. Linux on ARM is supported without the need for Android.

Platforms Supported by Install OpenCV

  • Ubuntu 12.04.3 LTS x86_64
  • Ubuntu 12.04.3 LTS x86
  • Ubuntu 12.10 armv7l (PicUntu 0.9 RC3)

Provides

  • FFMPEG from source (x264, fdk-aac, libvpx, libopus)
  • OpenCV from source
  • Java 7 and Apache Ant
    • Patch gen_java.py to generate missing VideoWriter class and add some missing CV_CAP_PROP constants
    • FourCC class
    • CaptureUI Applet to view images/video since there's no imshow with the bindings
  • Java and Python examples
    • Capture UI
    • Motion detection
    • People detection
2014-01-06 12:48:40 -0500 asked a question Why are OpenCV archive types different for various releases?

Why are there differences in the Linux version of OpenCV when it comes to packaging? 2.4.8 is a zip, 2.4.7 is a tar.gz, 2.4.4 is a tar.bz2. This makes it difficult to script the install unless you build a universal extractor. Why not just stay with one format?

http://sourceforge.net/projects/opencvlibrary/files/opencv-unix

2013-11-25 12:36:31 -0500 received badge  Student (source)
2013-09-25 14:27:19 -0500 asked a question People detection using motion ROI

People ROI compares and contrasts using image resizing and motion detection to obtain a ROI (region of interest) versus processing frames and regions unchanged. People detection is used in this example, but any type of image analysis can benefit from the techniques presented. Performance gains are in the 10 to 100 times range. My goal is to make people detection real-time on low end hardware without using hardware/software specific hacks (i.e. UncannyCV). The code is in Python and OpenCV 2.4.6.1 was used.

The wiki has installation instructions and techniques used.