contour

Using ROI in OpenCV?

▼魔方 西西 提交于 2019-11-30 06:41:09
问题 ROI can only be implemented with an rectangle. I however have a contour that I want to set as an ROI. Does anyone have an idea of how I would go about using a contour as an ROI rather than a rectangle? Otherwise if not possible, how could I focus my actions only in pixels in a specific contour? Thanks PS: Sorry for all these OpenCV questions. Just really confused :$ 回答1: OpenCV supports only rectangular ROIs. However, to make some processing for specific pixels, you can use some helper

Contour/imshow plot for irregular X Y Z data

徘徊边缘 提交于 2019-11-30 06:31:07
问题 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 contours/color represent the the value Z (amplitude). The grid for measurements and X and Y look are irregularly spaced. Many thanks, len(X)=100 len(Y)=100 len(Z)=100 回答1: Does plt.tricontourf(x,y,z) satisfy your requirements? It will plot filled contours for irregularly spaced data (non-rectilinear grid). You

OpenCV, how to use arrays of points for smoothing and sampling contours?

寵の児 提交于 2019-11-30 03:52:40
I have a problem to get my head around smoothing and sampling contours in OpenCV (C++ API). Lets say I have got sequence of points retrieved from cv::findContours (for instance applied on this this image: Ultimately, I want To smooth a sequence of points using different kernels. To resize the sequence using different types of interpolations. After smoothing, I hope to have a result like : I also considered drawing my contour in a cv::Mat , filtering the Mat (using blur or morphological operations) and re-finding the contours, but is slow and suboptimal. So, ideally, I could do the job using

OpenCV C++: Sorting contours by their contourArea

女生的网名这么多〃 提交于 2019-11-30 02:23:43
How can I sort contours by the size of their contour areas? And how can I get the biggest/smallest one? dom You can use std::sort with a custom comparison function object // comparison function object bool compareContourAreas ( std::vector<cv::Point> contour1, std::vector<cv::Point> contour2 ) { double i = fabs( contourArea(cv::Mat(contour1)) ); double j = fabs( contourArea(cv::Mat(contour2)) ); return ( i < j ); } Usage: [...] // find contours std::vector<std::vector<cv::Point> > contours; std::vector<cv::Vec4i> hierarchy; cv::findContours( binary_image, contours, hierarchy, CV_RETR_EXTERNAL,

Opencv match contour image

蹲街弑〆低调 提交于 2019-11-29 22:35:43
I'd like to know what would be the best strategy to compare a group of contours, in fact are edges resulting of a canny edges detection, from two pictures, in order to know which pair is more alike. I have this image: http://i55.tinypic.com/10fe1y8.jpg And I would like to know how can I calculate which one of these fits best to it: http://i56.tinypic.com/zmxd13.jpg (it should be the one on the right) Is there anyway to compare the contours as a whole? I can easily rotate the images but I don't know what functions to use in order to calculate that the reference image on the right is the best

Python/Matplotlib - Colorbar Range and Display Values

独自空忆成欢 提交于 2019-11-29 20:41:25
When using matplotlib with a contour plot, I'm having trouble getting the colorbar to display as I want. I've read through numerous similar examples, but have still not been able to get what I want. In the image below, I want two things changed. I want the minimum value and maximum values to be display on the color bar (the max should be 2.0 and the min -0.1). These two values should be at the very edge of the colorbar. Also, I want the colorbar to display the value at every color transition. For example. in the plot below, between 2.1 and 1.8, there is another color transition where the value

云原生生态周报 Vol. 19 | Helm 推荐用户转向 V3

守給你的承諾、 提交于 2019-11-29 18:32:27
作者| 禅鸣、忠源、天元、进超、元毅 业界要闻 Helm 官方推荐用户迁移到 V3 版本 Helm 官方发布 博客 ,指导用户从 v2 迁移到 v3,这标志着官方开始正式推进 helm 从 v2 转向 v3。我们也更加推荐终端用户使用 helm v3,之前我们曾在文章 《 初探云原生应用管理(二): 为什么你必须尽快转向 Helm v3》 深入探讨过如何用 Helm 来快速部署 K8s 应用以及为什么要尽快转向 Helm V3。 CNCF 公布 2020 年 KubeCon 时间表 CNCF 最近公布了其 2020 年 KubeCon + CloudNativeCon 的时间表: 欧洲:2020 年 3 月 30 日至 4 月 2 日,阿姆斯特丹 中国:2020 年 7 月 28 至 30 日,上海 北美:2020 年 11 月 17 至 20 日,波士顿 最近一场,北美地区 KubeCon + CloudNativeCon 将在 11 月 18 日至 21 日在圣地亚哥举行。 Contour v0.15 发布 在 Contour (Heptio 开源项目,提供 Envoy 作为 Kubernetes 项目的 Ingress Controller) 的早期版本中,改进了拆分部署模型,以确保 Envoy 和 Contour 之间的通信。 现在,通过我们的最新版本 Contour v0

Matplotlib Contour Clabel Location

眉间皱痕 提交于 2019-11-29 16:49:01
问题 I would like to control the location of matplotlib clabels on a contour plot, but without utilizing the manual=True flag in clabel. For example, I would like to specify an x-coordinate, and have labels created at the points that pass through this line. I see that you can get the location of the individual labels using get_position(), but I am stuck at that. Any help would be greatly appreciated. Thanks! 回答1: No, there is no way built into matplotlib to do that. You are supposed to either live

drawing 3d contour plot from 3d vector

给你一囗甜甜゛ 提交于 2019-11-29 16:33:59
I want to draw a contour plot for 3D data. I have a force in x,y,z directions I want to plot the contour3 for that the dimensions of the Fx = 21x21X21 same for Fy and Fz I am finding force = f*vector(x,y,z) Then Fx(x,y,z) = force(1) Fy(x,y,z) = force(2) Fz(x,y,z) = force(3) I did the following but it is not working with me ?? why and how can I plot that FS = sqrt(Fx.^2 + Fy.^2 + Fz.^2); x = -10:1:10; [X,Y] = meshgrid(x); for i=1:length(FS) for j = 1:length(FS) for k=1:length(FS) contour3(X,Y,FS(i,j,k),10) hold on end end end This is the error I am getting Error using contour3 (line 129) When Z

Closing a contour curve in OpenCV

余生长醉 提交于 2019-11-29 13:30:00
问题 I'm using OpenCV (Canny + findCountours) to find external contours of objects. The curve drawn is typically almost, but not entirely, closed. I'd like to close it - to find the region it bounds. How do I do this? Things considered: Dilation - the examples I've seen show this after Canny, although it would seem to me it makes more sense to do this after findContours Convex hull - might work, though I'm really trying to complete a curve Shape simplification - related, but not exactly what I