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 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

OpenCV python on MAC

import cv2 img = cv2.imread('mikrotik.jpg',0) cv2.imshow('image',img) cv2.waitKey(0)cv2.destroyAllWindows() I ran this code on my Pycharm on mac machine then get this error instead >/Users/briant/venv/bin/python /Users/briant/PycharmProjects/...
more »

2017-04-17 11:04 (0) Answers

How to store webcam video with OpenCV in Python

I've got a script in Python which reads out my webcam and shows it in a window. I now want to store the results, so following this tutorial I wrote the following code: import cv2 import imutils camera = cv2.VideoCapture(0) # Define the codec and cr...
more »

2017-04-17 11:04 (1) Answers

Smooth tracking in Python and Opencv

Hi Everyone i am newbie in Python and opencv, Can you guide me the best way to track human iris. I have created the ROI for iris but due to live stream when i pass the x and y co-ordinates of iris to it start to move randomly. This happens when next...
more »

2017-04-17 08:04 (0) Answers

Sample frames of video

I'm looking for a way in OS X/Python3.5 to take an .avi video file, subsample every 100th frame, and combine those frames into its own video. In my particular case the video is 30 seconds at 20fps, so the new video would only be 6 frames long (I wa...
more »

2017-04-08 06:04 (2) Answers

How to get chamerMatching to work on OSX?

I'm trying to use OpenCV's chamferMatching functionality to work on OSX, but getting an error about a failed attempt at freeing objects that weren't allocated (as far as I can tell): fs(58697,0x100b3c000) malloc: *** error for object 0x103800000: po...
more »

2017-04-08 02:04 (1) Answers

OpenCV maximum and minimum RGB value using mask

I need to get the minimum RGB value of a circle. How can I do like the average RGB value method (cv2.mean) appliying a mask? To get the average RGB value of a circle I'm doing: circle_img = np.zeros((circle_img.shape[0],circle_img.shape[1]), np.uint...
more »

2017-04-02 18:04 (1) Answers

Drawing in a video

I am doing an exercise in which the program has to follow that routine: when the user clicks on any point of a video, it gets that pixel and turns all pixels in a range of 5% into red. Since it is a video, I am saving the points (x,y) the user clicks...
more »

2017-04-02 17:04 (1) Answers

How to Align two images in OpenCV

I am new to OpenCV and I need some help .. Objective : I am trying to highlight the difference between two images Problem : If the images differ in the position , the program highlights the whole image How can I Align the images so that each fe...
more »

2017-03-31 21:03 (0) Answers

Generating nested Numpy Arrays

I'm trying to write a function that will take as input a numpy array in the form: a = [[0,0], [10,0], [10,10], [5,4]] and return a numpy array b such that: b = [[[0,0]], [[10,0]], [[10,10]], [[5,4]]] For some reason I'm finding this surprisingl...
more »

2017-03-30 19:03 (1) Answers