Filtering in matlab, how is the Laplacian matrix kernel derived?

I’m doing some filtering in matlab using the imfilter function. As I understand it, it is implemented with correlation/2D convolution.

The filter I am using is the Laplacian kernel, which is approximated by this matrix.

[ 0 -1 0; -1 4 -1; 0 -1 0]

But how is this matrix derived?

The reason I would like to know is because I am interested in better understanding the filtering process going on here so I can design my own filters to use with imfilter.

The Laplacian kernel essentially embosses the image but if I wanted to derive a filter that embosses, what process would I follow?

Edit: For those wondering about the 2D convolution of two matrices using the conv2 function with the parameter β€˜same’, this is how it is done.

  1. Your filter matrix, also called a kernel, or a mask, is flipped vertically and horizontally.

  2. It is placed over the matrix of your image, with the center entry aligned with the first entry of your image matrix. Some of the entries of the two matrices will be superimposed. This is why the filter matrix is also called a mask.

  3. The values of each of the super imposed entries are multiplied together and then add the products up. For example. If entry A(2,3) is superimposed with entry B(2,2) the values there are multiple together. If A(2,4) and B(2,3) are also superimposed, you multiple those together as well and then add the products. So N = A(2,3) * B(2,2) + A(2,4) * B(2,3)

  4. The value, N, from step 3 is the entry for the place in new image matrix at the location in the original image matrix that is aligned with the center of the filter matrix.

  5. The center of the filter matrix is moved to the next entry in the original image matrix and steps 2 through 5 repeat.

πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/SAINTnumberFIVE
πŸ“…︎ Feb 12 2020
🚨︎ report
Fun fact: Taking the smallest two non-zero eigenvalues of the Laplacian matrix of a network as (x,y) coordinates creates pretty graphs!
πŸ‘︎ 199
πŸ’¬︎
πŸ‘€︎ u/VodkaHaze
πŸ“…︎ Mar 11 2017
🚨︎ report
[Linear Algebra] Question regarding the quadratic form of Laplacian matrix

Hi, my question is that why here the x^(T)*A*x transitions the the sum?

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/wabhabin
πŸ“…︎ Apr 01 2020
🚨︎ report
Gradient and Laplacian of a Matrix Function?

I've been reading some applied math papers and the notion of the gradient of a matrix and Laplacian of a matrix keep coming up. I keep googling but nothing comes up (maybe I'm not googling the right things?).

If anyone knows how these are defined, please let me know!

πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/berlinettaBoi
πŸ“…︎ Jun 22 2019
🚨︎ report
What are you working on? - Weekly Discussion Thread - November 22, 2021

Hello /r/Physics.

It's everyone's favorite day of the week, again. Time to share (or rant about) how your research/work/studying is going and what you're working on this week.

πŸ‘︎ 45
πŸ’¬︎
πŸ‘€︎ u/AutoModerator
πŸ“…︎ Nov 22 2021
🚨︎ report
Can a correlation matrix be substituted for density matrix in calculation of Von Neumann entropy?

I am working on calculating entropy of a financial network. Researchers have tried to calculate density matrix for a graph by calculating a graph laplacian (see eq 10). However, accoriding to this answer on SO, correlation matrix can be substituted.
Please let me know if the SO answer is valid or not. Many thanks.

πŸ‘︎ 14
πŸ’¬︎
πŸ‘€︎ u/wishwazh
πŸ“…︎ Dec 28 2021
🚨︎ report
Blind Girl Here. Give Me Your Best Blind Jokes!

Do your worst!

πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Leckzsluthor
πŸ“…︎ Jan 02 2022
🚨︎ report
What starts with a W and ends with a T

It really does, I swear!

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/PsychedeIic_Sheep
πŸ“…︎ Jan 13 2022
🚨︎ report
Dropped my best ever dad joke & no one was around to hear it

For context I'm a Refuse Driver (Garbage man) & today I was on food waste. After I'd tipped I was checking the wagon for any defects when I spotted a lone pea balanced on the lifts.

I said "hey look, an escaPEA"

No one near me but it didn't half make me laugh for a good hour or so!

Edit: I can't believe how much this has blown up. Thank you everyone I've had a blast reading through the replies πŸ˜‚

πŸ‘︎ 19k
πŸ’¬︎
πŸ‘€︎ u/Vegetable-Acadia
πŸ“…︎ Jan 11 2022
🚨︎ report
This subreddit is 10 years old now.

I'm surprised it hasn't decade.

πŸ‘︎ 11k
πŸ’¬︎
πŸ‘€︎ u/frexyincdude
πŸ“…︎ Jan 14 2022
🚨︎ report
Word for a Name Humans give power to

There's this word that describes the phenomenon of a name that carries power due to the collective consciousness its devotees or venerators give to it.

Please what is it? I think it begins with "g". I can't really remember it. Thanks in advance!

πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/XXSkaterSneezeVII
πŸ“…︎ Jun 24 2021
🚨︎ report
What is a a bisexual person doing when they’re not dating anybody?

They’re on standbi

πŸ‘︎ 11k
πŸ’¬︎
πŸ‘€︎ u/Toby-the-Cactus
πŸ“…︎ Jan 12 2022
🚨︎ report
What do you call quesadillas you eat in the morning?

Buenosdillas

πŸ‘︎ 12k
πŸ’¬︎
πŸ‘€︎ u/FarronKeepSucks
πŸ“…︎ Jan 14 2022
🚨︎ report
Geddit? No? Only me?
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/shampy311
πŸ“…︎ Dec 28 2021
🚨︎ report
I wanna hear your best airplane puns.

Pilot on me!!

πŸ‘︎ 3k
πŸ’¬︎
πŸ‘€︎ u/Paulie_Felice
πŸ“…︎ Jan 07 2022
🚨︎ report
E or ß?
πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/Amazekam
πŸ“…︎ Jan 03 2022
🚨︎ report
i Karenough to
πŸ‘︎ 4k
πŸ’¬︎
πŸ‘€︎ u/Amazekam
πŸ“…︎ Jan 14 2022
🚨︎ report
No spoilers
πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/Onfour
πŸ“…︎ Jan 06 2022
🚨︎ report
Covid problems
πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/theincrediblebou
πŸ“…︎ Jan 12 2022
🚨︎ report
These aren't dad jokes...

Dad jokes are supposed to be jokes you can tell a kid and they will understand it and find it funny.

This sub is mostly just NSFW puns now.

If it needs a NSFW tag it's not a dad joke. There should just be a NSFW puns subreddit for that.

Edit* I'm not replying any longer and turning off notifications but to all those that say "no one cares", there sure are a lot of you arguing about it. Maybe I'm wrong but you people don't need to be rude about it. If you really don't care, don't comment.

πŸ‘︎ 12k
πŸ’¬︎
πŸ‘€︎ u/Lance986
πŸ“…︎ Dec 15 2021
🚨︎ report
I had a vasectomy because I didn’t want any kids.

When I got home, they were still there.

πŸ‘︎ 10k
πŸ’¬︎
πŸ‘€︎ u/demotrek
πŸ“…︎ Jan 13 2022
🚨︎ report
What did 0 say to 8 ?

What did 0 say to 8 ?

" Nice Belt "

So What did 3 say to 8 ?

" Hey, you two stop making out "

πŸ‘︎ 9k
πŸ’¬︎
πŸ‘€︎ u/designjeevan
πŸ“…︎ Jan 03 2022
🚨︎ report
Spi__
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/Fast_Echidna_8520
πŸ“…︎ Jan 11 2022
🚨︎ report
I dislike karma whores who make posts that imply it's their cake day, simply for upvotes.

I won't be doing that today!

πŸ‘︎ 15k
πŸ’¬︎
πŸ‘€︎ u/djcarves
πŸ“…︎ Dec 27 2021
🚨︎ report
The Ancient Romans II
πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/mordrathe
πŸ“…︎ Dec 29 2021
🚨︎ report
How do you stop Canadian bacon from curling in your frying pan?

You take away their little brooms

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/Majorpain2006
πŸ“…︎ Jan 09 2022
🚨︎ report
I did it, I finally did it. After 4 years and 92 days I went from being a father, to a dad.

This morning, my 4 year old daughter.

Daughter: I'm hungry

Me: nerves building, smile widening

Me: Hi hungry, I'm dad.

She had no idea what was going on but I finally did it.

Thank you all for listening.

πŸ‘︎ 17k
πŸ’¬︎
πŸ‘€︎ u/Sk2ec
πŸ“…︎ Jan 01 2022
🚨︎ report
It this sub dead?

There hasn't been a post all year!

πŸ‘︎ 13k
πŸ’¬︎
πŸ‘€︎ u/TheTreelo
πŸ“…︎ Jan 01 2022
🚨︎ report
School Was Clothed
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Kennydoe
πŸ“…︎ Jan 08 2022
🚨︎ report
I'd like to dedicate this joke to my wisdom teeth.

[Removed]

πŸ‘︎ 6k
πŸ’¬︎
πŸ‘€︎ u/ThoughtPumP
πŸ“…︎ Jan 14 2022
🚨︎ report
Letting loose with these puns
πŸ‘︎ 6k
πŸ’¬︎
πŸ“…︎ Jan 13 2022
🚨︎ report
Couch potato
πŸ‘︎ 8k
πŸ’¬︎
πŸ“…︎ Dec 31 2021
🚨︎ report
Baka!
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/ridi86
πŸ“…︎ Jan 09 2022
🚨︎ report
concrete πŸ—Ώ
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/Fast_Echidna_8520
πŸ“…︎ Jan 07 2022
🚨︎ report
All dad jokes are bad and here’s why

Why

πŸ‘︎ 7k
πŸ’¬︎
πŸ‘€︎ u/LordCinko
πŸ“…︎ Jan 13 2022
🚨︎ report
My name is ABCDEFGHIJKMNOPQRSTUVWXYZ

It’s pronounced β€œNoel.”

πŸ‘︎ 14k
πŸ’¬︎
πŸ‘€︎ u/beef_fried_rice
πŸ“…︎ Dec 25 2021
🚨︎ report
Why are people so surprised and angry about Djokovic being an anti-vaxxer?

After all his first name is No-vac

πŸ‘︎ 4k
πŸ’¬︎
πŸ‘€︎ u/hangryman23
πŸ“…︎ Jan 06 2022
🚨︎ report
That’s Michelle
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/FLEXSEALBREAKER
πŸ“…︎ Jan 10 2022
🚨︎ report
If Korean pop is shortened to Kpop and Korean Drama is Kdrama...

What, then, is Chinese rap?

Edit:

Notable mentions from the comments:

  • Spanish/Swedish/Swiss/Serbian hits

  • French/Finnish art

  • Country/Canadian rap

  • Chinese/Country/Canadian rock

  • Turkish/Tunisian/Taiwanese rap

πŸ‘︎ 3k
πŸ’¬︎
πŸ‘€︎ u/hootanahalf
πŸ“…︎ Jan 09 2022
🚨︎ report
Is this sub still active?

There hasn't been a single post this year!

(Happy 2022 from New Zealand)

πŸ‘︎ 10k
πŸ’¬︎
πŸ‘€︎ u/DonStimpo
πŸ“…︎ Dec 31 2021
🚨︎ report
What did the ocean say to the beach?

Nothing, it just waved

πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/hackerboi1198
πŸ“…︎ Jan 13 2022
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.