contour

Trying to plot two variable function, calculating function loop gives wrong shape

Trying to plot two variable function, calculating function loop gives wrong shape Question: I have some function f, which is some compliciated integral taking two parameters x and y . I want to make contour plot in this parameter space (i.e. over some arrays X and Y), so I use loops over those two paremeters. …

Total answers: 1

python opencv – filter controus by position

python opencv – filter contours by position Question: I use this code to find some blobs, and pick the biggest one. contours, hierarchy = cv2.findContours(th1, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE) if len(contours) != 0: c = max(contours, key=cv2.contourArea) Now, I would need to change this code in a way so it returns the contour that is in the …

Total answers: 2

Choosing a specific contour in oscillatory data to plot with matplotlib

Choosing a specific contour in oscillatory data to plot with matplotlib Question: I have oscillatory data to which I would like to add a specific contour line. For example, the data pass through a value several times, and I would like to pick a specific instance of that value to highlight with a contour. As …

Total answers: 1

Problem with 3D contour plots in matplotlib

Problem with 3D contour plots in matplotlib Question: I created a 3D contour map in Mathematica a while back, and I am trying to do it in Python this time. First let me show you what I obtained: Mathematica: Python: Now, I would like the foreground (the visible part of the hills) to hide the …

Total answers: 2

How to interpolate heatmaps (with nonuniform pixels) to draw contour plots in python

How to interpolate heatmaps (with nonuniform pixels) to draw contour plots in python Question: I have data that I have been able to plot using heatmaps with nonuniform pixel sizes, using the answer here. I’m now wondering what would be the best way to go about interpolating the heatmap and drawing a contour plot at …

Total answers: 1

FindContours not detecting light colored points

FindContours not detecting light colored points Question: I am trying to detect points from a scatter plot and get the location of those points. For that I am trying to use OpenCV findContours function, but for some reason, its not able to detect and draw contours for light colored points on the graph Here’s my …

Total answers: 1

Find edge points of this shape using opencv python

Find edge points of this shape using opencv python Question: Everyone I have used contours to find out the endpoints as shown in the image but I’m not getting my expected output what these points (p1,p2,p3,p4). Can you please help me to find it out? I have also attached my input image below. Thank you. …

Total answers: 1

How to detect a specific inner rectangle in a complex shape

How to detect a specific inner rectangle in a complex shape Question: I have the following input image: and I do like to crop the inner max rectangle like this (Expected Output): but when I do contour detection I get the external rectangle (Current Result): import cv2 import numpy as np res = cv2.imread("input.png", 0) …

Total answers: 1