使用opencv标记静脉 [英] Marking veins using opencv

查看:118
本文介绍了使用opencv标记静脉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一种使用Python中的OpenCV在图像中标记静脉的方法.我碰到的大多数类似文章都使用CLAHE来产生结果,我在灰度图像上做了多次CLAHE,这确实使静脉更加可见,但我想不出一种方法来用不同的颜色标记静脉. CLAHE还大大降低了整体图像质量.

I was trying to figure out a way to mark the veins in an image using OpenCV in Python. Most of the similar articles i came across uses CLAHE to produce a result,I did CLAHE multiple times on grayscale image, and it did make the veins more viewable but i cant figure out a way to mark the vein in a different color. CLAHE also significantly reduces the overall image quality.

我的输入图片:

CLAHE经过4次:

After CLAHE 4 times:

代码:

import numpy as np
import cv2

def multi_clahe(img, num):
    for i in xrange(num):
        img = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(4+i*2,4+i*2)).apply(img)
    return img

img = cv2.imread('img.png')

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

final = multi_clahe(gray, 4)

cv2.imwrite('image.png',final)
cv2.imshow('image',final)

cv2.waitKey(0)
cv2.destroyAllWindows()

推荐答案

以下是要遵循的方法-

  • 无法在手外找到静脉.因此,通过将图像转换为具有低,高皮肤值的hsv和cv2.inRange()来消除废话.如果您找不到合适的值,请制作一个跟踪栏.

  • 与握住它的手的褶皱相比,您的皮肤更光滑.使用适当参数的Canny边缘,稍微扩张一下,然后通过与"运算滤除高频部分.

  • 克拉拉
  • 自适应阈值
  • 形态学和噪声消除操作.

建议改善输出:

  1. 以理想的手臂获得更好的图像设置.
  2. 找出CLAHE,阈值,Canny的适当参数

这篇关于使用opencv标记静脉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆