In the aging society with less work force, replacement of work force by robot is expected. However, ordinary people are not good at programming a robot. A user friendly programming method is programming by demonstration, which requires users only to show the motion to robots by doing it by themselves. There still remains problems for programming by demonstration with bilateral control as its mean. That is recorded raw data is unsuitable to the situation at use, especially because of repositioning of the object working on. In this paper, with camera, which is a sensor often used in autonomous robots, the object position was measured and rearrangement of the motion data is conducted. As a result, the proper motion could reproduced concerning the relative position with the target object. The performance of the proposed method was compared with the conventional method in experiments, and discussion on its real use was held.