When i try to run the program.. mygradient requires more input arguments..!!! I tried to add.. I=imread('121.jpg'); before function statement..It says you cannot add nested functions here.. How to input the image for my function?? please help.
function [Fx,Fy]=mygradient(I) %correctig gradient on edges I=imadjust(I); [hcol,hrow]=size(I); temp= ones(hcol+2,hrow+2); temp(2:1+hcol,2:1+hrow)=I(:,:);
Fx=filter2([1;0;-1],temp); Fx=Fx(3:hcol,3:hrow); Fy=filter2([1;0;-1]',temp); Fy=Fy(3:hcol,3:hrow);

 採用された回答

Image Analyst
Image Analyst 2015 年 2 月 22 日

0 投票

You can't have a function following a script in the same m-file. If your script is called test.m then you need to have
function test()
as the first line. It is okay to have two functions in the same m-file, but not a script and a function. Adding the function line converts your script into a function.

その他の回答 (1 件)

Dima Lisin
Dima Lisin 2015 年 2 月 22 日

0 投票

There is a built-in function for extracting hog features in the Computer Vision System Toolbox called extractHOGFeatures.

1 件のコメント

SRIVATHSA PRADHAN
SRIVATHSA PRADHAN 2015 年 2 月 23 日
Thank you very much Lisin..I was able to extract features of an image.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Computer Vision Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by