opencv3.0

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

本秂侑毒 提交于 2019-12-17 07:42:06
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . 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

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

谁说我不能喝 提交于 2019-12-17 06:18:17
问题 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 << ")" <<

'unresolved external symbol' error when linking with OpenCV 3.0

僤鯓⒐⒋嵵緔 提交于 2019-12-17 04:07:17
问题 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

What's the best way to greyscale in python/django?

三世轮回 提交于 2019-12-14 03:28:12
问题 I want to greyscale my images that will be uploaded into django. So I found two ways, either opencv or imagemagick. And within imagemagick, imagemagickWand might be better because it's reduced. From the tutorials I think openCV is easier to implement. Any ideas? 回答1: What's the best way to greyscale in python/django? Take your pick. ImageMagick's wand library from wand.image import Image with Image(filename='logo:') as img: img.colorspace = 'gray' img.save(filename='logo_gray.jpg') Or CV2

OpenCV: detectMultiScale() gives too many points out of the object

岁酱吖の 提交于 2019-12-14 01:44:22
问题 I trained my pc with opencv_traincascade all one day long to detect 2€ coins using more than 6000 positive images similar to the following: Now, I have just tried to run a simple OpenCV program to see the results and to check the file cascade.xml . The final result is very disappointing: There are many points on the coin but there are also many other points on the background. Could it be a problem with my positive images used for training? Or maybe, am I using the detectMultiScale() with

Building OpenCV 3.0.0-beta Windows Python 3.4

不羁岁月 提交于 2019-12-14 00:26:33
问题 I wish to get OpenCV working on my Windows 7 x64 for Python 3.4. Even though the OpenCV 3 Alpha page states that there is Python 3 support (http://opencv.org/opencv-3-0-alpha.html), the pre-compiled package only contains opencv/build/python/2.7 and no 3(.4). So following the answer on How to use OpenCV in python 3.4 on windows 7 x64?, I'm trying to build OpenCV 3.0.0 from source following the following tutorial: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install

how to draw a line in a video with opencv 3.0.0 using c++

泪湿孤枕 提交于 2019-12-13 10:01:11
问题 Please let me know if you have any If you have a source code to draw a line in a video with opencv 3.0.0 using c++ cordially 回答1: First of all you should consider that a video is basicly just some images displayed quickly after each other. Therefor you only need to know how to draw a line onto an image to draw it in a video (do the same for each frame). The cv::line function is documented here : http://docs.opencv.org/3.0-beta/modules/imgproc/doc/drawing_functions.html. int main(int argc,

How to combine a RGB image with a Grayed image in opencv?

白昼怎懂夜的黑 提交于 2019-12-13 07:30:03
问题 I refered this link to combine two images, and it works if both images are being RGB formated Combining Two Images with OpenCV The question is how to combine a RGB image with a Grayed image, since the RGB image is three dimensions but gray image is two dimensions? 回答1: RGB images are 3-dimensional whereas grayscale images are 2-dimensional. In order for the combination to be possible, you need to add one dimension to the grayscale image. If x is a 2-dimensional array x , the simplest way to

How to use OpenCv utilities in Command prompt

ぐ巨炮叔叔 提交于 2019-12-13 07:24:26
问题 I am doing object detection in images using OpenCv library in Java Eclipse. I am using Cascade Classifier Training for this using Haar features. For training the classifier I need to generate some text files, .vec file and finally .xml file on command prompt. I have already generated text files but while making .vec file using opencv_createsamples utility on command prompt, I am getting error: opencv_createsamples command is not recognized. To resolve this I need to build opencv with TBB

WinRT C++ (Win10), opencv HSV color space, image display, artifacts

ⅰ亾dé卋堺 提交于 2019-12-13 06:47:24
问题 My goal is to make an object tracking. I have a UWP c# app and linked c++ windows runtime component. There I can obtain acces to opencv. In c#, MediaCapture return SoftwareBitmap. Then I pass SoftwareBitmap to c++ and convert it to opencv's Mat. Then cvtColor(cvFrame, cvFrame, COLOR_BGR2HSV); And then convert back to SoftwareBitmap, with BitmapPixelFormat::Bgra8 ( only Bgra8 is accepted by Software Bitmap ) and BitmapAlphaMode::Ignore And there is what I've got screen If I skip a cvtColor