How to extract isosurfaces in Paraview using contour filter from gridded files? - contour

I have a smooth scalar field gridded file and i want to apply the contour filter to extract the 0 iso surface, as described by this guide i am reading, the get something like this. The software said i can only apply the contour filter on points files (why the guide said that they applied the contour on a gridded file?). I tried to transform blocks to points and then apply the filter, but nothing happens.

Just use contour with a value of 0 should work.

Related

How to preprocess aerial image for coastline detection

I am working on a program that gets exact pixel values of the shoreline in a given image. What is the best way to preprocess these types of images in order to make my life easier?
A sample image:
I suppose that you want to be able to segment the land from the water this way defining a path for the shoreline.
For this task I recommend you using an edge detection algorithm. A simple vertical Sobel filter should be enough given the image that you have provided. More details about its insides and API call here.
Do you have images with different meteorological conditions? Your algorithm should be robust when it comes to different lighting scenarios: night, rain etc (if that is the case).
A thresholding with respect to the tones that you have in your image might also help, details here.
For a proper binarized image the following contour finding methods proposed by OpenCV should do the job for you.

Shade Graphviz object with patterns

I didn't see any documentation for shading patterns, only solid fill color for Graphviz. Does anybody know how to do it, or is it not possible?
Like the pattern fill here. https://www.ablebits.com/office-addins-blog/2012/03/28/excel-charts-tips/
The closest thing to what you want is probably gradients.
In Graphviz's Node, Edge and Graph Attributes page, it supports gradients when specifying color lists.
You can use them referring to these examples.
Another alternative which would be a bigger hassle is use the shapefile attribute and build a shapefile per pattern although this feature is deprecated.
A third option would be if you are outputting in SVG format, is to do some post processing on the generated SVG to apply texture patterns on the nodes.

Matching a curve pattern to the edges of an image

I have a target image to be searched for a curve along its edges and a template image that contains the curve. What I need to achieve is to find the best match of the curve in the template image within the target image, and based on the score, to find out whether there is a match or not. That also includes rotation and resizing of the curve. The target image can be the output of a Canny Edge detector if that makes things easier.
I am considering to use OpenCV (by using Python or Processing/Java or if those have limited access to the required functions then by using C) to make things practical and efficient, however could not find out if I can use any functions (or a combination of them) in OpenCV that are useable for doing this job. I have been reading through the OpenCV documentation and thought at first that Contours could do this job, however all the examples show closed shapes as opposed to my case where I need to match a open curve to a part of an edge.
So is there a way to do this either by using OpenCV or with any known code or algorithm that you would suggest?
Here are some images to illustrate the problem:
My first thought was Generalized Hough Transform. However I don't know any good implementation for that.
I would try SIFT or SURF first on the canny edge image. It usually is used to find 2d areas, not 1d contours, but if you take the minimum bounding box around your contour and use that as the search pattern, it should work.
OpenCV has an implementation for that:
Features2D + Homography to find a known object
A problem may be getting a good edge image, those black shapes in the back could be distracting.
Also see this Stackoverflow answer:
Image Processing: Algorithm Improvement for 'Coca-Cola Can' Recognition

How to implement chrominance filtering in opencv?

I am new to Opencv. What I am trying to do is measure liquid level using single digital camera. After searching a lot I got one research paper having the algorithm and steps at the below link.
http://personnel.sju.edu.tw/改善師資研究成果/98年度/著作/22.pdf
But this algorithm having a step where I need to apply chrominance filtering on captured image. Opncv doesn't come with such inbuilt functionality. So how can I implement chrominance filtering, is there any way to to do this. Please help me, thanks.
I didn't manage to access the link yo provided, but I guess what you want to to is to segment your image based on the color (chroma). In order to do that, you have to first convert your BGR image (RGB but with the red and blue channels swapped, which is the natural ordering for OpenCV) to a chrominance-based space. You can do this using the function cv::cvtColor()with an argument such as CV_BGR2YUV or CV_BGR2YCrCb.
See the full doc of the conversion function here.
After that, you can split the channels of your images with cv::split()e.g. :
cv::Mat yuvImage;
std::vector<cv::Mat> yuvChannels;
cv::split(yuvImage, yuvChannels);
Then work on the image of the resulting vector that contains your channel of interest.

Advanced image color algorithm

Here are some examples of selective color change (from Wikipedia):
I've tried to find any information, papers or library code that do something like this. Does anyone know about this algorithm or where can I find some information about this? Something close to this algorithm would be nice.
The basic idea would be to detect an area to affect by color, and only apply the colorization effect to the pixels inside that area. This could be done by matching a range of RGB values, using HSL or HSV color space and matching on a range of hues, or other variations; you could also select any matching pixels anywhere in the image, or only the contiguous area of matching pixels that contains the originally selected pixel.

Resources