contour

Hide contour linestroke on pyplot.contourf to get only fills

北城余情 提交于 2019-11-27 19:26:06
I have a pet project to create images of maps, where I draw the roads and other stuff over a contour plot of the terrain elevation. It is intended to plan mountain bike routes (I have made some vectorial drawings by hand, in the past, and they work great for visualization). Currently, I download Digital Elevation Model, in GeoTIFF, from here: http://www.ecologia.ufrgs.br/labgeo/arquivos/downloads/dados/SRTM/geotiff/rs.rar and then create the plot with GDAL and Matplotlib contourf function: from osgeo import gdal import matplotlib import matplotlib.pyplot as plt from pylab import cm import

plot multiple 2d contour plots in one 3d figure [Matlab]

断了今生、忘了曾经 提交于 2019-11-27 18:43:39
问题 I would like to know how to plot multiple, 2D contour plots spaced apart in the z-axis, in a 3D figure like this: 回答1: NOTE : The first part of this answer was meant for HG1 graphics. See the second part if you're working with MATLAB R2014b and up (HG2). HG1: The contour function internally creates a number of patch objects, and returns them as a combined hggroup object. So we could set the ZData of all patches by shifting in the Z-dimensions to the desired level (by default contour is shown

How to fill in the contour fully using stat_contour

匆匆过客 提交于 2019-11-27 15:57:44
问题 I am looking for ways to fully fill in the contour generated by ggplot2's stat_contour. The current result is like this: # Generate data library(ggplot2) library(reshape2) # for melt volcano3d <- melt(volcano) names(volcano3d) <- c("x", "y", "z") v <- ggplot(volcano3d, aes(x, y, z = z)) v + stat_contour(geom="polygon", aes(fill=..level..)) The desired result can be produced by manually modifying the codes as follows. v + stat_contour(geom="polygon", aes(fill=..level..)) + theme(panel.grid

Multiple filled.contour plots in one graph using with par(mfrow=c())

时间秒杀一切 提交于 2019-11-27 15:16:03
问题 I am trying to construct a graph consisting of 2-3 filled.contour plots next to each other. The color scale is the same for all plots, and I would like only one z value key plot. I am having difficulties to do this with par(mfrow=c(1,3)) Example code: x <- 1:5 y <- 1:5 z <- matrix(outer(x,y,"+"),nrow=5) filled.contour(x,y,z) filled.contour(x,y,z,color.palette=rainbow) z2 <- z z2[5,5] <- Inf filled.contour(x,y,z2,col=rainbow(200),nlevels=200) Is it possible to stack 2-3 of these plots next to

With OpenCV, try to extract a region of a picture described by ArrayOfArrays

瘦欲@ 提交于 2019-11-27 15:13:56
问题 I am developing some image processing tools in iOS. Currently, I have a contour of features computed, which is of type InputArrayOfArrays. Declared as: std::vector<std::vector<cv::Point> > contours_final( temp_contours.size() ); Now, I would like to extract areas of the original RGB picture circled by contours and may further store sub-image as cv::Mat format. How can I do that? Thanks in advance! 回答1: I'm guessing what you want to do is just extract the regions in the the detected contours.

R plot filled.contour() output in ggpplot2

让人想犯罪 __ 提交于 2019-11-27 15:10:37
问题 I want to plot this figure created with filled.contour(), but in ggplot2, how do I do this? I want to use ggplot2 because the graphing conventions are easier. The reason I want to use filled.contour() is because I tried geom_tile() and image.plot() and they both created very tile like outputs, and I need an output similar to filled.contour(). This is my figure: Code: library(akima) df <-read.table("Petra_phytoplankton+POM_xydata_minusNAs_noduplicates.txt",header=T) attach(df) names(df) fld <-

R - ggplot - stat_contour not able to generate contour lines

爷,独闯天下 提交于 2019-11-27 13:39:54
I am trying to add contour lines via stat_contour() to my ggplot / ggplot2 -plot. Unfortunately, I can not give you the real data from which point values should be evaluated. However, another easily repreducably example behaves the same: testPts <- data.frame(x=rep(seq(7.08, 7.14, by=0.005), 200)) testPts$y <- runif(length(testPts$x), 50.93, 50.96) testPts$z <- sin(testPts$y * 500) ggplot(data=testPts, aes(x=x, y=y, z=z)) + geom_point(aes(colour=z)) + stat_contour() This results in the following error message: Error in if (nrow(layer_data) == 0) return() : argument is of length zero In

OpenCV's Canny Edge Detection in C++

泪湿孤枕 提交于 2019-11-27 13:21:23
I want to extract the edges of hand but I get the following result. I've tried adjusting the low and high threshold but I still can't get the desired output. I have included below the code and its output. What seems to be the problem? This is the output image generated by the code below. #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> int main(){ cv::Mat image= cv::imread("open_1a.jpg"); cv::Mat contours; cv::Mat gray_image; cvtColor( image, gray_image, CV_RGB2GRAY ); cv::Canny(image,contours,10,350); cv::namedWindow("Image"); cv:

Smoothing Data in Contour Plot with Matplotlib

烂漫一生 提交于 2019-11-27 12:36:54
问题 I am working on creating a contour plot using Matplotlib. I have all of the data in an array that is multidimensional. It is 12 long about 2000 wide. So it is basically a list of 12 lists that are 2000 in length. I have the contour plot working fine, but I need to smooth the data. I have read a lot of examples. Unfortunately, I don't have the math background to understand what is going on with them. So, how can I smooth this data? I have an example of what my graph looks like and what I want

OpenCV C++: Sorting contours by their contourArea

烂漫一生 提交于 2019-11-27 12:30:04
问题 How can I sort contours by the size of their contour areas? And how can I get the biggest/smallest one? 回答1: 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;