Questions tagged [contour]
A contour line for a function of two variables is a curve connecting points where the function has the same particular value.
2,062
questions
-1
votes
0
answers
11
views
How can I plot contour on the cylinder on Python?
I need to plot contour on the wall of cylinder on python.
Actually I need a contour like the picture has been attached but I do not know how to do that.
Could you please guide me?
Regards,
Fatemeh
0
votes
0
answers
49
views
Need help removing a contour from image using Open CV python
I am trying to remove this rectangular contour from the binary image of this photo.
I have tried to use this tutorial https://pyimagesearch.com/2015/02/09/removing-contours-image-using-python-opencv/ ...
0
votes
0
answers
49
views
OpenCV FindContours cannot find the correct edge with K-Means Binary Clustering
This is the follow-up question from here.
I use cv2.kmeans to segment the left auricle DICOM image as mask.
The following code is how I deal with the k-means binary clustering in OpenCV.
import cv2
...
0
votes
0
answers
25
views
Contour-Planar Based Human Pose Estimation
I've been trying to make a contour-based human pose estimation like the one in the center of the image below.
I've searched, I couldn't find any code on Github but I found that it can be done with ...
0
votes
0
answers
26
views
Matplotlib contour plot lines incomplete when inline labels are used
I wrote the following code to generate a contour plot in Matplotlib:
# generate a meshgride of permeance, cost values
resolution = 200
Y, X = np.meshgrid(np.logspace(math.log10(1000), math.log10(84999)...
0
votes
1
answer
18
views
How to set the ticks in matplotlib colorbar to be at the minimum and maximum value
I have a very simple plot of matplotlib.contourf like the following:
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 10, 10)
y = np.linspace(0, 10, 10)
xx,yy = np.meshgrid(x,y)
...
0
votes
1
answer
27
views
How do I plot a contour plot of 3 column data
I have a 3 column irregular data in the format [X Y Z]. I am having difficulty in creating a contourf
plot for the same since it requires one to create a meshgrid and also that data be uniform among ...
0
votes
0
answers
64
views
How to find intersection point between contour and line?
I'm having difficulties in extracting all the intersection points between contour and line.
As you can see from the image, the intersection points in pink circled area are detected but not marked in ...
0
votes
0
answers
31
views
Expected Ptr<cv::UMat> for argument 'contour'
Hey I am facing issue I have also tried diff versions of opencv. IF someone can help me with this. Thanks
import cv2
from keras.models import load_model
import numpy as np
from collections import ...
1
vote
0
answers
77
views
How to find multiple distance between intersection point of lines in contour?
I'm having difficulties in calculating distance between intersection points in the same contour. From the image, there are 2 intersection points for 4 of the particles' contours respectively. I tried ...
0
votes
1
answer
49
views
Is there a way to make the threshold image detect the object itself rather than the outline? - OpenCV
I have the following image and am trying to get the threshold image to be the filled-in objects (the blobs), but it appears that the threshold image is just the outline. Is there a better way to make ...
0
votes
1
answer
50
views
Polar plot in GNUPLOT: How to restrict angle from 0 to 60 degree
I need help with my polar plot shown below.
The plot was generated using the same code as in GNUPlot - Plotting a data set in polar form (r, θ, T(r,θ)) to a contour/heat map.
The code plot the whole ...
0
votes
0
answers
17
views
matplotlib contourf plot adding an extra step size in levels
I'm trying to plot contourf of 7 clusters with min value in array of 0 and max of 6. However, when I plot it, there is an extra step size in the plot (the color pink outlining the brown cluster.Even ...
0
votes
0
answers
25
views
Find the time of detected object
I am trying to find the time from the start of a video file when the object is detected.
The object is the sharp light flash, what I want to know is if we could find the time when the light flash is ...
0
votes
0
answers
32
views
3D plot in python plot (X, Y, Z, data)
This python code allows to plot Z = f(X,Y). My question is what should I modify to plot f(X,Y,Z,data)?
Let's say that data corresponds to temperature, and I have temperature for each location X, Y, ...
1
vote
1
answer
42
views
How do I correctly implement contours of histograms with logscale binning in numpy/matplotlib
I am trying to plot contours of data that his been binned using numpy.hist2d, except the bins are set using numpy.logscale (equal binning in log space).
Unfortunately, this results in a strange ...
-1
votes
1
answer
30
views
I can't get angles from a binary image with squares
I want to get the angles from the binary image in python, but I don't know how to convert this cpp to python.
If there is a other way to detect angles from this 'inspected image' for example with blob ...
0
votes
0
answers
19
views
Efficient Creation and Storage of Contour Lines from a 3D Triangular Mesh
I need to generate multiple contours in a specified range from a 3D Triangular Mesh. To simply generate points at height specified by the z coordinate I create a plane vec4(0,0,1,z) then loop through ...
0
votes
0
answers
32
views
Finding rectangular shape of contour in OpenCV Python
I'm having problems approximating the shape of the contours/convex hull of an object. Below I attached an image showing a perfectly fine contour of an ID card.
I use a bilateral filter and canny edge ...
1
vote
1
answer
37
views
Adding Offset to 'contours'
I'm working in Windows 10, with Python 3.8 and OpenCV 4.5, and creating an artificial dataset to train a Convolutional Neural Network. In one step I need to translate a contour structure, but I'm ...
2
votes
0
answers
34
views
Non overlapping random shapes on 2D plane
Objective: I want to create random non-overlapping irregular rounded shapes (contours) on a 2D plane, similar to a sandstone microstructure as shown below, to perform an oil flooding experiment using ...
0
votes
1
answer
55
views
cv2.contourArea will always return an error
No matter what I try I can't seem to get cv2.contourArea to work properly, it will always return the error:
(-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in ...
1
vote
0
answers
50
views
Robust method to detect cross and or corner contours with Python
I am trying to make my own tool to robustly detect color cards in images with Python.
Every color card has a few distinct features which should be easy to recognize from the contours, amongst others ...
0
votes
0
answers
27
views
How to plot density-contours on a ternary diagram in Python?
I have [x,y,z] data to plot on a ternary diagram, that of which I would like to plot the contours of based on their density in [x,y,z]-space. I have my data stored in a list of ((x1,y1,z1), (x2,y2,z2),...
1
vote
0
answers
31
views
How to remove the colorbar from filled.contour in R
I have been trying to remove the colorbar from filled.contour plots in the R-programming language, as it seems to me that in some cases it may be redundant. Here is an example.
cols = heat.colors(100, ...
0
votes
0
answers
15
views
How to remove outer contour in imshow plot
I would like to avoid the plotting of an outer contour line that seems to wrap the area that is displayed in my imshow graph (image is attached).
Contour lines are shown OK with dashed lines but I ...
0
votes
0
answers
61
views
How to draw lines at given angle to the edge of contour?
Sample image:
How to measure the diameter or area of cell (particularly for white, grey and black) ?
I found some relevant idea which is drawing lines from 1 degree to 359 degree from center to the ...
0
votes
0
answers
57
views
How to determine shape of outermost boundary of object?
I'm trying to classify images into two categories using only opencv. Category1 contents images of object type whose outer boundaries are of U shape and category2 contents images of object type whose ...
0
votes
1
answer
28
views
Python - plotting a specific line from different contour plots all on the same graph
If you run the code you will see that I'm displaying contour lines for the Momentum Capacity (variable AM - Contour Line Plot) for different diameters. What I wish to do is to display the 2.0 contour ...
1
vote
1
answer
43
views
OpenGL contour and creases render
I want to render the outlines + creases with opengl but it's not going as I wish. Can someone, please help me to solve this problem?
So far the outline it's rendered like this.
At this moment what I'...
0
votes
0
answers
38
views
How to find coordinate in tricontourf I draw?
I'm try to find coordinate of contour I draw.
I draw image with this code.
from matplotlib import cm
from matplotlib.colors import ListedColormap,LinearSegmentedColormap
import matplotlib.colors as ...
0
votes
0
answers
10
views
Connect offst countours to be a continuous path
I have some parallel contours, and I would like to connect them to form a continuous path. Does anyone have any idea or know any algorithm to do that? The attached image is an example of what I would ...
0
votes
0
answers
39
views
Python cv2.approxPolyDP creates rotated polygon from contour
I'm working with OpenCV (cv2) in Python3.7 to attempt to create a license plate reader employing the pytesseract module. Using cv2.Canny() to detect the contour edges of the license plate in
the ...
0
votes
0
answers
29
views
Need help in plotting a polar contour plot
I have data for few points along the polar coordinates. The data is aligned as shown below
Data
I need help in plotting a 2D polar plot as shown below. I cant understand how do I reshape the values ...
1
vote
0
answers
16
views
How can I produce a "symmetrical" contour plot in R? [duplicate]
I'm plotting a bivariate circular normal distribution in R:
library(MASS)
library(mnormt)
set.seed(0)
# create bivariate normal distribution
x <- seq(-4, 4, 0.1)
y <- seq(-4, 4, 0.1)
...
0
votes
2
answers
66
views
Python Error while going through a contour : tuple index out of range
I'm trying to code a piece of code to check if a contour (obtained using cv2.FindContour) is touching the border of an image or not. The contour is a tuple object.
So far here is what my code looks ...
0
votes
0
answers
46
views
How to extract the pixel coordinates of the contour, which is closest to the bottom of the image?
I am performing some contour analysis on an image:
contours, hierarchy = cv2.findContours(image=background_removed_ROI, mode=cv2.RETR_TREE, method=cv2.CHAIN_APPROX_SIMPLE)
I need to extract the ...
-1
votes
3
answers
71
views
Remove Yellow rectangle from image
I am using this code to remove this yellow stamp from an image :
import cv2
import numpy as np
# read image
img = cv2.imread('input.jpg')
# threshold on yellow
lower = (0, 200, 200)
upper = (100, ...
1
vote
0
answers
44
views
OpenCV - Find subcontour in a contour
i want to use the OpenCV Match Shapes-Function to find a known Contour in a larger image like in this example (3. Match Shapes)
https://docs.opencv.org/4.x/d5/d45/tutorial_py_contours_more_functions....
0
votes
0
answers
42
views
Find and color a Pedestrian crossing [duplicate]
I have a task, where I need to find in Python on a picture a pedestrian crossing and color it to red.
import cv2
import numpy as np
# Let's load a simple image with 3 black squares
image = cv2....
0
votes
0
answers
42
views
Making a python contourf plot with blank regions, how to stop interpolation over blank regions?
I am trying to make a contourf plot of this data:
As you can see, there are big, blank rectangular regions in which I have no data. I would like to produce a contour plot using contourf in which ...
0
votes
1
answer
16
views
Slider demo for a contour plot in python
I am trying to create a slider demo contour for a sinusoidal function using python, but I do not know how to code the line that we will manipulate for a contour plot slider. I appreciate anyone that ...
0
votes
0
answers
92
views
Opencv-python boxPoints order
Hi for a project I am trying to detect different paintings in a gallery.
To score my object detector I need to give the top-left and bottom-right corner of my estimated bounding box to my scoring ...
0
votes
1
answer
89
views
How to draw a continuous contour plot with discrete coordinate data (DataFrame form)?
The row data has 3 columns and cannot shape a uniform grid based on 'x'&'z', so I am not able to plot the contour as the existed question: Create Contour Plot from Pandas Groupby Dataframe.
The ...
0
votes
0
answers
14
views
Drawing zone over plt.imshow
I'm plotting some .tiff images using GDAL and matplotlib. Currently images look like the one in the example and I would like to mark a zone over the image.I have an array of the same np.shape of the ...
0
votes
2
answers
78
views
OpenCV running otsu thresh on video gives weird window
I am trying to run this opencv code to run otsu tresh on my image and get mask
import cv2
import numpy as np
video = cv2.VideoCapture('video.mp4')
# loop runs if capturing has been initialized
...
0
votes
0
answers
33
views
How to show the actual values and not the index in the axis when drawing a contour plot from a netcdf file using python?
I am exploring options to plot a contour plot in python from a netcdf file (which can be accessed here: https://drive.google.com/file/d/1zGpDK35WmCv62gNEI8H_ONHS2V_L9JEb/view?usp=sharing). The file ...
0
votes
0
answers
16
views
Rotated Rectangle in EMGUCV over contours
Can somebody help me out please. I want to draw a rotated rectangel over my contours. i have found an Opencv code for python, but I need it for c# Emgucv. Can somebody help me to understand the python ...
1
vote
0
answers
30
views
Computation failed in `stat_contour_fill()`
I'm trying to generate the contour map of LAI in the forest. I used geom_contour_fill function from the metR package.
My data looks like this
LAI latitude longitude point
2.27 6694613 614612.1 ...
0
votes
0
answers
56
views
Fitting a contour inside another contour using OpenCV
The idea is to have a rectangular contour, searching for the points of intersection with the triangle one (as shown in the image below)
and then move the rectangle in order to fit inside the triangle ...