我正在一个项目中,我要检测给定皮肤图像中的毛孔。我已经使用Java从OpenCv中尝试了各种方法(HoughCircles,BlobDetection和Contours),但是,我无法继续。
HoughCircles向我显示所有假圆,轮廓也是如此。我当前的代码使用斑点检测技术,该技术也未显示所需的内容。示例代码如下所示:
public void detectBlob() {
Mat orig = Highgui.imread("skin_pore.jpg",Highgui.IMREAD_GRAYSCALE);
Mat MatOut= new Mat();
FeatureDetector blobDetector;
blobDetector = FeatureDetector.create(FeatureDetector.SIFT);
MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
blobDetector.detect(orig,keypoints1);
org.opencv.core.Scalar cores = new org.opencv.core.Scalar(0,0,255);
org.opencv.features2d.Features2d.drawKeypoints(orig,keypoints1,MatOut,cores,2);
Highgui.imwrite("PhotoOut.jpg", MatOut);
}
public static void main(String args[]) {
BlobDetection bd = new BlobDetection();
bd.detectBlob();
}
当我使用FeatureDetector.SIMPLEBLOB而不是FeatureDetector.SIFT尝试相同的代码时,它显示几乎为0的斑点。
Is there any other algorithm which can help in achieving the result or what can be the appropriate approach to achieve this?
As you did not ask anything in your question I won't give you an answer. More some general advice.
That you tried to solve that problem using the named algorithms clearly shows that you have absolutely no clue what you are doing. You lack the very basics of image processing. It's like trying to win vs decent chess player if you don't even know how the figures can move.
I highly recommend that you get yourself a beginners book, read it and make sure you understand its contents. Then do some more research on the algorithms you want to use, befor you use them. You cannot take some arbitrary image, feed it into some random feature detection algorithm you find on the internet and expect to succeed.
Hough transform for cirles for example is good for finding circle shaped contours of a roughly known radius. If you know how it works internally you will know why it is not a good idea to use it on your image.
https://en.wikipedia.org/wiki/Circle_Hough_Transform
Blobdetection and contour based algorithms might work, but only after a lot of pre-processing. Your image is not very "segmentation-friendly"
https://en.wikipedia.org/wiki/Image_segmentation https://en.wikipedia.org/wiki/Blob_detection
A SIFT detector usually has to be taught using reference images and reference keypoints. I don't see this either in your code.
https://en.wikipedia.org/wiki/Scale-invariant_feature_transform
Please note that reading those wikipedia articles will only give you a first idea of what's going on. You have to read a lot more.
始终从处理链的开头开始。您可以获得更好的图像吗?(更好的意思是更适合您要检测的内容)。这就像10%的摄像头和90%的照明度。我不认为检测皮肤毛孔对于手机图像质量差是一项经典的工作,所以为什么不花些力气在您的成像设备上呢?
图像处理的第一条规则:废纸=废纸。您至少应更改照明角度,甚至应更改更好的方法(如阴影产生的形状)。
为您必须进行检测而优化的图像非常关键。这将使图像处理变得更加容易。
然后进行预处理:如何将拥有的图像转换为可以轻松提取特征的图像?
等等...
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句