Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

HOG descriptor (descripe shape and motion)

can anyone help me please,i use hog descriptor to descripe detected interest poins ,

hog descriptor steps: 1- take image and compute gradient of graysacle input image then descripe it.

how can i update it to compute HOF (histogram of optical flow)??as the ouput of optical flow is gradient magnitudes from optical flow fields , so really i compute gradient for opticl flow so i don't need to compute gradient again in embeded code of HOG

keypoints = cv.FAST(im,'Threshold',30,'NonMaxSupression',1); hog = cv.HOGDescriptor('WinSize',[16,16],'BlockSize',[8,8],'BlockStride',[4,4],'CellSize',[4,4] ); descriptors = hog.compute(im, 'Locations', {keypoints.pt});first shape decriptor

prevIm = cv.cvtColor(imread('test\img1.jpeg'),'RGB2GRAY'); nextIm = cv.cvtColor(imread('test\img2.jpeg'),'RGB2GRAY'); flow = cv.calcOpticalFlowFarneback(prevIm, nextIm); Fx=flow(:,:,1); Fy=flow(:,:,2); *magnitudeImage = (Fx.^2 + Fy.^2 ).^0.5; descriptors2 = hog.compute(im2uint8(magnitudeImage) , 'Locations', {keypoints.pt});???????????/is this true*second motion descriptor

HOG descriptor (descripe shape and motion)

can anyone help me please,i use hog descriptor to descripe detected interest poins ,

hog descriptor steps: 1- steps:

  • take image and compute gradient of graysacle input image image
  • then descripe it.

    it

how How can i update it to compute HOF (histogram of optical flow)??as flow)??

As the ouput of optical flow is gradient magnitudes from optical flow fields , so really i compute gradient for opticl flow optical flow, so i don't need to compute gradient again in embeded code of HOG

keypoints = cv.FAST(im,'Threshold',30,'NonMaxSupression',1);
hog = cv.HOGDescriptor('WinSize',[16,16],'BlockSize',[8,8],'BlockStride',[4,4],'CellSize',[4,4] );
descriptors = hog.compute(im, 'Locations', {keypoints.pt});first {keypoints.pt});

first shape decriptor

prevIm = cv.cvtColor(imread('test\img1.jpeg'),'RGB2GRAY');
nextIm = cv.cvtColor(imread('test\img2.jpeg'),'RGB2GRAY');
flow = cv.calcOpticalFlowFarneback(prevIm, nextIm);
Fx=flow(:,:,1);
Fy=flow(:,:,2);
*magnitudeImage 
magnitudeImage  = (Fx.^2 + Fy.^2 ).^0.5;
descriptors2 = hog.compute(im2uint8(magnitudeImage) , 'Locations', {keypoints.pt});???????????/is this true*true

second motion descriptor