Template matching algorithm based on gray level (c): Uniform method for dividing intensity (PIU)

Source: Internet
Author: User

Introduction:

Some of the more basic grayscale-based image registration algorithms are described in the previous articles:

Gray-based template matching algorithm (i): MAD, SAD, SSD, MSD, NCC, SSDA, SATD algorithm

A template matching algorithm based on gray Scale (II.): Local gray value coding

Image registration algorithm based on mutual information: MI, EMI, ECC algorithm

In this paper, a similar similarity measurement algorithm is described, called Partition intensity consistency method (partitioned Intensity uniformity,PIU).

PIU algorithm:

1992 years,Woods proposes a mr-pet image registration based on the uniform intensity of the partition. In medical images, the gray values of the same organizational structure are different in different modes. For example, bone tissue in CT images of high gray value, in the MRI image of the low gray value.

Definition:

The basic idea of the PIU measure is that the gray distribution of the same organization under different modes has some consistency. In other words, a pixel of one of the grayscale values in a modal is a distribution centered on a different grayscale value in another mode.

The expression for the PIU measure is defined as:


among them, N is the total number of pixels in the template, which is the product of the number of template rows. and the number of pixels in the template and sub-graph that are gray r,f , respectively . Represents a sub-graph in a search diagram.





Represents the sum of the pixel grayscale values for pixels in the template R that have a gray value of r in the corresponding position in the sub-graph. The same is true of other formulas.

Example Validation:matlab code:

%//Division Intensity Uniform Method (partitioned intennsity uniformity, PIU)%%//------------------------------------------------------- Clear All;close All;img=rgb2gray (imread (' lena.jpg ')); [Img_rows img_clos]=size (img);%/ /Search figure size x0=40;y0=30;len=64; R=img (x0:x0+len-1,y0:y0+len-1);%/ /Take part as Template figure;imshow (R); title (' Template '); [Rows Clos]=size (R);%/ /template size n=rows*clos;%%//-------------------------------------------------------ufr=zeros (256,1); Urf=zeros (256,1); Dfr=zeros (256,1);d Rf=zeros (256,1), A=zeros (256,1), B=zeros (256,1);p Iu=zeros (Img_rows-len,img_clos-len); for I=1: Img_rows-len for J=1:5:img_clos-len s=img (i:i+len-1,j:j+len-1);%/            /Sub-figure for r=0:255 Pos=find (R==R); Nr=size (pos,1) +eps;%/            /reference image the number of pixels in the gray value R value1=s (POS); UFr (r+1,1) =sum (value1)/nr;%/            The location of the R in the/R, corresponding to the pixel mean value t1=double (S (POS))-UFR (r+1,1) on S;            DFr (r+1,1) =sum (t1.^2)/nr;            Pos=find (S==R); Nf=size (pos,1) +eps;%/            /reference image the number of pixels in the gray value R value2=r (POS); URf (r+1,1) =sum (value2)/nf;            T2=double (R (POS))-urf (r+1,1);            DRf (r+1,1) =sum (t2.^2)/nf;            A (r+1,1) = (NR*DFR (r+1,1))/(N*UFR (r+1,1) +eps);        B (r+1,1) = (NF*DRF (r+1,1))/(N*urf (r+1,1) +eps);    End Piu (i,j) =sum (a) +sum (b); endend%%//-------------------------------------------------------piu_min=min (min (piu)); [Y,x]=find (Piu==piu_min); X=x-1;y=y-1;figure;imshow (IMG); hold On;rectangle (' position ', [x,y,len-1,len-1], ' Edgecolor ', ' R '); title (' Search result '); hold Off;%o Ver

Output Result:


Reference Documents:

1 . Zhang. Research on similarity measure in medical image registration [m],2014.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Template matching algorithm based on gray level (c): Uniform method for dividing intensity (PIU)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.