Replacing scalar value with vector-value data

조회 수: 1 (최근 30일)
Lee ZY
Lee ZY 2013년 6월 20일
Hi,
I came across an image segmentation paper that provides a function similar to,
w=exp(x), where x is the intensity difference between 2 pixels.
It's mentioned that, x can be modified to |x| to handle vector-valued such as colored data.
I am not quite sure about the integration of the vector-valued data into the function.
If I am not wrong, for instance, a RGB image, the vector of pixel-1 is ([r;g;b])[234;12;31], and pixel-2 is [233;10;30]
Therefore, to replace the x with |x|, does it simply mean, w=exp(xr+xg+xr) => w=exp(1+2+1) ?
Thanks in advance!

채택된 답변

Thorsten
Thorsten 2013년 6월 20일
You can use the Euclidean distance between the two pixels
p1 = [234;12;31];
p2 = [233;10;30];
x = norm(p1 - p2);
w = exp(x)
  댓글 수: 1
Lee ZY
Lee ZY 2013년 6월 21일
편집: Lee ZY 2013년 6월 21일
Thanks Thorsten!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Lee ZY
Lee ZY 2013년 6월 21일
Thanks Thorsten! Is it a common practice to include vector-valued data?
and the concatenation method as in the previous post is not an acceptable way?
Thank you very much!

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by