Recognize traffic signs in a photograph
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import glob
while (True):
red,frame = cv2.imread("14.jpg")
cv2.imshow("Frame", frame)
print(red)
if cv2.waitKey(1) == ord("q"):
break
cv2.destroyAllWindows()
cv2.imshow("Frame", frame)
^
IndentationError: unexpected indent
↧
Recognize traffic signs in a photograph
↧
datatype CV_16F in opencv.js
Hi everyone,
is it possible to enable the new datatype cv.CV_16F in the webassembly version of opencv 4.0?
I know that this is meant for GPU-based computing. However, given the fact that webassembly can nowadays only manage 2GB of RAM, a half precision float datatype could come in handy...
↧
↧
Unclear how calibrateCamera estimates stdDeviations (perhaps wrong)
Hi, I'm researching camera calibration and uncertainty propagation. I'm trying to understand how calibrateCameraExtended estimates stdDeviationsIntrinsics and stdDeviationsExtrinsics. [The docs](https://docs.opencv.org/ref/master/d9/d0c/group__calib3d.html#ga3207604e4b1a1758aa66acb6ed5aa65d) say very little.
So I go straight to the source code. Check [this lines of code](https://github.com/opencv/opencv/blob/00f36a261b09d6d6a89d41fb6268bceecd2e0dfd/modules/calib3d/src/calibration.cpp#L1798) where I understand the calculation is made.
It starts with `sigma2` (the "deviation of the noise") calculated as `norm(allErrors, NORM_L2SQR) / (total - nparams_nz);`
which is just the formula for the [unbiased estimator of the variance](https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation). Ok so far.
And then it calculates each `s`-element of the vector of standard deviations `stdDevsM` by
stdDevsM.at(s) = std::sqrt(JtJinv.at(j,j) * sigma2);
Where `JtJinv` is the pseudo-inverse of the jacobian calculated a few lines above from `_JtJ` which in turn comes from the
LM solver invoked in [previous lines](https://github.com/opencv/opencv/blob/00f36a261b09d6d6a89d41fb6268bceecd2e0dfd/modules/calib3d/src/calibration.cpp#L1689).
**First question:** what exactly is `_JtJ`? I assume it must be the 1xN Jacobian of the projection error with respect to the parameters (there are N parameters). I've tried to trace the calculation of all the way to its origin, I got
[this far](https://github.com/opencv/opencv/blob/00f36a261b09d6d6a89d41fb6268bceecd2e0dfd/modules/calib3d/src/calibration.cpp#L809)
, but I'm not sure.
**Second question:** The moore-penrose of a 1xN matrix is a Nx1 matrix. So calling `JtJinv.at(j,j)` with two indices `j` confuses me.
**Third question:** I couldn't make sense of the formula itself and I think It's wrong. The code has the comment
//see any papers about variance of the least squares estimator for
//detailed description of the variance estimation methods
But my understanding from simple [uncertainty propagation](https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Linear_combinations) for the case of uncorrelated parameters is that the Jacobian vector `_JtJ`, the variance of the projection error `sigma2` and the vector of parameters standard deviations `stdDevsM` should follow (in matlab-like pseudocode):
sigma2 = dot(_JtJ.^2, stdDevsM.^2)
Which is ill-conditioned, the simplest solution would be
stdDevsM = sqrt(sigma2) .*_JtJ ./ norm(_JtJ.^2)
Is my reasoning correct? and, where does the calculation implemented in OpenCV come from?
↧
pathname in imread()
I am giving a path name for img = cv2.imread('',1) but while checking print(img) I am getting none message
I am coping the pathname by using-shift+rt click and copy path to get it
but everytime I am getting a none message
how can I make it sure that the path name is correct
please advice
↧
Types of Mats and decision making
Hi,
I know that Mat has many different types, as detailed below.
Its puzzles my how one should decide which one of those to choose ?.
Just image quality ?
what is the correct way to convert from one to another ? (only convertTo method ?)
what is the main difference between unsigned to signed ? (besides the obvious..)
Thanks!
-----------------------------------------------------------------------------------------------------
CV_8U - 8-bit unsigned integers ( 0..255 )
CV_8S - 8-bit signed integers ( -128..127 )
CV_16U - 16-bit unsigned integers ( 0..65535 )
CV_16S - 16-bit signed integers ( -32768..32767 )
CV_32S - 32-bit signed integers ( -2147483648..2147483647 )
CV_32F - 32-bit floating-point numbers ( -FLT_MAX..FLT_MAX, INF, NAN )
CV_64F - 64-bit floating-point numbers ( -DBL_MAX..DBL_MAX, INF, NAN )
-----------------------------------------------------------------------------------------------------
8-bit unsigned integer (uchar)
8-bit signed integer (schar)
16-bit unsigned integer (ushort)
16-bit signed integer (short)
32-bit signed integer (int)
32-bit floating-point number (float)
64-bit floating-point number (double)
enum { CV_8U=0, CV_8S=1, CV_16U=2, CV_16S=3, CV_32S=4, CV_32F=5, CV_64F=6 };
From https://stackoverflow.com/questions/13428689/whats-the-difference-between-cvtype-values-in-opencv
↧
↧
Configuration Error CMake 3.15.14 opencv contrib
Selecting Windows SDK version 10.0.16299.0 to target Windows 6.1.7601.
Detected processor: AMD64
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.7")
Found PythonInterp: C:/Users/rplettner/AppData/Local/Programs/Python/Python38-32/python.exe (found suitable version "3.8", minimum required is "3.2")
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version "3.8.0")
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'numpy'
libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.1.2-dev-libjpeg-turbo
OpenCV Python: during development append to PYTHONPATH: D:/Bachelor/opencv4/python_loader
Caffe: NO
Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR) (found version "3.5.1")
Protobuf: NO
Glog: NO
freetype2: NO
harfbuzz: NO
Module opencv_ovis disabled because OGRE3D was not found
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
Module opencv_calib3d disabled because opencv_flann dependency can't be resolved!
Module opencv_objdetect disabled because opencv_calib3d dependency can't be resolved!
Module opencv_stitching disabled because opencv_calib3d dependency can't be resolved!
Module opencv_aruco disabled because opencv_calib3d dependency can't be resolved!
Module opencv_ccalib disabled because opencv_calib3d dependency can't be resolved!
Module opencv_datasets disabled because opencv_flann dependency can't be resolved!
Module opencv_optflow disabled because opencv_calib3d dependency can't be resolved!
Module opencv_rgbd disabled because opencv_calib3d dependency can't be resolved!
Module opencv_shape disabled because opencv_calib3d dependency can't be resolved!
Module opencv_stereo disabled because opencv_calib3d dependency can't be resolved!
Module opencv_superres disabled because opencv_optflow dependency can't be resolved!
Module opencv_surface_matching disabled because opencv_flann dependency can't be resolved!
Module opencv_text disabled because opencv_dnn dependency can't be resolved!
Module opencv_videostab disabled because opencv_calib3d dependency can't be resolved!
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
OpenCL samples are skipped: OpenCL SDK is required
General configuration for OpenCV 4.1.2-dev =====================================
Version control: unknown
Extra modules:
Location (extra): D:/Bachelor/opencv_contrib-master/modules
Version control (extra): unknown
Platform:
Timestamp: 2019-10-10T13:02:56Z
Host: Windows 6.1.7601 AMD64
CMake: 3.15.4
CMake generator: Visual Studio 15 2017
CMake build tool: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/Bin/MSBuild.exe
MSVC: 1911
CPU/HW features:
Baseline: SSE SSE2 SSE3
requested: SSE3
Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
SSE4_1 (15 files): + SSSE3 SSE4_1
SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (26 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
AVX512_SKX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
C/C++:
Built as dynamic libs?: YES
C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe (ver 19.11.25547.0)
C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP4 /MD /O2 /Ob2 /DNDEBUG
C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP4 /MDd /Zi /Ob0 /Od /RTC1
C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP4 /MD /O2 /Ob2 /DNDEBUG
C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP4 /MDd /Zi /Ob0 /Od /RTC1
Linker flags (Release): /machine:x64 /INCREMENTAL:NO
Linker flags (Debug): /machine:x64 /debug /INCREMENTAL
ccache: NO
Precompiled headers: YES
Extra dependencies:
3rdparty dependencies:
OpenCV modules:
To be built: core features2d highgui img_hash imgcodecs imgproc line_descriptor ml photo plot quality reg tracking ts video videoio xphoto
Disabled: bgsegm bioinspired dnn_objdetect dnn_superres dpm face flann fuzzy hfs java_bindings_generator phase_unwrapping python_bindings_generator python_tests saliency structured_light world xfeatures2d ximgproc xobjdetect
Disabled by dependency: aruco calib3d ccalib datasets objdetect optflow rgbd shape stereo stitching superres surface_matching text videostab
Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv dnn freetype gapi hdf java js matlab ovis python2 python3 sfm viz
Applications: tests perf_tests examples apps
Documentation: NO
Non-free algorithms: NO
Windows RT support: NO
GUI:
OpenGL support: NO
Media I/O:
ZLib: build (ver 1.2.11)
JPEG: build-libjpeg-turbo (ver 2.0.2-62)
PNG: build (ver 1.6.37)
TIFF: build (ver 42 - 4.0.10)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES
Video I/O:
GStreamer: NO
Parallel framework: Concurrency
Trace: YES (built-in)
Other third-party libraries:
Eigen: NO
Custom HAL: NO
Python (for build): NO
Install to: D:/Bachelor/opencv4/install
-----------------------------------------------------------------
Configuring done
↧
Camera Calibration Takes too long
Hey,
I am currently working on implementing open Cv/ARuco to Unity3D using C#.
I have managed to track the markers in 3d space and get the 3d pos (position/rotation).
However i noticed that the objects were skewed and didn't face the proper direction so i decided to calibrate the camera.
I have managed to understand and apply the right methods but when i call calibrate camera the program freezes for
9 minutes for 30 images or so.
That's ok on a laptop since it needs to run once however on my Iphone 7 i receive an out of memory exception.
I tried multithreading the work but still it didnt help much and as soon as i provide more then 3/4 images the application will run out of memory on an iphone 7.
I was wondering if there is some fix to this like some sort of parameter that reduces the time it takes for the calibrate camera method to finish.
↧
Guidline in building Object detection and its direction.
I am trying to build object detection and its direction ,The shape of Object can be anything. For example let say i am showing the water bottle or chocolate or any object in front of webcam and i want to detect the direction of object in which i am moving my object. So i need the guidline where to start and what to study for that i am new in opencv . I know python.
↧
C++ compilation issue migrating from 3.4.3 to 4.1.1 on Android
I am upgrading an Android JNI project from OpenCV 3.4.3 to 4.1.1.
When building an issue came out :
error: undefined reference to 'cv::dnn::dnn4_v20190621::Net::setInput(cv::_InputArray const&, std::string const&, double, cv::Scalar_ const&)'
Indeed when I look inside **libopencv_java4.so**, the name of the function is
void cv::dnn::dnn4_v20190621::Net::setInput(cv::InputArray, const cv::String &, double, const cv::Scalar &)
So the .so don't have the extras '_' characters : `_InputArray` vs `InputArray` and `Scalar_` vs `Scalar`
Any idea where the pb comes from ?
Others OpenCV modules seems okay but not the DNN module.
-------------
I am using CMake 3.6.0-rc2 on a Mac.
My CMakeLists.txt contains the following to link by target with the SHARED OpenCV Java library:
cmake_minimum_required(VERSION 3.6)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
add_library(lib_opencv SHARED IMPORTED)
set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}/libopencv_java4.so
------------
Executable : /Users/renaud/Library/Android/sdk/cmake/3.6.4111459/bin/cmake
arguments :
-H/Users/renaud/Documents/DEV/android-imaging/src/main/jni
-B/Users/renaud/Documents/DEV/android-imaging/.externalNativeBuild/cmake/debug/armeabi-v7a
-DANDROID_ABI=armeabi-v7a
-DANDROID_PLATFORM=android-22
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/renaud/Documents/DEV/android-imaging/build/intermediates/cmake/debug/obj/armeabi-v7a
-DCMAKE_BUILD_TYPE=Debug
-DANDROID_NDK=/Users/renaud/Library/Android/sdk/ndk-bundle
-DCMAKE_CXX_FLAGS=-frtti -fexceptions -std=c++11
-DCMAKE_TOOLCHAIN_FILE=/Users/renaud/Library/Android/sdk/ndk-bundle/build/cmake/android.toolchain.cmake
-DCMAKE_MAKE_PROGRAM=/Users/renaud/Library/Android/sdk/cmake/3.6.4111459/bin/ninja
-GAndroid Gradle - Ninja
-DANDROID_STL=c++_shared
-DANDROID_STL=gnustl_shared
-DANDROID_ARM_NEON=TRUE
jvmArgs :
↧
↧
Error: Cannot find NvOf library.
Using Samples of cudaoptflow, I am trying to run Nvidia Optical Flow sdk.
**code :**
while(1)
{
Mat frame;
cap >> frame; //read every frame
if(frame.empty())
break;
Mat reference_image = Mat::zeros(frame.size(), frame.type());
Ptr nvof = NvidiaOpticalFlow_1_0::create(
frame.size().width, frame.size().height, perfPreset,
true, false, false, gpuId);
Mat flowx, flowy, flowxy, upsampledFlowXY, image;
nvof->calc(frame, reference_image, flowxy);
nvof->upSampler(flowxy, frame.size().width, frame.size().height,
nvof->getGridSize(), upsampledFlowXY);
Mat planes[] = { flowx, flowy };
split(upsampledFlowXY, planes);
flowx = planes[0]; flowy = planes[1];
drawOpticalFlow(flowx, flowy, image, 10);
outputv.write(image);
char c = cv::waitKey(25);
if (c ==27)
break;
nvof->collectGarbage();
}
Error on running:
> **OpenCV(4.1.2) /docker/opencv_contrib-4.1.2/modules/cudaoptflow/src/nvidiaOpticalFlow.cpp:172: error: (-6:Unknown error code -6) Cannot find NvOF library. in function 'LoadNvidiaModules'**
**System :**
OPENCV - 4.1.2
Installed it inside docker container with cuda 10.1 : https://hub.docker.com/r/nvidia/cuda/
Image : nvidia/cuda
cuda_version : 10.1
OS: ubuntu18.04
Please help in understanding why it shows this error
↧
Can I use cv2.putText on a window without an image?
Or is there any alternatives for me to do so?
Thanks!
↧
Problems with Qt and dnn module
Hi people,
I am having problems with my Qt app where I declare "cv::dnn::Net net" object.
By just declaring it is enough to cause my app crash at runtime.
I use Qt5 and OpenCV 4.1.1 64 bits compiled from source using VS2017 with cuda.
I hope to get gelp.
Thank you very much
↧
What backend API to use with DAHENG MER-132 USB3 Vision camera
Hi,
I have a DAHENG MER-132 USB3 Vision camera which I am trying to access with opencv (python 3.7, Win 10).
I followed some example code to get my webcam working with `capture = cv.VideoCapture(0)` and works great. I figured `cv.VideoCapture(1)` would work for the next camera (external DAHENG MER-132 USB3) but opencv doesn't detect it
Device Manager detects the camera ok and reports it as "Machine Vision Digital Cameras / USB3 Vision Digital Camera, and the Daheng Galaxy Viewer software can display images ok, so hardware is working ok.
Is there a particular backend API I need to use with this type of camera?
If not, are there any other suggestions to get this camera working with opencv/python?
Thanks, Brendan.
↧
↧
Installing openCV from source troubles
Hi everyone,
I am an electrical engineering student who is looking to convert my computer vision project from MATLAB to Python and openCV but am having trouble doing so. I've gotten close with the installation but still can't quite get it, mostly because this is largely out of my field and I am learning on the go. The difficulty with installing it is somewhat coming from the fact I want to use SURF and SIFT detection which means I have to install it from source.
So I have downloaded both the openCV folder and opencv-contrib folder from github and am using cmake to build it on my 64x laptop for python2.7. I make a folder called build and use visual studio 2019 to configure the library. I select the options for 'non free' and select the module folder from inside opencv-contrib when I configure it. I then select generate and it of course makes the files that visual studio can build.
I'm finding after I ask visual studio to build it, that the folder appears in my python 2.7 folder as cv2, and I can import it in code in pycharm, but it does not seem successful. It does not know the names of any of the methods I call and warns that it cannot find it in the '__int__'. It can do things like imshow even though it warns me about it but when I tried to use a SURF object to draw keypoints from a tutorial it did not seem successful. I've had a lot of problem trying to install it as again, its all very new to me to do this and would love to have any help on the matter. If you need more information from me I'm more than happy to provide.
Kind Regards,
Nick
↧
Getting error with freeType -> putText function
I am getting an error
no matching function for call to ‘cv::freetype::FreeType2::putText(IplImage*&, cv::String&, CvPoint&, int&, cv::Scalar_, int&, int&, bool)
for the following code - (Here show_image is declared as `IplImage *show_image`)
ft2->putText( show_image, text, pt_text, fontHeight, cv::Scalar::all(0), baseline, linestyle, true );
↧
How to install OpenCV on Windows xp 32 bit
I'm using Windows xp 32bit, and I have installed python 3.4 on it.. But I'm getting problem to install OpenCV - python on my system. I have tried to copy .pyd file in site libraries too but still it's says couldn't find open cv.. So how to install it on Windows xp for python? And which version should I install? Please help me!!!!! T.T
↧
Building Error VS 2017
Hi I have some trouble with building my opencv on a windows.
I will attache the CMAKE log file and the Output build from VS2017.
Please rename the files to .txt
[C:\fakepath\cmakelog.jpg](/upfiles/15712911846343096.jpg)
[C:\fakepath\VSbuildLog.jpg](/upfiles/1571291207190056.jpg)
36>op_conv.cpp
36>op_lrn.cpp
36>op_permute.cpp
36>op_pool.cpp
48>utils.cpp
36>op_prior_box.cpp
48>opencl_kernels_rgbd.cpp
26>ImathVec.cpp
36>op_relu.cpp
48>opencv_rgbd_main.cpp
36>op_softmax.cpp
36>tensor.cpp
36>vk_functions.cpp
36>vk_loader.cpp
36>opencl_kernels_dnn.cpp
36>opencv_dnn_main.cpp
48>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_calib3d412d.lib'
48>Done building project "opencv_rgbd.vcxproj" -- FAILED.
49>------ Build started: Project: opencv_saliency, Configuration: Debug x64 ------
49>Building Custom Rule D:/Bachelor/opencv_contrib-master/modules/saliency/CMakeLists.txt
47>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_imgproc412d.lib'
47>Done building project "opencv_reg.vcxproj" -- FAILED.
50>------ Build started: Project: opencv_line_descriptor, Configuration: Debug x64 ------
49>opencv_saliency_pch.cpp
50>Building Custom Rule D:/Bachelor/opencv_contrib-master/modules/line_descriptor/CMakeLists.txt
49>CmFile.cpp
49>CmShow.cpp
49>FilterTIG.cpp
49>ValStructVec.cpp
26>IlmImf.vcxproj -> D:\Bachelor\opencv4\3rdparty\lib\Debug\IlmImfd.lib
50>opencv_line_descriptor_pch.cpp
51>------ Build started: Project: opencv_imgcodecs, Configuration: Debug x64 ------
49>objectnessBING.cpp
49>motionSaliency.cpp
49>motionSaliencyBinWangApr2014.cpp
49>objectness.cpp
49>saliency.cpp
49>staticSaliency.cpp
36>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_imgproc412d.lib'
49>staticSaliencyFineGrained.cpp
36>Done building project "opencv_dnn.vcxproj" -- FAILED.
52>------ Build started: Project: opencv_text, Configuration: Debug x64 ------
49>staticSaliencySpectralResidual.cpp
49>opencv_saliency_main.cpp
52>Building Custom Rule D:/Bachelor/opencv_contrib-master/modules/text/CMakeLists.txt
52>opencv_text_pch.cpp
51>Building Custom Rule D:/Bachelor/opencv-master/modules/imgcodecs/CMakeLists.txt
51>opencv_imgcodecs_pch.cpp
↧
↧
Meaning of Input Array and noArray()
Hi
In the wiki I found the following description of a function:
C++: Vec2d EM::predict(InputArray sample, OutputArray probs=noArray())
what does it mean exactly? I.e.
a) What exact type can "InputArray" be? A cv::Mat? or also a std::vector or also a simple C-style array?
b) What does the value noArray() specify? Is this a function? Or does it simply mean that I don't have to pass this argument because OpenCV can choose a default value here?
↧
KCF is not correctly finding tracked object
When I pass a frame and a bounding box to trackerKCF init the tracker properly initializes. If the tracked object has moved before calling the first update, the update returns a true and the bounding box is equal to the original bounding box. But that is not where the tracked object is. Also as the video progress and the object moves update track fails until the tracker is back in the location where the first update occurred. Then it does not fail.
I thought it was just my C# code and application so I "borrowed" the tracker example python script and tried that. I get the same behavior. If the racked object moves before the first update the returned rectangle matches the original bounding box coordinates but that is not where the object is. I am using OpenCV 4.1
I realize that this might be hard to explain. So I have uploaded a script and two short videos that demonstrate the behavior. [You will find them here.](https://cloud.rs-us.net/index.php/s/ktZTVjeWcBabjsO)
↧
does JetsonTX2 support CV.dnn ?
I ran this code [Real-time object detection with deep learning and OpenCV](https://www.pyimagesearch.com/2017/09/18/real-time-object-detection-with-deep-learning-and-opencv/), Numbers of the frame per second were low about 5.
I asked there yesterday about [OpenCV4Tegra doesn't support GPU ](https://devtalk.nvidia.com/default/topic/1064925/jetson-tx2/opencv4tegra-doesn-t-support-gpu/post/5392905/#5392905) the answer was that "OpenCV4Tegra in jetpack has disabled gpu for a long time"
I ran the code with three OpenCV versions are:
1- ros-kinetic-opencv3 .........CPU
2- OpenCV4Tegra.................CPU according to yesterday's answer.
3- OpenCV with GPU, I built it from source, everything is OK but all of the versions are very very slow and there is not any observable difference among them. the numbers of the frame per second about 3- 4.6
python
Python 2.7.12 (default, Oct 8 2019, 14:14:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.4.1-dev'
>>>
I bought the Jetson for getting a high frame per second.
believe me that the computer is faster than Jetson.
I guess that the reason is the installation of OpenCV was wrong!
my system:
NVIDIA Jetson TX2
L4T 28.2.1 [ 3.2.1 ]
Board: t186ref
Ubuntu 16.04.6 LTS
Kernel Version: 4.4.38-tegra
CUDA 9.0.252
sudo ./tegrastats
RAM 1238/7846MB (lfb 1339x4MB) CPU [0%@345,off,off,0%@345,1%@345,1%@345] EMC_FREQ 15%@204 GR3D_FREQ 0%@140 APE 150 BCPU@45.5C MCPU@45.5C GPU@44C PLL@45.5C Tboard@40C Tdiode@43C PMIC@100C thermal@44.9C VDD_IN 1757/1816 VDD_CPU 229/202 VDD_GPU 152/152 VDD_SOC 381/392 VDD_WIFI 57/78 VDD_DDR 443/441
You can see here
python
Python 2.7.12 (default, Oct 8 2019, 14:14:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.getBuildInformation())
General configuration for OpenCV 3.4.1-dev =====================================
Version control: 3.4.1-9-gec0bb66-dirty
Extra modules:
Location (extra): /home/nvidia/opencv_contrib/modules
Version control (extra): 3.4.1
Platform:
Timestamp: 2019-10-17T00:54:00Z
Host: Linux 4.4.38-tegra aarch64
CMake: 3.5.1
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: RELEASE
CPU/HW features:
Baseline: NEON FP16
required: NEON
disabled: VFPV3
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 5.4.0)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
ccache: NO
Precompiled headers: YES
Extra dependencies: dl m pthread rt /usr/lib/aarch64-linux-gnu/libGLU.so /usr/lib/aarch64-linux-gnu/libGL.so cudart nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cufft -L/usr/local/cuda-9.0/lib64
3rdparty dependencies:
OpenCV modules:
To be built: aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv datasets dnn dnn_objdetect dpm face features2d flann freetype fuzzy hdf hfs highgui img_hash imgcodecs imgproc java java_bindings_generator line_descriptor ml objdetect optflow phase_unwrapping photo plot python2 python3 python_bindings_generator reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto
Disabled: js world
Disabled by dependency: -
Unavailable: cnn_3dobj dnn_modern matlab ovis
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: NO
GUI:
QT: YES (ver 5.5.1)
QT OpenGL support: YES (Qt5::OpenGL 5.5.1)
GTK+: NO
OpenGL support: YES (/usr/lib/aarch64-linux-gnu/libGLU.so /usr/lib/aarch64-linux-gnu/libGL.so)
VTK support: YES (ver 6.2.0)
Media I/O:
ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.8)
JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver )
WEBP: /usr/lib/aarch64-linux-gnu/libwebp.so (ver encoder: 0x0202)
PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.2.54)
TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.0.6)
JPEG 2000: /usr/lib/aarch64-linux-gnu/libjasper.so (ver 1.900.1)
OpenEXR: /usr/lib/aarch64-linux-gnu/libImath.so /usr/lib/aarch64-linux-gnu/libIlmImf.so /usr/lib/aarch64-linux-gnu/libIex.so /usr/lib/aarch64-linux-gnu/libHalf.so /usr/lib/aarch64-linux-gnu/libIlmThread.so (ver 2.2.0)
Video I/O:
DC1394: YES (ver 2.2.4)
FFMPEG: YES
avcodec: YES (ver 56.60.100)
avformat: YES (ver 56.40.101)
avutil: YES (ver 54.31.100)
swscale: YES (ver 3.1.101)
avresample: NO
GStreamer:
base: YES (ver 1.8.3)
video: YES (ver 1.8.3)
app: YES (ver 1.8.3)
riff: YES (ver 1.8.3)
pbutils: YES (ver 1.8.3)
libv4l/libv4l2: 1.10.0 / 1.10.0
v4l/v4l2: linux/videodev2.h
gPhoto2: NO
Parallel framework: pthreads
Trace: YES (built-in)
Other third-party libraries:
Lapack: NO
Eigen: YES (ver 3.2.92)
Custom HAL: YES (carotene (ver 0.0.1))
Protobuf: build (3.5.1)
NVIDIA CUDA: YES (ver 9.0, CUFFT CUBLAS FAST_MATH)
NVIDIA GPU arch: 62
NVIDIA PTX archs:
OpenCL: YES (no extra features)
Include path: /home/nvidia/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
Python 2:
Interpreter: /usr/bin/python2.7 (ver 2.7.12)
Libraries: /usr/lib/aarch64-linux-gnu/libpython2.7.so (ver 2.7.12)
numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.11.0)
packages path: lib/python2.7/dist-packages
Python 3:
Interpreter: /usr/bin/python3 (ver 3.5.2)
Libraries: /usr/lib/aarch64-linux-gnu/libpython3.5m.so (ver 3.5.2)
numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.11.0)
packages path: lib/python3.5/dist-packages
Python (for build): /usr/bin/python2.7
Java:
ant: /usr/bin/ant (ver 1.9.6)
JNI: /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include
Java wrappers: YES
Java tests: YES
Matlab: NO
Install to: /usr/local
-----------------------------------------------------------------
please help me or any suggestions?
↧