I learned about HOG feature from here following this tutorial I am trying to create HOG feature...I have approached till here..
#include "stdafx.h"
#include <conio.h>
#include <iostream>
#include <iomanip>
#include <opencv2/opencv.hpp>
#include <opencv2\core\core.hpp>
using namespace cv;
using namespace cv;
using namespace ml;
using namespace std;
void main()
{
Mat h1,h2,h3;
Mat image=imread("lena.jpg");
image.convertTo(image,CV_32F,1/255.0);
imshow("out",image);
Mat dx,dy; //image axial derivatives..
Sobel(image,dx,CV_32F,1,0,1);
Sobel(image,dy,CV_32F,0,1,1);
imshow("dx",dx);
imshow("dy",dy);
Mat mag,angle;
cartToPolar(dx,dy,mag,angle);
imshow("magnitude",mag);
imshow("angle",angle);
waitKey(0);
_getch();
}
I have obtained image~derivative of orignal image and mapped to polar coordinate system.Now I obtained two matrices represent gradient and its orientation namely mag and angle respectively.Now I have to obtain histogram of gradients over 8x8 patch of image...how shall I proceed next
I AM NOT FOND OF USING PRE BUILD HOG DESCRIPTOR..
I am quite sure its not a good idea...But
Thank you