Anisotropic diffusion 2d images [closed]

2024/10/7 8:25:30

I want to use anisotropic diffusion on 2d images.

I'd like to use python but don't mind using matlab or c. Are their any libraries I could use as a first step? I did a google search on the subject and found Panda3D and OpenGl.
Basically I want to give a set of images have it apply the filtering and then output the new image to a folder I want.

Any tips on how to use either of these or maybe something that you believe is better?

edit: Meant diffusion sorry!

Answer

Here's my Python/numpy implementation of 2D and 3D anisotropic (Perona-Malik) diffusion. It's not quite as fast as C-code, but it did the job nicely for me.

https://en.xdnf.cn/q/70265.html

Related Q&A

Export environment variables at runtime with airflow

I am currently converting workflows that were implemented in bash scripts before to Airflow DAGs. In the bash scripts, I was just exporting the variables at run time withexport HADOOP_CONF_DIR="/e…

Extracting diagonal blocks from a numpy array

I am searching for a neat way to extract the diagonal blocks of size 2x2 that lie along the main diagonal of a (2N)x(2N) numpy array (that is, there will be N such blocks). This generalises numpy.diag,…

AttributeError: Unknown property density [duplicate]

This question already has an answer here:matplotlib histogram plot density argument not working(1 answer)Closed 3 years ago.I am trying to get a hold of SciPy, but I am stuck with Unknown property dens…

Find diagonals sums in numpy (faster)

I have some board numpy arrays like that:array([[0, 0, 0, 1, 0, 0, 0, 0],[1, 0, 0, 0, 0, 1, 0, 1],[0, 0, 0, 0, 0, 0, 0, 1],[0, 1, 0, 1, 0, 0, 0, 0],[0, 0, 0, 0, 0, 0, 0, 1],[0, 0, 0, 0, 1, 0, 0, 0],[0,…

Create dictionary from list python

I have many lists in this format:[1, O1, , , , 0.0000, 0.0000, , ] [2, AP, , , , 35.0000, 105.0000, , ] [3, EU, , , , 47.0000, 8.0000, , ]I need to create a dictionary with key as the first element in …

Outputting height of a pyramid

So for this coding exercise I have to input a number of imaginary blocks and it will tell me how many complete rows high the pyramid is. So for example if I input 6 blocks...I want it to tell me that t…

PySide SVG image formats not found?

I am using PyDev plugin for Eclipse with Qt integration. I have PySide installed and I am having trouble with SVG image formats. I know when I run my application the formats located in C:\Python27\Lib\…

convert ascii character to signed 8-bit integer python

This feels like it should be very simple, but I havent been able to find an answer..In a python script I am reading in data from a USB device (x and y movements of a USB mouse). it arrives in single AS…

What is the equivalent way of doing this type of pythonic vectorized assignment in MATLAB?

Im trying to translate this line of code from Python to MATLAB:new_img[M[0, :] - corners[0][0], M[1, :] - corners[1][0], :] = img[T[0, :], T[1, :], :]So, naturally, I wrote something like this:new_img(…

How do I connect mitmproxy to another proxy outside of my control?

The process would be that the browser send a request to MITMproxy and then generate a request that gets sent to target proxy server which isnt controlled by us. The proxy server would send a response t…