I want to use a template image to search target in the another image.But the target have scale and rotation change,also the target mix with noise which the color is same wit
You need to calculate scale and rotation invariant features. There exist several feature descriptors that claim these properties. Scale invariance is often emulated by matching against a set of different scales of the target. Another way can be to normalize scale and rotation of the target first.
Have a look here: https://dsp.stackexchange.com/questions/4893/scale-and-rotation-invariant-feature-descriptors
You can try Generalized Hough Transform (GHT), to find contours using template. As I remember, there was ready to use implementation in opencv (gpu) examples.(opencv/samples/gpu/generalized_hough.cpp on my machine)
Here is also useful link with source code: http://www.itriacasa.it/generalized-hough-transform/instructions.html