精华内容
下载资源
问答
  • ·对于部分图像,会出现整体较暗或较亮的情况,这是由于图片的灰度值范围较小,即对比度低。实际应用中,通过绘制图片的灰度直方图,可以很明显的判断图片的灰度值分布,区分其对比度高低。对于对比度较低的图片,...

      ·对于部分图像,会出现整体较暗或较亮的情况,这是由于图片的灰度值范围较小,即对比度低。实际应用中,通过绘制图片的灰度直方图,可以很明显的判断图片的灰度值分布,区分其对比度高低。对于对比度较低的图片,可以通过一定的算法来增强其对比度。常用的方法有线性变换,伽马变换,直方图均衡化,局部自适应直方图均衡化等。

    1. 灰度直方图及绘制

      灰度直方图用来描述每个像素在图像矩阵中出现的次数或概率。其横坐标一般为0-255个像素值,纵坐标为该像素值对应的像素点个数。如下图所示的图像矩阵(单通道灰度图,三通道时可以分别绘制),可以统计每个像素值出现的次数,也可以统计概率,统计像素值出现次数的灰度直方图如下所示。

            

        

      

      灰度直方图绘制

        a, 可以利用opencv的calcHist()统计像素值出现次数,通过matploblib的plot()绘制

        b, 可以直接利用matploblib的hist()方法     

    cv2.calcHist()
        参数:    
            img:输入图像,为列表,如[img]
            channels: 计算的通道,为列表,如[0]表示单通道,[0,1]统计两个通道
            mask: 掩模,和输入图像大小一样的矩阵,为1的地方会进行统计(与图像逻辑与后再统计);无掩模时为None
            histSize: 每一个channel对应的bins个数,为列表,如[256]表示256个像素值
            ranges: bins的边界,为列表,如[0,256]表示像素值范围在0-256之间
            accumulate: Accumulation flag. If it is set, the histogram is not cleared in the beginning when it is allocated. This feature enables you to compute a single histogram from several sets of arrays, or to update the histogram in time.
            

      如下图所示,分别绘制了灰度分布曲线图,灰度分布直方图和两者叠加图形,代码如下:

    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
                    
    img = cv.imread(r"C:\Users\Administrator\Desktop\maze.png",0)
    
    hist = cv.calcHist([img],[0],None,[256],[0,256])
    
    plt.subplot(1,3,1),plt.plot(hist,color="r"),plt.axis([0,256,0,np.max(hist)])
    plt.xlabel("gray level")
    plt.ylabel("number of pixels")
    
    plt.subplot(1,3,2),plt.hist(img.ravel(),bins=256,range=[0,256]),plt.xlim([0,256])
    plt.xlabel("gray level")
    plt.ylabel("number of pixels")
    
    plt.subplot(1,3,3)
    plt.plot(hist,color="r"),plt.axis([0,256,0,np.max(hist)])
    plt.hist(img.ravel(),bins=256,range=[0,256]),plt.xlim([0,256])
    plt.xlabel("gray level")
    plt.ylabel("number of pixels")
    
    plt.show()
    View Code

        

      c.通过np.histogram()和plt.hist()也可以计算出灰度值分布

    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\maze.png",0)
    histogram,bins = np.histogram(img,bins=256,range=[0,256])
    print(histogram)
    plt.plot(histogram,color="g")
    plt.axis([0,256,0,np.max(histogram)])
    plt.xlabel("gray level")
    plt.ylabel("number of pixels")
    plt.show()
    np.histogram()
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\maze.png",0)
    rows,cols = img.shape
    hist = img.reshape(rows*cols)
    histogram,bins,patch = plt.hist(hist,256,facecolor="green",histtype="bar") #histogram即为统计出的灰度值分布
    plt.xlabel("gray level")
    plt.ylabel("number of pixels")
    plt.axis([0,255,0,np.max(histogram)])
    plt.show()
    plt.hist()

    2. 对比度增强

      对比度增强,即将图片的灰度范围拉宽,如图片灰度分布范围在[50,150]之间,将其范围拉升到[0,256]之间。这里介绍下 线性变换,直方图正规化,伽马变换,全局直方图均衡化,限制对比度自适应直方图均衡化等算法。

      2.1 线性变换

        通过函数y=ax+b对灰度值进行处理,例如对于过暗的图片,其灰度分布在[0,100], 选择a=2,b=10能将灰度范围拉伸到[10, 210]。可以通过np或者opencv的convertScaleAbs()函数来实现,对应参数列表如下:   

    cv2.convertScaleAbs(src,alpha,beta)
        src: 图像对象矩阵
       dst:输出图像矩阵 alpha:y
    =ax+b中的a值 beta:y=ax+b中的b值 (对于计算后大于255的像素值会截断为255)

        使用示例代码和效果图如下:

    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")
    print(img)
    img_bright = cv.convertScaleAbs(img,alpha=1.5,beta=0)
    print(img_bright)
    
    cv.imshow("img",img)
    cv.imshow("img_bright",img_bright)
    cv.waitKey(0)
    cv.destroyAllWindows()
    convertScaleAbs()
    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")
    a=1.5
    b=0
    y = np.float(a)*img+b
    y[y>255]=255
    y = np.round(y)
    img_bright= y.astype(np.uint8)
    
    cv.imshow("img",img)
    cv.imshow("img_bright",img_bright)
    cv.waitKey(0)
    cv.destroyAllWindows()
    numpy实现

    (实用性:numpy自定义实现时,可以针对不同区间像素点,采用不同系数a,b来动态改变像素值) 

       

      2.2 直方图正规化

        对于上述线性变换,系数a,b需要自己摸索设置。直方图正规化的系数固定,一般将原图片的像素值范围映射到[0,255]范围内。假设原图片的像素值分布范围为Input:[min, max], 映射后的范围为Output:[0,255], 则对应的系数a=(255-0)/(max-min),  系数b=0。即计算公式:

                    

        opencv提供了normalize()函数来实现灰度正规化,对应参数列表如下:

    cv2.normalize(src,dst,alpha,beta,normType,dtype,mask)
            参数:
            src: 图像对象矩阵
            dst:输出图像矩阵(和src的shape一样)
            alpha:正规化的值,如果是范围值,为范围的下限 (alpha – norm value to normalize to or the lower range boundary in case of the range normalization.)
            beta:如果是范围值,为范围的上限;正规化中不用到 ( upper range boundary in case of the range normalization; it is not used for the norm normalization.)
            norm_type:normalize的类型
                        cv2.NORM_L1:将像素矩阵的1-范数做为最大值(矩阵中值的绝对值的和)
                        cv2.NORM_L2:将像素矩阵的2-范数做为最大值(矩阵中值的平方和的开方)
                        cv2.NORM_MINMAX:将像素矩阵的∞-范数做为最大值 (矩阵中值的绝对值的最大值)
                        
            dtype: 输出图像矩阵的数据类型,默认为-1,即和src一样
            mask:掩模矩阵,只对感兴趣的地方归一化

        (对于alpha的值,不是很清楚含义,经过试验,应该是一个锚点,用像素矩阵中的范数计算出来的比例和alpha相乘,当dtype为cv2.NORM_MINMAX时,其计算公式类似如下:

                

        使用示例代码和效果图如下:

    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")
    img_norm=cv.normalize(img,dst=None,alpha=350,beta=10,norm_type=cv.NORM_MINMAX)
    cv.imshow("img",img)
    cv.imshow("img_norm",img_norm)
    cv.waitKey(0)
    cv.destroyAllWindows()
    cv.normalize()
    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")
    out_min=0
    out_max=255
    
    in_min = np.min(img)
    in_max = np.max(img)
    
    a=float(out_max-out_min)/(in_max-in_min)
    b=out_min-a*in_min
    img_norm = img*a+b
    img_norm = img_norm.astype(np.uint8)
    cv.imshow("img",img)
    cv.imshow("img_norm",img_norm)
    cv.waitKey(0)
    cv.destroyAllWindows()
    numpy实现类似normalize

     

       2.3 伽马变换

        将输入图像的像素值除以255,归一化到[0,1]区间,然后计算其γ次方值,用公式表示如下,其中I(r,c)为归一化后的像素值,当γ=1时原像素值不影响,当0<γ<1时,增大像素值,提高图片对比度;反之γ>1时能降低图片对比度。

                

         实现代码和示例如下:

    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")
    img_norm = img/255.0  #注意255.0得采用浮点数
    img_gamma = np.power(img_norm,0.4)*255.0
    img_gamma = img_gamma.astype(np.uint8)
    
    cv.imshow("img",img)
    cv.imshow("img_gamma",img_gamma)
    cv.waitKey(0)
    cv.destroyAllWindows()
    numpy实现伽马变换

     

       2.4 全局直方图均衡化

       直方图均衡化的目的是将原图片每个像素值的像素点个数进行重新分配到[0,255]的256个像素值上,使得每个像素值对应的像素点个数近似相等,即重新分配后,0-255的每个像素值对应的像素点个数近似为(rows*cols/256),(直方图均衡化对应的数学原理参考:https://blog.csdn.net/superjunenaruto/article/details/52431941)。opencv里面equalizeHist()函数实现了相应的功能,只能处理单通道数据,参数列表如下:

    cv2.equalizeHist(src,dst)
            src: 图像对象矩阵,必须为单通道的uint8类型的矩阵数据
            dst:输出图像矩阵(和src的shape一样)

        实现代码和示例如下:

    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    import math
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg",0)
    img_equalize = cv.equalizeHist(img)
    cv.imshow("img",img)
    cv.imshow("img_equalize",img_equalize)
    cv.waitKey(0)
    cv.destroyAllWindows()
    opencv equalizeHist()
    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    import math
    
    #统计灰度分布
    def calc_hist(img):
        rows,cols = img.shape[:2]
        hist=np.zeros(256,np.uint64)   #注意此处的数据格式不要用np.uint8,会溢出但不报错
        for r in range(rows):
            for c in range(cols):
                hist[img[r,c]]+=1
    
        return hist
        
    
    def equalize_hist(img):
        rows,cols = img.shape[:2]
        hist = calc_hist(img)
        
        
        #计算灰度累积分布
        hist_sum=np.zeros([256],np.uint32)  #注意数据类型为np.uint32,防止溢出
        for i in range(256):
            if i==0:
                hist_sum[i]=hist[i]
            else:
                hist_sum[i] = hist[i]+hist_sum[i-1]
                
        
        #输出图像的灰度分布        
        output_hist = np.zeros(256,np.uint8)    
        cofficient= 256.0/(rows*cols)
        for i in range(256):
            q = cofficient*float(hist_sum[i])-1
            if q>=0:
                output_hist[i]=math.floor(q)
            else:
                output_hist[i]=0
        
        
        #输出图像的像素值
        output_img=np.zeros([rows,cols],np.uint8)
        for r in range(rows):
            for c in range(cols):
                output_img[r,c]=output_hist[img[r,c]]
            
        return output_img        
        
    if __name__=="__main__":
        img = cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg",0)
        img_equalize=equalize_hist(img)
        cv.imshow("img",img)
        cv.imshow("img_equalize",img_equalize)
        cv.waitKey(0)
        cv.destroyAllWindows()
    使用numpy实现equalizeHist

     (通过numpy实现equalizeHist的算法思路参见直方图均衡化的数学原理,这里没写出。。。。。)

        2.5 限制对比度自适应直方图均衡化

          相比全局直方图均衡化,自适应直方图均衡化将图像划分为不重叠的小块,在每一小块进行直方图均衡化,但若小块内有噪声,影响很大,需要通过限制对比度来进行抑制,即限制对比度自适应直方图均衡化。如果限制对比度的阈值设置会40,在局部直方图分布中某个像素值出现次数为45,那么多出的5次像素点会被去掉,平均成其他像素值,如图所示:

            

    opencv通过createCLAHE()和apply()函数来实现,其对应参数如下:

    clahe=cv2.createCLAHE(clipLimit,tileGridSize)
            clipLimit:限制对比度的阈值,默认为40,直方图中像素值出现次数大于该阈值,多余的次数会被重新分配
            tileGridSize:图像会被划分的size, 如tileGridSize=(8,8),默认为(8,8)
        
    calhe.apply(img) #对img进行限制对比度自适应直方图均衡化

          代码示例和效果如下:(实际使用中可以先去噪声,再进行对比度增强)

    #coding:utf-8
    
    import cv2 as cv
    import matplotlib.pyplot as plt
    import numpy as np
    import math
    
    img = cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg",0)
    clahe = cv.createCLAHE(3,(8,8))
    dst = clahe.apply(img)
    cv.imshow("img",img)
    cv.imshow("dst",dst)
    cv.waitKey(0)
    cv.destroyAllWindows()
    createCLAHE()

     

    参考:

      官方文档:https://www.docs.opencv.org/4.1.0/

     

    转载于:https://www.cnblogs.com/silence-cho/p/11006958.html

    展开全文
  • ·对于部分图像,会出现整体较暗或较亮的情况,这是由于图片的灰度值范围较小,即对比度低。实际应用中,通过绘制图片的灰度直方图,可以很明显的判断图片的灰度值分布,区分其对比度高低。对于对比度较低的图片,...

    ·对于部分图像,会出现整体较暗或较亮的情况,这是由于图片的灰度值范围较小,即对比度低。实际应用中,通过绘制图片的灰度直方图,可以很明显的判断图片的灰度值分布,区分其对比度高低。对于对比度较低的图片,可以通过一定的算法来增强其对比度。常用的方法有线性变换,伽马变换,直方图均衡化,局部自适应直方图均衡化等。

    1. 灰度直方图及绘制

    灰度直方图用来描述每个像素在图像矩阵中出现的次数或概率。其横坐标一般为0-255个像素值,纵坐标为该像素值对应的像素点个数。如下图所示的图像矩阵(单通道灰度图,三通道时可以分别绘制),可以统计每个像素值出现的次数,也可以统计概率,统计像素值出现次数的灰度直方图如下所示。

    1483773-20190611223530605-1836261822.png

    1483773-20190611230817775-95219485.png

    灰度直方图绘制

    a, 可以利用opencv的calcHist()统计像素值出现次数,通过matploblib的plot()绘制

    b, 可以直接利用matploblib的hist()方法

    cv2.calcHist()

    参数:

    img:输入图像,为列表,如[img]

    channels: 计算的通道,为列表,如[0]表示单通道,[0,1]统计两个通道

    mask: 掩模,和输入图像大小一样的矩阵,为1的地方会进行统计(与图像逻辑与后再统计);无掩模时为None

    histSize: 每一个channel对应的bins个数,为列表,如[256]表示256个像素值

    ranges: bins的边界,为列表,如[0,256]表示像素值范围在0-256之间

    accumulate: Accumulation flag. If itis set, the histogram is not cleared in the beginning when it is allocated. This feature enables you to compute a single histogram from several sets of arrays, or to update the histogram intime.

    如下图所示,分别绘制了灰度分布曲线图,灰度分布直方图和两者叠加图形,代码如下:

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    img= cv.imread(r"C:\Users\Administrator\Desktop\maze.png",0)

    hist= cv.calcHist([img],[0],None,[256],[0,256])

    plt.subplot(1,3,1),plt.plot(hist,color="r"),plt.axis([0,256,0,np.max(hist)])

    plt.xlabel("gray level")

    plt.ylabel("number of pixels")

    plt.subplot(1,3,2),plt.hist(img.ravel(),bins=256,range=[0,256]),plt.xlim([0,256])

    plt.xlabel("gray level")

    plt.ylabel("number of pixels")

    plt.subplot(1,3,3)

    plt.plot(hist,color="r"),plt.axis([0,256,0,np.max(hist)])

    plt.hist(img.ravel(),bins=256,range=[0,256]),plt.xlim([0,256])

    plt.xlabel("gray level")

    plt.ylabel("number of pixels")

    plt.show()

    View Code

    1483773-20190612223116340-827573379.png

    c.通过np.histogram()和plt.hist()也可以计算出灰度值分布

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    img= cv.imread(r"C:\Users\Administrator\Desktop\maze.png",0)

    histogram,bins= np.histogram(img,bins=256,range=[0,256])

    print(histogram)

    plt.plot(histogram,color="g")

    plt.axis([0,256,0,np.max(histogram)])

    plt.xlabel("gray level")

    plt.ylabel("number of pixels")

    plt.show()

    np.histogram()

    ContractedBlock.gif

    ExpandedBlockStart.gif

    import cv2 ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    img= cv.imread(r"C:\Users\Administrator\Desktop\maze.png",0)

    rows,cols=img.shape

    hist= img.reshape(rows*cols)

    histogram,bins,patch= plt.hist(hist,256,facecolor="green",histtype="bar") #histogram即为统计出的灰度值分布

    plt.xlabel("gray level")

    plt.ylabel("number of pixels")

    plt.axis([0,255,0,np.max(histogram)])

    plt.show()

    plt.hist()

    2. 对比度增强

    对比度增强,即将图片的灰度范围拉宽,如图片灰度分布范围在[50,150]之间,将其范围拉升到[0,256]之间。这里介绍下 线性变换,直方图正规化,伽马变换,全局直方图均衡化,限制对比度自适应直方图均衡化等算法。

    2.1 线性变换

    通过函数y=ax+b对灰度值进行处理,例如对于过暗的图片,其灰度分布在[0,100], 选择a=2,b=10能将灰度范围拉伸到[10, 210]。可以通过np或者opencv的convertScaleAbs()函数来实现,对应参数列表如下:

    cv2.convertScaleAbs(src,alpha,beta)

    src: 图像对象矩阵

    dst:输出图像矩阵

    alpha:y=ax+b中的a值

    beta:y=ax+b中的b值

    (对于计算后大于255的像素值会截断为255)

    使用示例代码和效果图如下:

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    img= cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")

    print(img)

    img_bright= cv.convertScaleAbs(img,alpha=1.5,beta=0)

    print(img_bright)

    cv.imshow("img",img)

    cv.imshow("img_bright",img_bright)

    cv.waitKey(0)

    cv.destroyAllWindows()

    convertScaleAbs()

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    img= cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")

    a=1.5b=0y= np.float(a)*img+b

    y[y>255]=255y=np.round(y)

    img_bright=y.astype(np.uint8)

    cv.imshow("img",img)

    cv.imshow("img_bright",img_bright)

    cv.waitKey(0)

    cv.destroyAllWindows()

    numpy实现

    (实用性:numpy自定义实现时,可以针对不同区间像素点,采用不同系数a,b来动态改变像素值)

    1483773-20190612232424840-1694665209.png

    2.2 直方图正规化

    对于上述线性变换,系数a,b需要自己摸索设置。直方图正规化的系数固定,一般将原图片的像素值范围映射到[0,255]范围内。假设原图片的像素值分布范围为Input:[min, max], 映射后的范围为Output:[0,255], 则对应的系数a=(255-0)/(max-min), 系数b=0。即计算公式:

    1483773-20190612234154746-1158486747.png

    opencv提供了normalize()函数来实现灰度正规化,对应参数列表如下:

    cv2.normalize(src,dst,alpha,beta,normType,dtype,mask)

    参数:

    src: 图像对象矩阵

    dst:输出图像矩阵(和src的shape一样)

    alpha:正规化的值,如果是范围值,为范围的下限 (alpha – norm value to normalize to or the lower range boundaryin caseof the range normalization.)

    beta:如果是范围值,为范围的上限;正规化中不用到 ( upper range boundaryin case of the range normalization; it is not used forthe norm normalization.)

    norm_type:normalize的类型

    cv2.NORM_L1:将像素矩阵的1-范数做为最大值(矩阵中值的绝对值的和)

    cv2.NORM_L2:将像素矩阵的2-范数做为最大值(矩阵中值的平方和的开方)

    cv2.NORM_MINMAX:将像素矩阵的∞-范数做为最大值 (矩阵中值的绝对值的最大值)

    dtype: 输出图像矩阵的数据类型,默认为-1,即和src一样

    mask:掩模矩阵,只对感兴趣的地方归一化

    (对于alpha的值,不是很清楚含义,经过试验,应该是一个锚点,用像素矩阵中的范数计算出来的比例和alpha相乘,当dtype为cv2.NORM_MINMAX时,其计算公式类似如下:

    1483773-20190613220617230-1496984838.png

    使用示例代码和效果图如下:

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    img= cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")

    img_norm=cv.normalize(img,dst=None,alpha=350,beta=10,norm_type=cv.NORM_MINMAX)

    cv.imshow("img",img)

    cv.imshow("img_norm",img_norm)

    cv.waitKey(0)

    cv.destroyAllWindows()

    cv.normalize()

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    img= cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")

    out_min=0out_max=255in_min=np.min(img)

    in_max=np.max(img)

    a=float(out_max-out_min)/(in_max-in_min)

    b=out_min-a*in_min

    img_norm= img*a+b

    img_norm=img_norm.astype(np.uint8)

    cv.imshow("img",img)

    cv.imshow("img_norm",img_norm)

    cv.waitKey(0)

    cv.destroyAllWindows()

    numpy实现类似normalize

    1483773-20190613215437501-697904306.png

    2.3 伽马变换

    将输入图像的像素值除以255,归一化到[0,1]区间,然后计算其γ次方值,用公式表示如下,其中I(r,c)为归一化后的像素值,当γ=1时原像素值不影响,当0<γ<1时,增大像素值,提高图片对比度;反之γ>1时能降低图片对比度。

    1483773-20190613222717955-1686406676.png

    1483773-20190613223242977-1529816125.png

    实现代码和示例如下:

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    img= cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg")

    img_norm= img/255.0#注意255.0得采用浮点数

    img_gamma= np.power(img_norm,0.4)*255.0img_gamma=img_gamma.astype(np.uint8)

    cv.imshow("img",img)

    cv.imshow("img_gamma",img_gamma)

    cv.waitKey(0)

    cv.destroyAllWindows()

    numpy实现伽马变换

    1483773-20190613224529246-433758417.png

    2.4 全局直方图均衡化

    直方图均衡化的目的是将原图片每个像素值的像素点个数进行重新分配到[0,255]的256个像素值上,使得每个像素值对应的像素点个数近似相等,即重新分配后,0-255的每个像素值对应的像素点个数近似为(rows*cols/256),(直方图均衡化对应的数学原理参考:https://blog.csdn.net/superjunenaruto/article/details/52431941)。opencv里面equalizeHist()函数实现了相应的功能,只能处理单通道数据,参数列表如下:

    cv2.equalizeHist(src,dst)

    src: 图像对象矩阵,必须为单通道的uint8类型的矩阵数据

    dst:输出图像矩阵(和src的shape一样)

    实现代码和示例如下:

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    import math

    img= cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg",0)

    img_equalize=cv.equalizeHist(img)

    cv.imshow("img",img)

    cv.imshow("img_equalize",img_equalize)

    cv.waitKey(0)

    cv.destroyAllWindows()

    opencv equalizeHist()

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    import math

    #统计灰度分布

    def calc_hist(img):

    rows,cols= img.shape[:2]

    hist=np.zeros(256,np.uint64) #注意此处的数据格式不要用np.uint8,会溢出但不报错for r inrange(rows):for c inrange(cols):

    hist[img[r,c]]+=1

    returnhist

    def equalize_hist(img):

    rows,cols= img.shape[:2]

    hist=calc_hist(img)

    #计算灰度累积分布

    hist_sum=np.zeros([256],np.uint32) #注意数据类型为np.uint32,防止溢出for i in range(256):if i==0:

    hist_sum[i]=hist[i]else:

    hist_sum[i]= hist[i]+hist_sum[i-1]

    #输出图像的灰度分布

    output_hist= np.zeros(256,np.uint8)

    cofficient= 256.0/(rows*cols)for i in range(256):

    q= cofficient*float(hist_sum[i])-1

    if q>=0:

    output_hist[i]=math.floor(q)else:

    output_hist[i]=0#输出图像的像素值

    output_img=np.zeros([rows,cols],np.uint8)for r inrange(rows):for c inrange(cols):

    output_img[r,c]=output_hist[img[r,c]]returnoutput_imgif __name__=="__main__":

    img= cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg",0)

    img_equalize=equalize_hist(img)

    cv.imshow("img",img)

    cv.imshow("img_equalize",img_equalize)

    cv.waitKey(0)

    cv.destroyAllWindows()

    使用numpy实现equalizeHist

    (通过numpy实现equalizeHist的算法思路参见直方图均衡化的数学原理,这里没写出。。。。。)

    1483773-20190613232548924-2107197332.png

    2.5 限制对比度自适应直方图均衡化

    相比全局直方图均衡化,自适应直方图均衡化将图像划分为不重叠的小块,在每一小块进行直方图均衡化,但若小块内有噪声,影响很大,需要通过限制对比度来进行抑制,即限制对比度自适应直方图均衡化。如果限制对比度的阈值设置会40,在局部直方图分布中某个像素值出现次数为45,那么多出的5次像素点会被去掉,平均成其他像素值,如图所示:

    1483773-20190615112519820-1424907531.png

    opencv通过createCLAHE()和apply()函数来实现,其对应参数如下:

    clahe=cv2.createCLAHE(clipLimit,tileGridSize)

    clipLimit:限制对比度的阈值,默认为40,直方图中像素值出现次数大于该阈值,多余的次数会被重新分配

    tileGridSize:图像会被划分的size, 如tileGridSize=(8,8),默认为(8,8)

    calhe.apply(img) #对img进行限制对比度自适应直方图均衡化

    代码示例和效果如下:(实际使用中可以先去噪声,再进行对比度增强)

    ContractedBlock.gif

    ExpandedBlockStart.gif

    #coding:utf-8import cv2ascv

    import matplotlib.pyplotasplt

    import numpyasnp

    import math

    img= cv.imread(r"C:\Users\Administrator\Desktop\dark.jpg",0)

    clahe= cv.createCLAHE(3,(8,8))

    dst=clahe.apply(img)

    cv.imshow("img",img)

    cv.imshow("dst",dst)

    cv.waitKey(0)

    cv.destroyAllWindows()

    createCLAHE()

    1483773-20190615111154090-72975261.png

    参考:

    官方文档:https://www.docs.opencv.org/4.1.0/

    展开全文
  • 安全气囊是汽车乘员保护约束系统的一个重要组成模块...结合织布力学性能建立了基于粒子法的动态透气性仿真模型,通过试验压力和织布膨胀高度对比验证了材料的力学性能和透气性,为气囊的数值开发及对标工作奠定了基础。
  • Improving histogram-based image contrast enhancement using gray-level information histogram with application to X-ray images基于灰度信息直方图的X射线图像对比度增强改进Keywords:Image enhancement,Gray-...

    Improving histogram-based image contrast enhancement using gray-level information histogram with application to X-ray images

    基于灰度信息直方图的X射线图像对比度增强改进

    Keywords:Image enhancementGray-level information histogramHistogram equalizationX-ray image

    关键词:图像增强,灰度信息直方图,直方图均衡化,X射线图像

    A B S T R A C T

    Many applications of histogram-based techniques for the purposes of image enhancement are well known. However, these techniques often fail to produce satisfactory results for a broad variety of low-contrast images (e.g., X-ray images). In this paper, we propose a new form of histogram for image contrast enhancement. The input image is first divided into several equal-sized regions according to the intensities of gradients, their corresponding statistical values of gray levels are then modified respectively, and finally the processed histogram for the whole image is obtained by the summation of all the weighted values of regions. The fundamental characteristic of this new form of histogram is that the amplitudes of its components can objectively reflect the contribution of the gray levels to the representation of image information. Accordingly, this new histogram is called gray-level information histogram. The performance of many histogram-based enhancement techniques might be improved dramatically using the proposed histogram. Testing on the X-ray images validates the effectiveness of the new histogram.

    用于图像增强目的的基于直方图的技术的许多应用是众所周知的。然而,这些技术对于各种低对比度图像(例如,X射线图像)通常不能产生令人满意的结果。在本文中,我们提出了一种新的图像对比度增强直方图。首先根据梯度强度将输入图像分成几个相同大小的区域,然后分别修改相应的灰度统计值,最后通过所有加权值的总和得到整幅图像的处理直方图的地区。这种新的直方图形式的基本特征是其分量的幅度可以客观地反映灰度级对图像信息表示的贡献。因此,这个新的直方图被称为灰度信息直方图。使用所提出的直方图可以显着改善许多基于直方图的增强技术的性能。在X射线图像上进行测试可验证新直方图的有效性。

    1  Introduction

    X-ray images play a very important role in helping physicians make their diagnostic decision for treatment. However, the X-ray image quality is not always good because X-ray quantity radiated to the patient is limited considering patient safety. Image enhancement is a desired solution to that problem. Image enhancement techniques can be used to improve the visual appearance of an image, or to convert an image to a form better suited to the subsequent processing, such as segmentation, feature extraction,detection, and recognition. Thus, a considerable amount of research has focused on this subject and numerous enhancement techniques have been developed [1-6]. One of the most popular methods for image contrast enhancement is Global Histogram equalization ( GHE), which


    attempts to alter the gray-level histogram of an image to closely match a uniform distribution. Although the GHE method is simple and fast, its performance is not good enough in many cases due to its intrinsic limitations, such as the mean-shift problem ( i.e.,the mean brightness of the output image is significantly different from the input image) and relatively low enhancement power.

    1  简介

    X射线图像在帮助医生对治疗作出诊断决定方面起着非常重要的作用。但是,考虑到病人的安全性,辐射到病人的X射线量是有限的,故X射线图像质量并不总是好。图像增强是解决这个问题的理想方案。图像增强技术可用于改善图像的视觉外观,或将图像转换为更适合后续处理的形式,如分割,特征提取,检测和识别。因此,相当多的研究集中在这个问题上,并且已经开发了许多增强技术[1-6]。图像对比度增强最常用的方法之一是全局直方图均衡(GHE),它试图改变图像的灰度直方图使得与均匀分布紧密匹配。虽然GHE方法简单而快速,但由于其固有的局限性,如均值漂移问题(即输出图像的平均亮度与输入图像明显不同),其性能并不理想,增强功率相对较低。

      To overcome the aforementioned drawbacks, many variants of histogram equalization have been proposed [7-24]. In order to preserve the resulting image's brightness, Kim proposed Bright-ness Preserving Bi-Histogram Equalization (BPBHE) [8]. This method first separates the input image's histogram into two subhistograms based on the mean of the input image's brightness and then the two sub-histograms are equalized independently.Later, Chen and Ramli proposed an optimal extension of BPBHE,called Minimum Mean Brightness Error Bi-Histogram Equalization (MMBEBHE) [9]. This method separates the histogram using the threshold that would yield minimum brightness difference between the input image and the output image. Other solutions can be found in [10-13].

    为了克服上述缺点,已经提出了许多直方图均衡的变体[7-24]。 为了保持最终图像的亮度,Kim提出了亮度保留双直方图均衡(BPBHE[8]。该方法首先根据输入图像亮度的均值将输入图像的直方图分解为两个子图,然后对这两个子直方图进行独立均衡。之后,ChenRamli提出了BPBHE的最优扩展,称为最小平均亮度误差双直方图均衡化(MMBEBHE[9]。该方法利用阈值分离直方图,使输入图像与输出图像之间的亮度差最小。其他解决方案可以在[10-13]中找到。

    In some cases (e.g., medical image analysis), local details may bemore important than global contrast [4,5]. For these applications,the global HE method is inadequate because it cannot adapt to local brightness features of the input image due to the global nature of this technique. To overcome this drawback, some local histogram-equalization methods have been developed [4-6,14-19]. A natural extension of GHE technique is the termed adaptive histogram equalization (AHE), which maps the gray level values of pixels using the relationships obtained from the local histograms[6,14]. Since the AHE method must be conducted throughout all pixels in the entire image, the computational complexity of this technique is very high. This time-consuming procedure was improved by Pizer et al. with their contrast limited adaptive histogram equalization (CLAHE) [15]. It first divides the input image into blocks, and then calculates the mapping functions of those blocks. For each pixel, the mapping function is obtained by interpolating four mapping functions of the nearest blocks. In CLAHE,the amount of contrast is restricted by an adjustable parameter known as the "clipping level". In addition, Jin et al. Proposed Multi-scale adaptive histogram equalization (MAHE) [16]. The input image is first decomposed into sub-bands using wavelet transform. Then the high-frequency sub-band is treated with the  adaptive histogram equalization, and finally the processed subband is merged with the low-frequency sub-band to generate the resulting image.

    在某些情况下(例如医学图像分析),局部细节可能比全局对比更重要[4,5]。对于这些应用,直方图均衡方法(HE)是不够的,因为由于这种技术的全局性质,它不能适应输入图像的局部亮度特征。为了克服这个缺点,已经开发了一些局部直方图均衡方法[4-6,14-19]GHE技术的自然延伸称为自适应直方图均衡(AHE),它使用从局部直方图获得的关系映射像素的灰度值[6,14]。由于AHE方法必须在整个图像的所有像素中进行,因此该技术的计算复杂度非常高。这个耗时的过程由Pizer等人改进。与他们的对比限制自适应直方图均衡(CLAHE[15]。它首先将输入图像分成块,然后计算这些块的映射函数。对于每个像素,通过内插最近块的四个映射函数来获得映射函数。在CLAHE中,对比度受限于一个称为“限幅级”的可调参数。另外,Jin等人提出了多尺度自适应直方图均衡(MAHE[16]。首先使用小波变换将输入图像分解成子带。然后用自适应直方图均衡处理高频子带,最后将处理后的子带与低频子带合并以生成结果图像。

      The above mentioned histogram-based techniques have been widely used in a number of computer vision applications. However, they still have limitations and cannot handle certain classes of images well, such as X-ray images characterized by the fact that the amplitudes of their histogram components are very high at several gray-level bins corresponding to the large area background in these images. If using GHE technique, the resulting image will have washed-out appearance. This undesirable appearance also exists in the results of BPBHE and MMBEBHE, as they still implement the HE operation in each grayscale segment. Local adaptive techniques (e.g., CLAHE) may suffer from noise overenhancement or/and ringing artifacts. The main cause for different types of unsatisfactory results is that the frequency of gray levels in standard histogram is usually not consistent with their contributions to the representation of the image details. Note that most of histogram-based techniques rely on the basic principle that the dynamic range of gray levels is modified according to the probability distribution of gray levels in the entire image or local blocks. Fig. 1 is a simple example illustrating the aforementioned shortcoming of the standard histogram. Its histogram, as shown in Fig. 1(b), contains only two components. It is obvious that the frequency of the white gray level is quite larger than that of the black one. However, from the viewpoint of depicting the image details, the contribution of the black gray level is equivalent to that of the white one because there is no information (i.e., a sandwich) left in the image if we substitute the white gray level for the pixels of the black gray level.

    上述基于直方图的技术已被广泛用于许多计算机视觉应用。然而,它们仍然有局限性,并且不能很好地处理某些类型的图像,例如X射线图像,其特征在于其直方图分量的振幅在与这些图像中的大面积背景相对应的几个灰度分箱处非常高。如果使用GHE技术,所得到的图像将具有褪色外观。 BPBHEMMBEBHE的结果中也存在这种不希望的外观,因为它们仍然在每个灰度段中执行HE操作。局部自适应技术(例如,CLAHE)可能遭受噪声过强或/和振铃伪影。不同类型的不满意结果的主要原因是标准直方图中灰度级的频率通常与它们对图像细节表示的贡献不一致。请注意,大多数基于直方图的技术都依赖于基本原理,即根据整个图像或局部块中灰度级的概率分布修改灰度级的动态范围。图1是说明标准直方图的上述缺点的简单例子。它的直方图,如图1b)所示,只包含两个分量。很显然,白色灰度级的频率比黑色的频率高很多。然而,从描绘图像细节的角度来看,黑色灰度级的贡献等同于白色灰度级的贡献,因为如果我们用白色灰度级代替图像中的信息(即,三明治)黑色灰度级的像素。

    To overcome the drawback of the standard histogram, this paper proposes a new version of histogram named gray-level information histogram, in which the amplitudes of its components are cumulative summations of weighted statistical values of the gray levels in different regions. The motivation for this weighting process is to give different importance to each pixel in terms of its contribution to the representation of the image details. Exper imental results show that applying our new histogram to the histogram-based techniques can significantly enhance detailed regions and produce little noise overenhancement and few ringing artifacts.

    The rest of this paper is organized as follows: in Section 2, the algorithm and principle of the gray-level information histogram is described. Section 3 shows the comparison of the results using two different forms of histogram: Standard Histogram and Gray-level Information Histogram. Finally, some concluding remarks are made in Section 4.

    为了克服标准直方图的缺点,本文提出了一种新的直方图,即灰度信息直方图,其中各个分量的幅值是不同区域灰度加权统计值的累加和。这个加权过程的动机是对每个像素在其对图像细节表示的贡献方面赋予不同的重要性。实验结果表明,将我们的新直方图应用于基于直方图的技术可以显着增强细节区域,并且产生很少的噪声增强和少量振铃伪影。

    本文的其余部分组织如下:在第2节中,描述了灰度信息直方图的算法和原理。第3节显示使用两种不同形式的直方图的结果比较:标准直方图和灰度信息直方图。最后,在第4节中做出一些总结性发言。

    2. Gray-level information histogram

    It is known that the gradients in the image background are very low and the detailed regions are usually associated with high gradients. In other words, the regions with high gradients contain more

    detailed information than those with low gradients. Fig. 2 shows the comparison of the results of treating the X-ray image of two hands by GHE technique with five local histograms of equal-sized regions (i.e., Fig. 2(d), (g), (j), (m), and (p)), which are labeled with white pixels according to their intensities of gradients. Fig. 2(e) is the GHE result using the local histogram of regionl with the lowest gradients. Fig. 2(q) is the GHE result using the histogram of regions with the highest gradients. It is observed that the equalized image of Fig. 2(q) is better than the resulting image of Fig. 2(e), which indicates that the histogram distribution shape of the high-gradient regions is superior to that of the low-gradient regions for the image contrast enhancement. In other words, the histogram components of the high-gradient regions provide more accurate estimation of their contribution to the representation of detailed information than those of the low-gradient regions. This hypothesis has been proved to be correct in many cases (e.g., another test example can be found in Fig. 3). Furthermore, from the segmentation results, it can be seen that the original image, Fig. 2(a), contains a large area of background (i.e., regionl, region2, and most area of region3). The high amplitude of the histogram components corresponding to the large area background greatly limits the contrast-stretching ratio of small-scale image details. Therefore, the GHE result using the global standard histogram (Fig. 2(c)) exhibits washed-out appearante, as shown in Fig. 2(b). To overcome this problem, statistic values of background must be reduced. This can be achieved by suppressing the number of pixels in the regions with low gradients. Based on the above mentioned hypothesis, we developed a new form of histogram which is called gray-level information histogram. In contrast to the standard histogram, it has a different statistical operation. The statistical values of gray levels in different regions are modified according to their gradient magnitudes,and the final processed histogram for the whole image is obtained by summation of all the weighted values of regions.

    2.灰度信息直方图

    已知图像背景中的梯度非常低,细节区域通常与高梯度相关联。换句话说,比那些低梯度的区域,高梯度区域包含更多详细信息。图2显示了通过GHE技术处理两只手的X射线图像的结果与等大小区域的五个局部直方图(即,图2d),(g),(j),( m)和(p)),根据它们的梯度强度用白色像素标记。图2e)是使用区域1的局部直方图的梯度最低的GHE结果。图2q)是使用具有最高梯度的区域的直方图的GHE结果。据观察,图2q)的均衡图像优于图2e)的结果图像,这表明高梯度区域的直方图分布形状优于低梯度区域用于图像对比度增强的区域。换句话说,高梯度区域的直方图分量比低梯度区域的直方图分量更精确地估计它们对详细信息表示的贡献。在许多情况下,这个假设已被证明是正确的(例如,另一个测试例子可以在图3中找到)。此外,根据分割结果,可以看出,原始图像(图2a))包含大面积的背景(即区域1,区域2和区域3的大部分区域)。对应于大面积背景的直方图分量的高振幅大大地限制了小尺寸图像细节的对比度 - 拉伸比。因此,如图2b)所示,使用全局标准直方图(图2c))的GHE结果表现出明显的褪色。为了克服这个问题,必须减少背景的统计值。这可以通过抑制具有低梯度的区域中的像素数量来实现。基于上述假设,我们开发了一种新的直方图形式,称为灰度信息直方图。与标准直方图相比,它具有不同的统计操作。不同区域的灰度值的统计值根据其梯度幅度进行修改,并且通过区域的所有加权值的总和获得整个图像的最终处理直方图。

    2.1. Gray-level information histogram

    The gray-level information histogram is constructed as follows:

    (1) Smooth the image with a Gaussian filter mask to mitigate noise effects. This can be performed at different scales, by varying the size of the filter mask which corresponds to the variance of the Gaussian function.

    2.1 灰度信息直方图

    灰度信息直方图构造如下:

    1)用高斯滤波器平滑图像以减轻噪声影响。这可以通过改变与高斯函数的方差对应的滤波器掩模的大小在不同的尺度上执行。

    Fig. 2. Comparison of the GHE results using different local histograms of regions. (a)low-contract original imagr ,and (c)its corresponding standard histogram. Five regions marked with white pixels: (d) regionl 1, (g) regionl 2, (j) regionl 3,  (m) regionl 4, (p) regionl 5,their corresponding local histogram: (h) GHE (m) region4, (p) regions, their corresponding local histograms:(f), (i), (1), (o) (r), and their GHE results: (e), (h), (k), (n) and (q)

    2.使用区域的不同局部直方图比较GHE结果。 (a)低收缩的原始图像,和(c)相应的标准直方图。(d)区域11,(g)区域12,(j)区域13,(m)区域14,(p)区域15,其相应的局部直方图:(hGHEm)区域4 f),(i),(1),(o)(r)和它们的GHE结果:(e),(h),(k),(n) 和(q

    Fig.3. Test example. (a) Original Lena image, (h) result of GHE using local histogram of regionl and (c) result of GHE using local histogram of regions

    3.测试实例:(A)原始的Lena图像,(H)用区域的局部直方图表示的结果,(C)用区域的局部直方图表示的结果。

    (2) Calculate the gradient magnitude at each pixel using equations similar to the Sobel edge detector. A 3 x 3 pixel gradient operator is described by the pixel numbering convention of Fig. 4.The square root gradient is defined as:

    2)使用与Sobel边缘检测器相似的方程计算每个像素处的梯度幅度。一个3×3像素梯度算子由图4的像素编号惯例描述。平方根梯度定义为:

     

    Fig.4. Numbering convention for gradient calculation

    4.梯度计算的编号惯例

    where and  are the row gradient and the column gradient at respectively:

    其中和分别是处的行梯度和列梯度:

     

    (3) Divide the original image into a proper number of equal-sized regions (i.e., default five regions), according to ascending order of their intensities of gradients. Fig. 2 shows an example of this segmentation operation. Each pixel location in the original image has a specific statistical weighting coefficient depending on its gradient magnitude. The coefficients are determined as

    follows:

    3)根据梯度强度的升序,将原始图像分成适当数量的相同大小的区域(即默认的五个区域)。 图2显示了这种分割操作的一个例子。 原始图像中的每个像素位置具有特定的统计加权系数,取决于其梯度幅度。系数确定为如下:

     

    where denotes the limits of the gradient intervals,  is the statistical weighting coefficients (usuallydue to the different contribution to image contrast enhancement, the next half of Section 2 will discuss how to determine the optimal weighting coefficients).

    其中,表示梯度区间的界限,是统计加权系数(通常是对图像对比度增强的不同贡献,第二部分的下半部分将讨论如何确定最佳加权系数)。

    (4) Compute the cumulative summation of the weighted statistical values of each gray level in different regions:

    4)计算不同地区各灰度级加权统计值的累加和:

     

    where is the number of pixels at the gray level r in a certain region. N(r) is the summation of all weighted statistical values of the gray level r in the five regions. It should be pointed out that the standard histogram is a special case of our new histogram,that is, when  the components of the two types of histograms have the same values.

    其中是某个区域中灰度级r处的像素数量。Nr)是五个区域中灰度级r的所有加权统计值的总和。 应该指出的是,标准直方图是我们新的直方图的特例,也就是说,两种直方图的分量具有相同的值时

    2.2. Determination of the optimal parameters

    In the previous paragraph, we describe the basic procedure of this new histogram. In order to obtain desired histogram shape for image contrast enhancement, several problems should be solved.

    Here, we list these problems as follows:

    l Choose a proper number of equal-sized regions.

    l .Choose a robust method to evaluate the distribution of detailed information.

    l Choose the optimal weighting coefficients.

    2.2。 确定最佳参数

    在前一段中,我们描述了这个新直方图的基本过程。 为了获得期望的图像对比度增强的直方图形状,应该解决几个问题。

    在这里,我们列出这些问题如下:

    l 选择适当数量的相同大小的区域。

    l 选择一个稳健的方法来评估详细信息的分布。

    l 选择最佳的加权系数。

    As mentioned previously, we use a default value(i.e.5) as the number of regions. The choice of this number is also based on the fact that the percentage area of the detailed regions in the entire image is usually in the range of 20-80% (e.g., the detailed region covers nearly 20%area in the simple line drawing (Fig. 5(a)), but,over 70% in the complex image of a town, as shown in Fig. 5(d)). We choose the lowest limit ( i.e., 20%) as the size of the region, and therefore the corresponding total number of regions is five. Moreover,from multiple trials, we found that the resulting histogram shape is not very sensitive to the number of the regions if the number is over 4, and a large number of regions would cost more computationally.

    如前所述,我们使用默认值(即5)作为区域的数量。 这个数字的选择也是基于以下事实:整个图像中的详细区域的百分比面积通常在20-80%的范围内(例如,详细区域覆盖简单线条图中的近20%区域 图5a)),但在城镇的复杂图像中超过70%,如图5d)所示)。 我们选择最低限度(即20%)作为区域的大小,因此相应的区域总数为5。 此外,从多次试验中,我们发现,如果数量超过4,所得的直方图形状对区域数量不是很敏感,并且大量区域的计算成本会更高。

    The next problem is to develop a robust method to evaluate the distribution of details in a given image. This is important because it can provide useful information for estimating the regions' contribution for the image enhancement. Here, we propose a simple solution. We use the Canny edge detection technique to evaluatethe distribution of details. The Canny edge detection algorithm is a robust and accurate edge detection methods. The motivation for this solution is that if a region contains many details, it generally has large number of edge points. In other words, the amount of details is equivalent to the number of edge points. Therefore, the distribution of details in different regions is executed as follows: (1) detect the edge in the input image using the Canny edge detection operator; (2) count the number of edge points in different regions. Test examples are given in Fig. 5. The results of edge detection are shown in Fig. 5(e)-(h). The number of edge points in different regions is listed in Table 1.

    下一个问题是发展一种稳健的方法来评估细节在给定图像中的分布。这一点很重要,因为它可以为估计区域对图像增强的贡献提供有用的信息。在这里,我们提出了一个简单的解决方案。我们使用Canny边缘检测技术来评估细节的分布Canny边缘检测算法是一种稳健、准确的边缘检测方法。这个解决方案的依据是,如果一个区域包含许多细节,它通常有大量的边缘点。换句话说,换句话说,细节的数量相当于边缘点的数量。因此,在不同区域中的细节分布被执行如下:(1)利用Canny边缘检测算子来检测输入图像中的边缘;(2)计算不同区域的边缘点数。试验实例如图5所示。边缘检测结果如图5(E)-(H)所示。表1列出了不同区域的边缘点数。   

    The final problem is how to choose appropriate weighing coefficients in order to perform the weighting process to yield a desired histogram shape for image contrast enhancement. One can specify these coefficients in an empirical way to yield satisfactory results,but this precludes the new histogram from being applied in many cases in which full automatic processing are needed. Furthermore,since there are five parameters, direct trial-and-error requires a lot of work. Here, we developed a simple method to overcome this problem. Our idea is to normalize the number of edge points in different regions to generate their corresponding weighting coeffidents. The equation can be represented as follows:

    最后一个问题是如何选择合适的加权系数,以进行加权处理,从而得到所需的直方图形状以增强图像对比度。我们可以指定这些用经验方法得到满意结果的系数,但这就排除了新的直方图在许多需要全自动处理的情况下应用的可能性。此外,由于这里有五个参数,直接试验和错误测试需要做大量的工作.在这里,我们开发了一个简单的方法来克服这个问题。我们的想法是规范不同区域的边缘点的数目以产生相应的加权系数。方程可表示如下:

     

    where Ni is the number of edge points in region i,N5 denotes thenumber of edge points in regions 5 which contains the biggest number of edge points.

    其中Ni是区域I中的边点数,N5表示包含最大边点数的区域5中的边点数。

    Using Eq. (6), normalized weighting coefficients for Fig. 5(a)-(d ),are calculated and listed in Table 2. Here, we highlight some examples to show the effectiveness of this normalized operation. For the simple images, e.g., line drawing in Fig. 5(a), regions with the highest gradients covers all the details, as shown in Fig. 5(i), so that the weighting coefficients of other regions are zero which indicates these regions have no details. For more complex images,the regions does not capture all details (see zoomed images of Figs. 6 and 7), e.g., in Fig. 7, the minor textures on the cap are not included in the regions. Some details are located in region 4 and region 3, and the corresponding coefficients show their contribution to the representation of image details. It is worth noting that these results agree well with those of visual perception.

    使用Eq6)计算了图5a-d)的归一化加权系数,并列在表2中。这里,我们重点介绍一些示例,以说明这种规范化操作的有效性。对于简单的图像,例如图5a)中的线条图,具有最高梯度的区域覆盖了所有细节,如图5i)所示,使得其他区域的加权系数为零,表示这些 地区没有细节。 对于更复杂的图像,区域不捕获所有细节(参见图67的缩放图像),例如在图7中,帽子上的次要纹理不包括在区域中。 一些细节位于区域4和区域3中,并且相应的系数显示它们对图像细节表示的贡献。值得注意的是,这些结果与视觉感知的结果非常吻合。

    3. Experimental results and comparisons

    3.实验结果与比较

    Fig. 8. Comparison of the results for the line drawing using different enhancement techniques. (a) Low-contrast original image, and (b) its standard histogram, (c) Gray-level information histogram. Note that the amplitude of the rightmost component has been reduced. (d) Result of GHE, (e) result of CLAHE, and (f) result of optimized GHE; (g) histogram for (d), (h) Histogram for (e), and (i) histogram for (f)

    8.使用不同增强技术绘制线条的结果比较。(a)低对比度原始图像,(b)是其标准直方图,(c)灰度信息直方图。 请注意最右边的分量的振幅已经降低。(dGHE的结果,(eCLAHE的结果,以及(f)优化的GHE的结果; g)是(d)的直方图,(h)是(e)的直方图和(i)是(f)的直方图,

    Fig. 9. Comparison of the results for X-ray image of two hands using different enhancement techniques. (a) Original image, (h) result of GHE, (c) result of CLAHE, (d) result of optimized GHE, and (e) result of optimized CLAHE

    9.用不同的增强技术对两只手的X射线图像的结果进行比较。(A)原始图像,(H)HE的结果,(C)CLAHE的结果,(D)优化的HE(E)的结果。Clahe优化结果

    l To verify the effectiveness of our new form of histogram,we apply this new histogram to two conventional histogram-based image enhancement techniques: GHE method (a well-known global technique) and CLAHE method (a popular local adaptive technique). Incorporation of gray-level information histogram into the existing contrast enhancement techniques is straightforward. One only needs to insert the new histogram into these algorithms.In order to distinguish the enhancement methods using gray-level information histogram from the conventional methods using standard histogram, we define the method using the new histogram as"optimized method", e.g., optimized GHE method. Fig. 8 shows the optimized GHE result of the line drawing with comparison to the GHE result and CLAHE result. Fig. 8(a) illustrates a line drawing, and Fig. 8(b) its standard histogram which contams six nonzero components. Due to the highest amplitude of the rightmost component, the resulting histogram of GHE is shifted toward the left side of the grayscale and most of the grayscale is empty, which causes significant contrast loss of detailed regions,as shown in Fig. 8(d). Note that the contrast of GHE result is even worse than that the original image. Fig. 8(e) is the CLAHE result. It can be seen that although CLAHE method can produce strong contrast enhancement, the character or content of the image (e.g., pixel value order or the number of nonzero components) is changed due to the local mapping nature of this technique, which is undesirable for many applications. Fig. 5(i) shows that regions covers all the details in the line drawing, and the corresponding weighting coefficients are w1=w2=w3=w4=0,w5=1, which means that the components of the resulting histogram in Fig. 8(c) is only the frequency of gray levels in regions. Note that the amplitude of the rightmost component has been reduced. Fig. 8(f) shows the enhanced image using optimized GHE method, and Fig. 8(i) its histogram in which the six components are uniformly spread over the entire grayscale. It is obvious that the contrast of the optimized GHE result is better than those of the CLAHE result and the original image

    .

    为了验证新的直方图形式的有效性,我们将新的直方图应用于两种传统的基于直方图的图像增强技术:GHE(一种著名的全局技术)CLAHE方法(一种流行的局部自适应技术)。将灰度信息直方图纳入现有的对比度增强技术是很简单的.只需将新的直方图插入到这些算法中即可。为了区分采用灰度信息直方图的增强方法与传统的标准直方图增强方法,为了区分采用灰度信息直方图的增强方法与常规的标准直方图增强方法,本文将新直方图的增强方法定义为“优化法”。例如,优化的GHE方法。我们定义了以下方法:将新的直方图作为“优化方法”,如优化和方法。图8给出了绘制线图的优化结果,并与HE结果和CLAHE结果进行了比较。图8(A)是一条直线图,图8(B)是它的标准直方图,它包含六个非零分量。由于最右边分量的振幅最高,因此产生的GHE直方图向灰度左侧偏移,大部分灰度为空,导致详细区域的对比度明显下降,如图8d)所示。请注意,GHE结果的对比度甚至比原始图像还要差。图8(E)CLAHE结果。可以看出,虽然CLAHE方法可以产生很强的对比度增强,但图像的特征或内容(例如,像素值次序或非零分量的数量),由于这种技术的局部映射性质而改变,这在许多应用中是不可取的。图5i)显示了区域覆盖了线图中的所有细节,并且相应的加权系数是w1 = w2 = w3 = w4 = 0w5 = 1,这意味着图5中的结果直方图的分量 8c)只是地区灰度级别的频率。请注意,最右边的组件的振幅已经降低。 图8f)显示了使用优化的GHE方法的增强图像,以及图8i)其直方图,其中六个分量均匀分布在整个灰度上。结果表明,优化后的和图像的对比度明显优于CLAHE结果和原始图像的对比度。

    Fig.9 shows the comparison of the results of treating the X-ray image of two hands with different enhancement techniques including GHE, Optimized GHE, CLAHE and Optimized CLAHE. Fig. 9(a) shows a low-contrast X-ray image of two hands. Its GHE result,Fig.9(b), also looks faded and background noise has been amplifled. As mentioned in Section 2, the cause for this unsatisfactory appearance is that the background occupies nearly 60 percent of area in the original image and gray levels in this area are concentrated into a narrower range of grayscale (i.e., from 75 to 100 grayscale interval, as shown in Fig. 2(c)), which causes significant contrast loss of small detailed regions. Moreover, it can be seen that noise in the background is almost invisible before enhancement. However, it becomes apparent after enhancement. Fig. 9(d)shows the enhanced X-ray image after applying our new histogram into the GHE technique. It can be seen that the result of the optimized GHE technique is superior to that of the conventional GHE algorithm. The enhanced image, Fig. 9(d), not only exposes more image details, but also has little noise overenhancement.Fig. 9(c) shows CLAHE result, which is better than the GHE result (Fig. 9(b), but still has an undesirable appearance (i.e., noise overenhancement). Fig. 9(e) is the optimized CLAHE result. It is obvious that the optimized CLAHE algorithm outperforms the CLAHE and GHE techniques. Note that there is not much difference between the optimized CLAHE result and GHE result, and both images are satisfactory.

    9显示了不同增强技术治疗双手X线图像的结果比较,包括HE、优化的HECLAHE和优化的CLAHE。图9a)显示了双手的低对比度X射线图像。其结果,从图9(B)可以看出,图像褪色,背景噪声已放大。正如第2节所述,造成这种不令人满意的外观的原因是背景在原始图像中占据了接近60%的面积,并且该区域中的灰度级被集中到较窄的灰度范围(即,从75100灰度间隔,如图2c)所示),这会导致小的细节区域的明显的对比度损失。此外,可以看出,背景中的噪声在增强之前几乎看不见。但是,增强后会变得明显。图9d)显示了将新的直方图应用到GHE技术后的增强X射线图像。可以看出,优化的GHE技术的结果优于传统的GHE算法。增强图像(图9d))不仅可以显示更多的图像细节,而且噪声也不会过度增强。图9c)显示了CLAHE结果,它比GHE结果好(图9b)),但仍然具有不希望的外观(即,噪声过强),图9e)是优化的CLAHE结果。 CLAHE优化算法优于CLAHEGHE技术,注意CLAHE优化结果与GHE结果差异不大,且两幅图像均满意。

    From empirical results, we found that using our new histogram,even the simple method (e.g., GHE) can be conveniently applied to a broad variety of low-contrast images (e.g., simple line drawing,images with strong noise, etc.) and yields satisfactory results. More examples are given in Figs. 10 and 11.

    根据实验结果,我们发现使用我们的新直方图,即使是简单的方法(例如,GHE)也可以方便地应用于各种低对比度图像(例如,简单线条画,具有强噪声的图像等)和 产生满意的结果。更多的例子在图1011中给出。

    4. Conclusion

    It has been found that the regions with more details make great contribution to the image enhancement. However, the components of the standard histogram only show the frequency of gray levels,while ignoring the distribution of the details. This makes it difficult for many histogram-based techniques to generate satisfactory results. Therefore, this paper introduces a new form of histogram called gray-level information histogram. Compared with the conventional histogram, the amplitudes of its components can provide accurate assessment of the contribution of different gray levels to the image details depicting. Testing on various kinds of X-ray images shows that after using our new histogram, the optimized histogram-based techniques usually outperform the original methods with the same processing parameters. In addition, it should be pointed out that this proposed histogram is a new representation of the image. Like the standard histogram, it can be applied to other image processing applications, e.g., content-based image retrieval,which is currently under study in our research.

    4 结论

    已经发现具有更多细节的区域对图像增强作出了巨大贡献。但是,标准直方图的分量仅显示灰度级的频率,而忽略细节的分布。这使许多基于直方图的技术难以产生令人满意的结果。因此,本文介绍了一种称为灰度信息直方图的新形式直方图。与传统直方图相比,其分量的幅度可以准确评估不同灰度级对图像细节描绘的贡献。对各种X射线图像进行测试表明,在使用我们的新直方图之后,基于直方图的优化技术通常优于相同处理参数的原始方法。另外,应该指出的是,这个提出的直方图是图像的新表示。像标准直方图一样,它可以应用于其他图像处理应用,例如基于内容的图像检索,目前我们的研究正在进行研究。

    Acknowledgements

    This work was supported in part by the National Natural Science Foundation of China under Grant Nos. 60802051, 60875053,in part by Tianjin Natural Science Foundation under Grant No.09JCYBJC02100, in part by Youth Foundation of Tianjin University,and in part by China '863' High-Tech Program under Grant No.2007AA04Z219. M. Zeng would like to thank the support of CityUniversity of Hong Kong (Project No. 7002511).

    致谢

    国家自然科学基金资助项目(60802051,60875053)部分资助,天津自然科学基金资助项目09JCYBJC02100部分资助,天津大学青年基金资助项目部分资助, 863'高科技计划项目编号:2007AA04Z219M. Zeng感谢香港城市大学的支持(项目编号:7002511)。

     

    原文下载链接:https://download.csdn.net/download/thecentry/10528544

     

     

     

     

     

    展开全文
  • 采用自制细化装置和测量单元对羊毛毛条进行拉伸细化,结合正交试验得出优化的预浸、...试验结果证明:细化拉伸处理后,羊毛细度、长度、光泽明显改善,但纤维伸长率变小,长度离散变大,这对纺织加工提出了新的要求。
  • 牛奶蛋白纤维处理前后的试验数据对比也说明了低浓度酸碱溶液不会对牛奶蛋白纤维造成显著的损伤。研究表明,牛奶蛋白纤维及其产品应该在pH值为4~9的低浓度酸碱溶液中进行染整、后处理及维护保养。
  • 研究了GLARE(glass fiber reinforced aluminium laminates)层板的基本成形性,通过拉伸试验测得了4种层板的性能参数,将这些性能参数进行对比分析,拟合出GLARE纤维不同方向的机械性能函数,据此函数获得了纤维...
  • 对不同样式的45钢和6082铝合金试件进行了拉伸、压缩、剪切、扭转等材料试验,对工程中使用的11个韧性断裂准则进行对比研究,并利用专业塑性成形分析软件对试验过程进行二维和三维情形的数值模拟。指出目前使用的韧性...
  • 济南金力试验仪器有限公司(济南金力试验机厂)生产的MaxTest型微机控制电液伺服系统为通用伺服油源系统,适用于油缸密封形式为间隙密封的万能机主机(包括油缸上置的A型机);油缸为双向缸的卧式拉力机及单拉;带中压的...

     一、简介

    济南金力试验仪器有限公司(济南金力试验机厂)生产的MaxTest型微机控制电液伺服系统为通用伺服油源系统,适用于油缸密封形式为间隙密封的万能机主机(括油缸上置的A型机);油缸为双向缸的卧式拉力机及单拉;带中压的Y500;各试验机厂家生产的压力试验机(含压试验机附带转角);定制升级版可满足动态试验机的试验需求,该系统具有低噪音,大流量,供油平稳,闭环系能好,功耗低,并且配散热系统,满足客户长时间测试的需要,整机试验操作和数据处理符合《室温材料 金属拉伸试验方法》的要求。

    注:济南金力试验仪器有限公司(济南金力试验机厂)为GB/金属室温拉伸试验方法的协助推广单位)。

    二、必要性

    在GB/T 228.1-2010《金属材料 拉伸试验 第1部分:室温试验方法》中引言部分明确指出:

    “本版标准提供了两种试验速率的控制方法。第一种方法A为应变速率(包括横梁位移速率),第二种方法B为应力速率。方法A旨在减小测定应变速率敏感参数时试验速率的变化和减小试验结果的测量不确定度。本部分将来将推荐使用应变速率的控制模式进行拉伸试验。”

    其中明确指出:该方法将来将推荐使用应变速率的控制模式进行拉伸试验。

    在我们的实际测试工作中,都会遇到不同试验者、不同实验室、不同试验机对同种材料的测试而数据会有所所差异。这可能是:由于不同操作者选择的拉伸速率不同、使用试验机的软件数据处理系统不同、使用的试验机拉力系统柔度不同等多方面因素所造成。这是我们所有测试工作者所不希望的。

    为保证我们测试数据的一致性,必须严格执行GB/T 228.1-2010标准。该标准不仅提出了方法A应变速率控制模式、方法B应力速率控制模式,而且提出了对方法A中根据平行长度估计的应变速率6d1082028afc555a89e98407c199cbac.gifLc对试验机的柔度修正方法,以及对计算机控制拉伸试验机使用的建议。这对我们获得准确一致的力学测试数据是极为重要的。

    在当前计算机普及的时代,保证严格执行GB/T 228.1-2010标准是可行的。但是对于当前正在服役的较老款式万能试验机(机械度盘显示、微机屏显式、数显式),由于历史因素,那些试验机只能由人工控制试验机的加载速率,尚不能满足GB/T 228.1-2010标准。但是,可以通过试验机技术改造的方式(通过更换油源,增加能进行伺服控制的伺服阀及压差阀,升级为电液伺服万能试验机),焕发老式试验机的青春,满足GB/标准要求,继续为社会服务。

    GB/T 228.1-2010标准规定:

    试验测定的性能结果数值应按照相关产品标准的要求进行修约.如未规定具体要求,应按照如下要求迸行修约

    &mdASh;— 强度性能值修约至1MPA

    —— 屈服点延伸率修约至,其他延伸率和断后伸长率修约至

    —— 断面收缩率修约至1%

    说明标准对测控系统的精度要求提高了,较老款式万能试验机的力值测量精度一般在最大量程/10000,通过升级测控系统,力值测量精度可以达到最大量程/100000,大大提高了试验结果的准确性。

    改造的目的是为了使试验机具备应变速率、应力速率控制的能力,从而准确、高效的取得材料的屈服强度(ReH, ReL, Rp )。

    三、主要性能技术指标

    1、系统最高压力:30Mpa;

    2、有效控制范围:0.12-30 Mpa;

    3、试验力示值精度: ±1%(视主机及传感器精度);

    4、位移测量分辨力:;

    5、变形测量:标准配置标距50mm,最大变形量10mm.

    6、变形测量精度: ±

    7、恒力、恒变形、恒位移控制范围:   ;

    8、恒力、恒变形、恒位移控制精度: 

                   设定值<10%FS时,设定值的±以内;

                   设定值≥10%FS时,设定值的±以内;

    9、变形速率控制精度:  速率<时为±设定值内;

                          速率≥时为±设定值内;

    10、活塞最大移动速度:100mm/min;(根据实际情况定);

    11、紧:液压夹紧(选配);

    12、外形尺寸:油源:1400×700×850mm;

    13、油源重量:200 kg。

    四、控制系统功能特点

    1、计算机控制系统,具有集成度高、性能稳定、调整方便等优点。可以对试验数据进行实时采集,对试验特性曲线实现实时动态显示,试验数据文件能以Access常用数据库或SQLserve大型数据库的方式保存,方便实现客户的资源共享及网络管理,以及用户的再分析。对于用户自定义的各种Word报表,该软件可轻松实现访问,解决了不同用户或同一用户在不同时期对试验报表有不同需要的难题。该软件可处理试验力、位移、时间的原始数据及由此派生的曲线。

    2、操作系统Windows7/XP平台下,全中文操作界面。系统集数据处理、数据分析于一体;

    3、保护功能:该机具有软件和机械两种限位保护方式,超过最大负荷自动停机的比例可动态设定;具有过流、过压、过载等多种保护功能。

    4、对于负荷通道可实现自动标示,直观方便。

    5、批量试验可实现曲线的分层次显示,曲线自动跟随。

    6、该软件可实现用户自定义的速度设定,速度的计算机调整。还可实现高精度的速度标定,随时调整速度档位和编码。

    7、具有试验力、位移、应力、应变等多种全数字闭环/开环控制功能,各控制模式可自由平滑切换;

    8、具备功能完整的试验过程“编程”功能,可编程步数达200 步,并可根据需要任意扩展,完成任意复杂、任意控制模式切换的试验过程编辑。同时提供数据分析功能,满足试验人员进行试验分析及进行特殊试验的数据处理;

    9、监测试验过程:对试验过程中的试验力、位移、曲线等多种参数可实现实时显示。

    10、软件权限分级管理功能:为了提高软件及数据的安全性,该软件可以通过设置不同的密码保护来实现分权限管理功能。

    11、结果再现功能:试验操作完成并存盘后,可根据用户需要在以后任意时间打开并对试验数据进行再分析。

    12、可根据用户需要选择负荷~时间、负荷~位移、位移~时间等曲线来进行试验及数据显示、存储、分析及打印。

    13、曲线逐点遍历功能:可通过鼠标在曲线上点击力与变形值,以求得每一点的各种参量。

    14、结果对比功能:可以同时观察多个试验曲线,并可通过多个曲线的叠加、局部放大来实现待分析样品特性的比对。

    15、力接口:力通道接口及试验软件可根据用户需要配备各种传感器,并能进行标定、修改参数及正常试验。

    16、数据采样频率:可根据用户试验要求选择高速采样频率。

    五、系统配置清单(常规)

    1、 驱动电机                   皖南电机

    2 、伺服控制用油源             琴台式

    1)、电液伺服阀               自制

    2)、高压泵                   意大利祖奇

    3)、专用伺服阀组             自制

    3、STC8800双通道程控放大器   分辨力1/100000

    4、高精度液压传感器           宁波镇海

    5、引伸计YYU50-10            北京钢研究院

    6、拉线式位移测量系统

    7、全套附具包括:常用O型圈组合垫、管接头、连接高压油管

    8、MaxTest专用控制软件

    9、联想商用品牌机                                                            

    10、惠普A4喷墨打印机

    -----济南金力试验仪器有限公司----0531-87152366 -------  

    展开全文
  • 原标题:材料电子万能拉力试验机一、产品介绍:该FL材料电子万能拉力试验机拥有FL先进的测控系统和测试软件,用于金属材料非金属材料复合材料高分子材料树脂材料等在常温或者高低温环境下的拉伸、压缩、弯曲、剪切、...
  • 为了利用单向拉伸试验机开展平板材料的剪切试验,设计了两种形状特殊的剪切试件,即对称剪切试件和偏置剪切试件,并对双相钢材料的两种试件分别进行了试验和数值计算,对比了两种试件的断口倾角、剪切工作区的剪应力分布...
  • 计算机系统通过全数字控制器,经调速系统控制伺服电机转动,经减速系统减速后通过精密滚珠丝杠副带动移动横梁上升、下降,完成试样的拉伸、压缩、弯曲、剪切等多种力学性能试验,另外配置种类繁...
  • 并对在性能方面做些对比。 性能和准确 目前有个超过150,000张图片的实验,有几张已知出现次数的待查找测试图片。比如一张图片(针)在150,000张图片(草堆)中出现一次,另外一张出现两次,第三张测试图片出现...
  • 直方图的对比主要用以判断两幅图像的匹配,我们试验以下两幅图像直方图对比的结果:   int main() { IplImage * image= cvLoadImage("myhand1.jpg"); IplImage * image2= cvLoadImage("myhand2.jpg"); ...
  • 有限元软件对比

    2020-05-28 10:56:12
    几何建模 可以通过拉伸、旋转、景象、缩放、偏置等操作得到面、体,可以直接构造矩形、多边形、圆、球、圆柱、圆锥、棱柱、圆环等;通过体面的布尔加、减、交等操作得到模型。 网格自动生成 GiD可将几何模型自动...
  • 直方图的对比主要用以判断两幅图像的匹配,我们试验以下两幅图像直方图对比的结果:   [cpp]   view plain copy int  main()  {   IplImage * image=...
  • 本实验应用有限元分析软件ANSYS构建出PD3型高铁钢轨试样和其周围空气层的有限元模型,对其在地磁场中拉伸试验的力磁效应进行模拟,得到不同载荷下应力的分布图以及其漏磁场的分布情况。通对分析,并将模拟结果与磁...
  • 本文研究了其中的图片文字分割技术 , 提出了一种解 决该 问题的方法: 首先对图片进行预处理, 用非线性对比度拉伸的方法提高图片中文字与背景的对 比度; 然后进行二值化处理 , 通过分析连通分量的几何特征以去除噪声...
  • 在分析拉普拉斯算子、直方图均衡化、对比度拉伸时域算法以及高通滤波、同态滤波频域算法的基础上,结合一个实际海上船舶监控系统,对这些算法进行一一试验,综合破雾效果以及算法实用性得出高通滤波器具有最佳的实用...
  • 所提方法采用线性对比度拉伸来消除光照影响,并将模板图像各圆环内像素点的高斯混合模型聚类参数作为模板特征。匹配时通过一次迭代计算即可得到匹配误差,且该匹配过程可通过查找表来提高匹配速度。在目标搜索时使用...
  • 数字图像处理知识点

    2019-01-16 16:25:42
    1. 邻接性允许p的取值不在集合V中。...(4)分段线性变换函数:对比度拉伸、灰度级分层、位平面分层。 3. 直方图均衡 4. 空间滤波器 (1)算术均值滤波器:用于模糊处理和降低噪声;几何均值...
  • 最近学习到的静脉图像识别方法,大致做一下整理。背景:类似指纹识别,实现静脉识别。目的:通过红外线图,...直方图均衡也是增强对比度的一种方法,经过实验,效果不如线性拉伸,因此忽视。为了更好的边缘提取,使...
  • 直方图处理

    2017-10-01 14:42:00
    直方图处理是一种灰度变换操作,可以提高图像对比度,进行图像增强,将较窄的图像灰度范围(低对比度)以一定规则拉伸至较大(整个灰度级范围内)的范围(高对比度)。暗图像中,直方图的分量集中在灰度级的低端,...
  • 利用金相显微镜、扫描电镜、万能拉伸试验机、冲击试验机等检测手段,采用对比分析的方法研究了不同Ni质量分数对铁路货车摇枕、侧架用铸钢组织性能的影响,试验结果表明:随着 Ni质量分数增加,铸钢晶粒等级逐渐...
  • 常见物理性能测试仪器设备...为物性试验、教学研究、质量控制等不可缺少的检测设备,拉力机夹具作为仪器的重要组成部分,不同的材料需要不同的夹具,也是试验能否顺利进行及试验结果准确高低的一个重要因素。 中文名

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 515
精华内容 206
关键字:

对比度拉伸实验