我使用我在这里找到的技术对浮游生物进行了细分,http://www.mathworks.com/help/images/examples/detecting-a-cell-using-image-segmentation.html
大纲也不错,但是,现在我不知道如何提取图像,因此可以单独保存每个浮游生物.我尝试使用标签,但是有很多噪音,它标出了每一个规格.我想知道是否有更好的方法来做到这一点.
这是我的代码:
I = imread('plankton_2.jpg');
figure, imshow(I), title('original image');
[~, threshold] = edge(I, 'sobel');
fudgeFactor = .5;
BWs = edge(I,'sobel', threshold * fudgeFactor);
figure, imshow(BWs), title('binary gradient mask');
se90 = strel('line', 3, 90);
se0 = strel('line', 3, 0);
BWsdil = imdilate(BWs, [se90 se0]);
figure, imshow(BWsdil), title('dilated gradient mask');
BWdfill = imfill(BWsdil, 'holes');
figure, imshow(BWdfill);
title('binary image with filled holes');
BWnobord = imclearborder(BWdfill,1);
figure, imshow(BWnobord), title('cleared border image');
seD = strel('diamond',1);
BWfinal = imerode(BWnobord,seD);
BWfinal = imerode(BWfinal,seD);
figure, …Run Code Online (Sandbox Code Playgroud) 首先,我从这个来源下载了 glut,http://user.xmission.com/~nate/glut.html">Nate Robins。我把:glut32.dll 放入 C:\Windows\SysWOW64,glut32.lib 放入 C:\ Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib glut.h 到 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\GL
在 Visual Studio 中,在 C++ 下我创建了一个空项目,将编译器更改为 64x。我确保选择所有配置并链接 opengl32.lib、glu32.lib 和 glut32.lib。
在工具 -> 选项 -> VC++ 目录 -> 包含文件:C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include 在配置属性中?链接器?其他库目录:C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib
/************************************
* Handout: example.cpp
*
* This program is to demonstrate the basic OpenGL program structure.
* Read the comments carefully for explanations.
************************************/
#define WINDOWS 1 /* Set to …Run Code Online (Sandbox Code Playgroud)