I have a template image , with white background and black shape over it.I also have an image which have a similar shape but in different rotation and scale,also have some noise in image.Just like the pic as follow!

find the target shape.How can i use template rotateRect to find a target rotateRect in opencv?Can you share your idea.Thanks in advances!!
SilverSurfer
Considering the scenario, you can try segmenting the image on the basis of color since your object of interest is black and noise is blue in color. Then, you can proceed with the contour based approach for finding your target. You can refer this link for implementation OpenCV:Watershed algorithm
You can also refer this SO link Coca-Cola can shape recognition.
来源:https://stackoverflow.com/questions/31490234/is-there-an-algorithm-where-i-can-match-scale-and-rotation-rotaterect-in-opencv