opencv3.0

OpenCV unable to set up SVM Parameters

為{幸葍}努か 提交于 2019-11-27 09:09:44
I have just started my learning on SVM using C++ OpenCV and was referring to the SVM documentation here . I wanted to try out the sample source code from the link to get familiar with it first but I couldn't run the sample source code. It returns the error : Error 1 error C2065: 'CvSVMParams' : undeclared identifier I'm using Visual Studio 2012 with OpenCV 3.0.0. The setup process should be correct as all other codes are working well except this. Miki A lot of things changed from OpenCV 2.4 to OpenCV 3.0 . Among others, the machine learning module, which isn't backward compatible. This is the

OpenCV 3.0 Can't load neural network

一笑奈何 提交于 2019-11-27 07:57:31
问题 I need to use a neural network in my OpenCV (version 3.0) project. I've created and trained neural network and it works, but if I want to load neural network from YML file, it doesn't predict. This is a code where I creat, train and save my neural network: FileStorage fs("nn.yml", FileStorage::WRITE); int input_neurons = 7; int hidden_neurons = 100; int output_neurons = 5; Ptr<TrainData> train_data = TrainData::loadFromCSV("data.csv", 10, 7, 12); Ptr<ANN_MLP> neural_network = ANN_MLP::create(

OpenCV Error: (-215)size.width>0 && size.height>0 in function imshow

六月ゝ 毕业季﹏ 提交于 2019-11-27 05:50:57
问题 I am trying to make a face tracker that combines Haar Cascade Classification with Lucas Kanade good feature detection. However, I keep getting an error that I cannot figure out what it means nor how to solve it. Can anyone help me here? Error: line 110, in <module> cv2.imshow('frame',img) error: /build/buildd/opencv-2.4.8+dfsg1/modules/highgui/src/window.cpp:269: error: (-215)size.width>0 && size.height>0 in function imshow Code: from matplotlib import pyplot as plt import numpy as np import

How to get color palette from image using opencv? [closed]

一笑奈何 提交于 2019-11-27 05:23:12
I'd like to extract the color palette of an image, similar to this (from here ): I need it to extract specific colors like yellow, green, and brown and display the percentage of the area covered by that color. Also, I can add more colors to extract. How can I reduce the number of colors in the original image, and how can I get the color palette? Miki There are 3 different things going on here. Reduce the number of colors of an image Get the different colors of an image Get the color name Reduce the number of colors There are many techniques to reduce the number of colors. Here you can see how

OpenCV 3.x only contains one lib - opencv_world.lib?

柔情痞子 提交于 2019-11-27 02:36:22
问题 I'm trying to update my OpenCV version from 2.4.9 to the newest version, 3.10. I downloaded the Windows binary from here, having navigated there from the official OpenCV site. I then ran the installer, but the opencv\build\x64\vc12\lib directory only contained a couple files: opencv_world310.lib opencv_world310d.lib OpenCVConfig.cmake OpenCVModules.cmake OpenCVModules-debug.cmake OpenCVModules-release.cmake In the past editions though, this directory used to contain the required libraries,

Convert a single color with cvtColor

心不动则不痛 提交于 2019-11-27 02:06:28
I have a color that I want to convert to a different color space. Is it possible to use cvtColor on a cv::Vec3f directly without creating a 1x1 cv::Mat and populating it with that pixel, using cvtColor on the cv::Mat , then getting the only pixel out of the output? I have tried the following, but it doesn't seem to like getting passed a vector. Any suggestions? #include <iostream> #include <opencv2/opencv.hpp> int main(int, char*[]) { cv::Vec3f hsv; hsv[0] = .9; hsv[1] = .8; hsv[2] = .7; std::cout << "HSV: " << hsv << std::endl; cv::Vec3b bgr; cvtColor(hsv, bgr, CV_HSV2BGR); // OpenCV Error:

How to translate this image processing from Matlab to OpenCV?

房东的猫 提交于 2019-11-26 23:17:54
问题 The link below use Matlab to remove non-text content from an image. I want to do the same thing with OpenCV in Java. I don't have a Matlab to try with and I am new to OpenCV. Though I know some basics about the theory behind the process, but it's kind of difficult to make the translation from Matlab language into OpenCV 3.0. And preferably in Java. http://www.mathworks.com/help/vision/examples/automatically-detect-and-recognize-text-in-natural-images.html ADD 1 - region detection with MSER

How can I get the position and draw rectangle using opencv?

99封情书 提交于 2019-11-26 23:12:30
I want to get a position when move and click mouse in picturebox. I want to create rectangle in the image window when and where a mouse is clicked. I have a simple code from document #include "stdafx.h" #include "opencv2/highgui/highgui.hpp" #include <iostream> using namespace std; using namespace cv; void CallBackFunc(int event, int x, int y, int flags, void* userdata) { if ( event == EVENT_LBUTTONDOWN ) { cout << "Left button of the mouse is clicked - position (" << x << ", " << y << ")" << endl; } else if( event == EVENT_RBUTTONDOWN ) { cout << "Right button of the mouse is clicked -

OpenCV vs Matlab : Different Values on pixels with imread

戏子无情 提交于 2019-11-26 20:17:28
问题 I have encountered a problem with the function imread() in Matlab (2014) and OpenCV (3.0) on Windows 7 with jpg files. I don't have the same values by reading the same file jpg and the same pixel. Here are my 2 codes : (OpenCV code followed by the Matlab code) and the values I have (mode debug to see in OpenCV, keyboard in Matlab) #include <opencv2\opencv.hpp> #include <cstdio> using namespace cv; using namespace std; int main() { Mat img = imread("test.jpg"); uchar pb = img.at<Vec3b>(0, 0)

'unresolved external symbol' error when linking with OpenCV 3.0

白昼怎懂夜的黑 提交于 2019-11-26 17:57:57
I build the OpenCV 3.0 from source. And with the contrib repo for some extra modules. And I manually setup my VS2013 project to use the generated lib files. My code is simple for now: #include "opencv2\core\core.hpp" #include "opencv2\imgcodecs\imgcodecs.hpp" int _tmain(int argc, _TCHAR* argv[]) { cv::Mat image = cv::imread("img.jpg"); return 0; } But it gave me these errors when in VS 2013 community version: I see similar thread , they said it is caused by the x86/x64 issue. But My project is already x86. And the OpenCV I built is also targeting x86 (see below). What reason could it be? ADD 1