08 2012 档案

摘要:功能:标注二进制图像中已连接的部分。语法:L = bwlabel(BW,n) [L,num] = bwlabel(BW,n) 其中BW为输入图像;N可取值为4或8表示连接四连通或八连通区域;NUM为找到的连通区域数目;L为输出图像矩阵,其元素值为整数,背景被标记为0,第一个连通区域被标记为1,第二个连通区域被标记为2,依此类推.所以你不明白的1,2,3即为第1,2,3个连通区域的标记网上给出的解释大部分是不完整的,官网的解释L = bwlabel(BW, n) returns a matrix L, of the same size as BW, containing labels for t 阅读全文
posted @ 2012-08-20 11:19 小鸡蛋的理想 阅读(6310) 评论(0) 推荐(0)
摘要:针对min max用法:[m,n]=min(A), %A表示矩阵,即返回A中每列的最小值存于m中,n即是每个最小值的行号;[m1,n1]=min(m), %m1表示m中最小值,n1表示最小值的列号;这样解析是不是很清楚的呀。。。。。 阅读全文
posted @ 2012-08-20 10:26 小鸡蛋的理想 阅读(507) 评论(0) 推荐(0)
摘要:例如有10张图片,分别为1.bmp,2.bmp.....for i = 1:10 name1=num2str(i); filename=strcat(name1,'.bmp); img = imread(filename); filename = strcat(name1,'.jpg'); imwrite(img,filename); end 大家试试呀~~~~~~~~~~ 阅读全文
posted @ 2012-08-15 22:29 小鸡蛋的理想 阅读(825) 评论(0) 推荐(0)
摘要:在此用regionprops实现了二值图像划region,找质心clc; clear all; close all;I=imread('1.jpg');I1 = im2bw(I);figure; imshow(I, []);figure; imshow(I1, []);L = bwlabel(I1);stats = regionprops(L, 'all'); hold on;for i = 1 : length(stats) temp = stats(i).Centroid; plot(temp(1), temp(2), 'r.');end f 阅读全文
posted @ 2012-08-15 22:23 小鸡蛋的理想 阅读(845) 评论(0) 推荐(0)
摘要:f = fullfile(folderName1, folderName2, ..., fileName) builds a full file specification f from the folders and file name specified. Input arguments folderName1, folderName2, etc. and fileName are each strings enclosed in single quotation marks. The output of fullfile is conceptually equivalent to f = 阅读全文
posted @ 2012-08-02 20:16 小鸡蛋的理想 阅读(1607) 评论(0) 推荐(0)
摘要:functions:Graphical input from mouse or cursorginput提供了一个十字光标使我们能更精确的选择我们所需要的位置,并返回坐标值。函数调用形式为:[x,y] = ginput(n)[x,y] = ginput[x,y,button] = ginput(...)对于[x,y] = ginput(n),能使你从当前的坐标系中读取n个点,并返回这n个点的x,y坐标,均为nX1的向量。可以按回车提前结束读数。[x,y] = ginput 可以无限的读取坐标直到按下回车键。[x,y,button] = ginput(...) 返回x和y的坐标,以及button 阅读全文
posted @ 2012-08-02 10:31 小鸡蛋的理想 阅读(18183) 评论(1) 推荐(1)