Plot a complex function in Mathematica

How can I make a Mathematica graphics that copies the behaviour of complex_plot in sage? i.e. ... takes a complex function of one variable, and plots output of the function over the specified...

OpenCV 2 Centroid

I am trying to find the centroid of a contour but am having trouble implementing the example code in C++ (OpenCV 2.3.1). Can anyone help me out?

How do you create a legend for a contour plot in matplotlib?

I can't seem to find the answer anywhere! I found a discussion here, but trying this I get a TypeError: 'NoneType' object is not iterable: >>> import numpy as np >>> import matplotlib.pyplot as...

connected components in OpenCV

I am looking for an OpenCV function that can find connected components and perform a few tasks on them ( like getting the number of pixels, contour, list of pixels in the object etc.. ) Is there a...

Stop pyplot.contour from drawing a contour along a discontinuity

I have a 2d map of a coordinate transform. The data at each point is the aximuthal angle in the original coordinate system, which goes from 0 to 360. I'm trying to use pyplot.contour to plot lines...

Heap Curroption error in findContours

I have a heap corruption error because of the cv::findContours function. I need help figuring out the solution for this problem. int GetEndPoints(cv::Mat image) { cv::Mat imgBW =...

scipy signal find_peaks_cwt not finding the peaks accurately?

I've got a 1-D signal in which I'm trying to find the peaks. I'm looking to find them perfectly. I'm currently doing: import scipy.signal as signal peaks = signal.find_peaks_cwt(data,...

Contour/imshow plot for irregular X Y Z data

I have data in X, Y, Z format where all are 1D arrays, and Z is the amplitude of the measurement at coordinate (X,Y). I'd like to show this data as a contour or 'imshow' plot where the...

Adding extra contour lines using matplotlib 2D contour plotting

I am creating a two-dimensional contour plot with matplotlib. Using the documentation provided http://matplotlib.org/examples/pylab_examples/contour_demo.html, such a contour plot can be created...

OpenCV Optical Flow assertion

I'm attempting to track landmarks along the contour of facial features obtained via dsift with python 2.7 and openCV 2.4.11. I want to track these features between frames. However I am receiving...

Python opencv sorting contours

I am following this question: https://stackoverflow.com/questions/38654302/how-can-i-sort-contours-from-left-to-right-and-top-to-bottom to sort contours from left-to-right and top-to-bottom....

contour in matplotlib does not plot specified number of contours

I generate some data within a loop and like to plot them as a contour plot. Each plot should use the same colormap and a specified number of contour levels. Also, the first level color should be...

Heated body or black-body radiation color palette in R

How can I define a "heated body" or "black-body radiation" color scheme for color-coding sequential data in R? Standard R color palettes don't give an indication of ordinal, interval or ratio...

Error with cv2.minAreaRect , gives me Error related to convex hull function which i haven't used

In the code below I have tried to find out if an object is green in colour and draw a contour around it. With that information I would also like to find the corners of the shape and crop it, but I...

Keep the same label for a moving object using opencv

I want to track a moving fish from camera witch has located on top of a fish tank. Till now I was able to track the multiple moving objects using moving average and background subtraction methods....

How to check if point is placed inside contour?

I have drawn a contour around extreme points. Inside polygon figure I have others points. How to check if they are inside contour?

Opencv not finding all contours

I'm trying to find the contours of this image, but the method findContours only returns 1 contour, the contour is highlighted in image 2. I'm trying to find all external contours like these...

Perform line segmentation (cropping) serially with OpenCV

I am performing full Page Offline Handwriting Recognition with Deep Learning. The main idea is to build the model that can take one line of text image and give it's corresponding text. For this...

Corner plot: "more dimensions than samples" error

I am trying to make a corner plot with 5 labels. Each label is an array with 1713 values. It appears I have 2 dimensions but only 1 sample. How do I increase the number of samples? Input: #...

conversion of .py to .exe using auto-py-to-exe showing error

I want to convert .py to .exe. For that I got to know that auto-py-to-exe is simple and works for Python >= 2.7 ( including 3.7 🎉 ). When I tried to convert a simple application it worked...

What does the levels argument in the contourf matplotlib mean?

This question is about the matploblib contourf function. (https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.contourf.html) The documentation for the function describes the levels...

Extract color feature only from bounding box ( ROI ) in OpenCV

I would like to extract color feature from bounding box ( ROI ) only and ignore rest of the image in the real-time video in OpenCV with python I tried but I can't, it drew boundary box of color...

Maximum volume inscribed ellipsoid in a polytope/set of points

Later Edit: I uploaded here a sample of my original data. It's actually a segmentation image in the DICOM format. The volume of this structure as it is it's ~ 16 mL, so I assume the inner...

Checkbox detection opencv

I have been trying to detect the checkboxes. Though I was able to detect the square contours in other images I was not able to get the contours for this particular image. Please help me detect the...

How to find contours in a region of interest in image using opencv and Python?

while(True): _, frame = cap.read() hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) a, b = 0, 0 height, width, layers = frame.shape start_height = height - height left_x =...

OpenCV: how to detect and identify objects on solid color background using chroma key and contour detection

I have a camera (calibrated, warped with OpenCV) facing a flat surface top down. The surface will be a single solid color. I want to be able to identify objects lying on the surface and determine...

Opencv contour sorting

I'm new to python and Opencv. I'm working on a project to build an app to recognize handwritings in local language. One of the critical part of it to find the order of the words and character. So...

Finding a path between Point in a RGB image

I have a RGB image which is a map including roads and stations. I am trying to find the closest station to each other that there is a road between those. The road is showing in black and the...

Object reconstruction from structure from motion with mask RCNN

I'm doing object reconstruction from structure from motion. The current situation right now, is I'm getting a multiple views for a car and apply a mask rcnn for that object to remove the...