magnitude and direction

3 次查看(过去 30 天)
munch kitty
munch kitty 2012-2-6
回答: ANIMA V A 2015-11-24
how to calculate the magnitude and direction value of the images in matlab?(code)
  2 个评论
Qura
Qura 2013-3-29
Hi! I want to construct histogram of gradient magnitude and gradient direction for each image gradient.angle are quantized by 45 Please help
Walter Roberson
Walter Roberson 2013-3-29
Please start a new Question for this problem.

请先登录,再进行评论。

回答(3 个)

Junaid
Junaid 2012-2-6
what do you mean by direction of images. I hope you are talking about gradient value and direction (orientation) ?
  3 个评论
Rupali
Rupali 2012-2-6
i want to know how to divide image into blocks ????????
munch kitty
munch kitty 2012-2-8
a=imread('image004.png'); a1=imresize(a,[300,340]);
cbs=100;
ck1=1; cblock(:,:,:,1)=a1(1:100,1:100,:);
cblock(:,:,:,5)=a1(101:200,1:100,:);
cblock(:,:,:,9)=a1(201:300,1:100,:);
for ci1=1:3
ck1=ck1+1;
for cj1=1:3
row1=80 ;
row2=180;
cblock(:,:,:,ck1)=a1( (cbs*(ci1-1)+1:cbs*(ci1-1)+cbs), ((row1+1)+(cj1-1)*80:row2+(cj1-1)*80),:);
ck1=ck1+1;
end
end
we divide the image into 3X4.overlap of some pixels..u can also do non overlapping..

请先登录,再进行评论。


Junaid
Junaid 2012-2-6
I think you want to compute the SIFT right ?
Anyway to divide the image into blocks, you can use following tip
in case you have difficulty you can share your code.
To find the gradient magnitude and orientation, the following code may help you.
angle = 360;
[GradientX,GradientY] = gradient(double(img));
Gr = sqrt((GradientX.*GradientX)+(GradientY.*GradientY));
index = GradientX == 0;
GradientX(index) = 1e-5;
YX = GradientY./GradientX;
A = ((atan2(GradientY,GradientX)+pi)*180)/pi;
A contains the orientation of each pixel.
  3 个评论
mano
mano 2012-2-8
i found the gradient and magnitude but i want to how to found gradient magnitude histogram?if u know help me
Lee
Lee 2013-3-25
Hi Junaid, may I know why parameter YX is calculated?

请先登录,再进行评论。


ANIMA V A
ANIMA V A 2015-11-24
How to compute gradient in three different directions? Can any one help me i need to compute the gradient in 3 different directions for an image please help me

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by