Can't compile OpenCV in Xcode

I'm trying to use OpenCV and I just want to use UIImageToMat. ENV Xcode 8.3.3 Swift 3.0 OpenCV 3.2.0 ERROR Apple Mach-O Linker Error Group "UIImageToMat(UIImage const*, cv::Mat&, bool)", referenced from: clang: error: linker command faile...
more »

2017-08-17 03:08 (1) Answers

Opencv3.0.0 VideoCapture not working on Mac

cv2.Videocapture() works fine while using the camera,but while reading the local video, there is a WARNING: Couldn't read movie file Here is my test code: # -*- coding: utf-8 -*- import numpy as np import cv2 cap = cv2.VideoCapture('test2.avi') ...
more »

2017-08-16 05:08 (0) Answers

Installing OpenCV

I am on Mac OSX El Capitan and am trying to install opencv. I am using homebrew with this command. Sumant:Sumant$ brew install opencv The result is Warning: homebrew/science/opencv 2.4.13.2_1 is already installed Even though it says that opencv ...
more »

2017-08-15 12:08 (1) Answers

No module named cv

I'm trying to run this script: https://github.com/openalpr/train-detector/blob/master/crop_plates.py I've never dealt with python before. First of all I had some syntax errors in the print lines. They were lacking parentheses...but I'm not sure if ...
more »

2017-08-14 15:08 (2) Answers

Using Numpy arrays for looping

How would one go about converting p = img.ptr<uchar>(row); which is written using OpenCV in C++, into OpenCV's Python bindings? From what I understand, since images are represented as NumPy arrays in OpenCV Python - does this mean that it coul...
more »

2017-08-12 12:08 (0) Answers

Using sklearn.metrics Jaccard Index with images?

I am trying to do some image comparisons, starting first by finding the Jaccard Index. I'm using the sklearn.metrics implementation of Jaccard Index Using the example below with just a small array of numbers, it works like expected. import numpy as ...
more »

2017-07-12 20:07 (2) Answers

How to centralize and resize digits using opencv?

I want to OCR some scanned forms (filled by hand). It is the first time I do something serious using computer vision. So far I'm able to locate the squares containing digits for a date field: Looking at the example handwritten digit dataset that c...
more »

2017-07-04 23:07 (2) Answers

gitignore not ignoring opencv2.framework

I am trying to make git ignore the opencv2.framework I have imported into my project. However, even though I am adding opencv2.framework into my .gitignore, every time I run git status on my terminal, all the opencv2.framework files are showing up as...
more »

2017-06-30 02:06 (1) Answers

imwrite 16 bit png depth image

I have the following code. I am trying to save a 16 bit depth image which I retrieve from Kinect v1 as a png file. I wrote the following code sample: def display_depth(dev, data, timestamp): global keep_runningp #cv2.imshow('Depth', fram...
more »

2017-06-17 17:06 (1) Answers

Share OpenCV C++ Object with Python

Scenario: A C++ program process capture a image using OpenCV. Another process, using Python and OpenCV have a shared memory area (with mmap) with the first program. Problem: How do I create in a Python process, a reference to the same image that a...
more »

2017-05-16 02:05 (0) Answers

Python, Display openCv image in Tkinter in Label

I'm trying display openCV image in Tkinter label. When I load image from file like: img = ImageTk.PhotoImage("asd.png") everythink works fine. But when I change it, I get only empty, black image, anythink else. This is example code: import tkinte...
more »

2017-05-15 14:05 (1) Answers

OpenCV UIImageToMat linker fail in xcode

I wrote some OpenCV code at xcode but when I compiled, 2 methods got linker fail: UIImageToMat and MatToUIImage I was using opencv2.framework (from opencv website, version 3.1 for iOS) and it was working fine, then I used cocoapods and integrated op...
more »

2017-05-05 09:05 (1) Answers

install opencv3 on mac for python 3.6

I want to install opencv3 for python 3.6 on macOS Sierra. I have tried to use it through homebrew using this link http://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/ but I am getting this error Error: open...
more »

2017-04-27 21:04 (1) Answers

Trouble installing opencv on mac

I'm trying to install OpenCV on mac(OS X 10.11.6) and use xcode 7.3.1. I have also tried Macports to install OpenCV, but continue to have the same error: Undefined symbols for architecture x86_64: "cv::String::deallocate()", referenced from: ...
more »

2017-04-26 21:04 (0) Answers

OpenCV read files in Swift IOS project

I am trying to read "classifications.xml" and "images.xml" from a tutorial which was working fine in a VisualStudio project. How do I point the C++ library in my Swift XCode project to the files now? Drag and dropping them into the project did not wo...
more »

2017-04-19 21:04 (1) Answers

python: cv2.threshold changes numpy to tuple

I process every frame in first function where i am usingcv2.threshold(self.res, 10, 255, cv2.THRESH_BINARY_INV) for preprocessing before detecting motion. In next function I am just counting number of black pixels and calculating average. I am giving...
more »

2017-04-18 23:04 (0) Answers