• 大小: 1.35MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-09
  • 语言: Matlab
  • 标签: 树叶识别  

资源简介

使用Matlab完成神经网络的树叶识别,需要使用到相关的数据库

资源截图

代码片段和文件信息

function [cnon] = inpoly(pnodeedgeTOL)

%  INPOLY: Point-in-polygon testing.
%
% Determine whether a series of points lie within the bounds of a polygon
% in the 2D plane. General non-convex multiply-connected polygonal
% regions can be handled.
%
% SHORT SYNTAX:
%
%   in = inpoly(pnode);
%
%   p   : The points to be tested as an Nx2 array [x1 y1; x2 y2; etc].
%   node: The vertices of the polygon as an Mx2 array [X1 Y1; X2 Y2; etc].
%         The standard syntax assumes that the vertices are specified in
%         consecutive order.
%
%   in  : An Nx1 logical array with IN(i) = TRUE if P(i:) lies within the
%         region.
%
% LONG SYNTAX:
%
%  [inon] = inpoly(pnodeedge);
%
%  edge: An Mx2 array of polygon edges specified as connections between
%        the vertices in NODE: [n1 n2; n3 n4; etc]. The vertices in NODE
%        do not need to be specified in connsecutive order when using the
%        extended syntax.
%
%  on  : An Nx1 logical array with ON(i) = TRUE if P(i:) lies on a
%        polygon edge. (A tolerance is used to deal with numerical
%        precision so that points within a distance of
%        eps^0.8*norm(node(:)inf) from a polygon edge are considered “on“
%        the edge.
%
% EXAMPLE:
%
%   polydemo;       % Will run a few examples
%
% See also INPOLYGON

% The algorithm is based on the crossing number test which counts the
% number of times a line that extends from each point past the right-most
% region of the polygon intersects with a polygon edge. Points with odd
% counts are inside. A simple implementation of this method requires each
% wall intersection be checked for each point resulting in an O(N*M)
% operation count.
%
% This implementation does better in 2 ways:
%
%   1. The test points are sorted by y-value and a binary search is used to
%      find the first point in the list that has a chance of intersecting
%      with a given wall. The sorted list is also used to determine when we
%      have reached the last point in the list that has a chance of
%      intersection. This means that in general only a small portion of
%      points are checked for each wall rather than the whole set.
%
%   2. The intersection test is simplified by first checking against the
%      bounding box for a given wall segment. Checking against the bbox is
%      an inexpensive alternative to the full intersection test and allows
%      us to take a number of shortcuts minimising the number of times the
%      full test needs to be done.
%
%   Darren Engwirda: 2005-2007
%   Email          : d_engwirda@hotmail.com
%   Last updated   : 23/11/2007 with MATLAB 7.0
%
% Problems or suggestions? Email me.

%% ERROR CHECKING
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if nargin<4
   TOL = 1.0e-12;
   if nargin<3
      edge = [];
      if nargin<2
         error(‘Insufficient inputs‘);
      end
   end
end
nnode = 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-12-19 08:16  树叶识别(改)\
     文件       90233  2014-12-04 18:52  树叶识别(改)\17.jpg
     文件       25297  2014-12-04 21:11  树叶识别(改)\20.jpg
     文件          66  2014-12-04 21:53  树叶识别(改)\data_test.txt
     文件        1181  2014-12-04 21:37  树叶识别(改)\data_train.txt
     文件        4721  2014-12-08 18:06  树叶识别(改)\GUI_leaf.fig
     文件        6392  2007-11-27 08:33  树叶识别(改)\inpoly.m
     文件       10380  2014-12-16 09:08  树叶识别(改)\nerve_leaf.m
     文件       27590  2014-11-16 20:57  树叶识别(改)\sangye.jpg
     文件      750955  2014-12-16 09:33  树叶识别(改)\数字图像处理大作业树叶识别+李达+计科1205+10.doc
     目录           0  2014-12-19 08:15  树叶识别(改)\桉叶\
     文件       72019  2014-12-04 18:51  树叶识别(改)\桉叶\10 - 副本.jpg
     文件       72019  2014-12-04 18:51  树叶识别(改)\桉叶\10.jpg
     文件       74090  2014-12-04 18:52  树叶识别(改)\桉叶\11.jpg
     文件       42658  2014-12-04 19:10  树叶识别(改)\桉叶\12.jpg
     文件       92225  2014-12-04 18:52  树叶识别(改)\桉叶\16.jpg
     文件       90233  2014-12-04 18:52  树叶识别(改)\桉叶\17.jpg
     文件         352  2014-12-04 19:22  树叶识别(改)\桉叶\data_an.txt
     文件        6392  2007-11-27 08:33  树叶识别(改)\桉叶\inpoly.m
     文件        9723  2014-12-04 19:12  树叶识别(改)\桉叶\leafRecognize.m
     文件        9699  2014-12-04 19:21  树叶识别(改)\桉叶\recognize_an.m
     目录           0  2014-12-19 08:15  树叶识别(改)\灌木叶\
     文件       20299  2014-12-04 21:07  树叶识别(改)\灌木叶\18.jpg
     文件       42505  2014-12-04 21:12  树叶识别(改)\灌木叶\19.jpg
     文件       25297  2014-12-04 21:11  树叶识别(改)\灌木叶\20.jpg
     文件       26144  2014-12-04 21:11  树叶识别(改)\灌木叶\21.jpg
     文件       24018  2014-12-04 21:11  树叶识别(改)\灌木叶\23.jpg
     文件         345  2014-12-04 21:26  树叶识别(改)\灌木叶\data_guan.txt
     文件         134  2014-12-01 21:36  树叶识别(改)\灌木叶\data_sang.txt
     文件        6392  2007-11-27 08:33  树叶识别(改)\灌木叶\inpoly.m
     文件        9699  2014-12-04 19:21  树叶识别(改)\灌木叶\recognize_an.m
............此处省略2个文件信息

评论

共有 条评论