2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

edge based template matching

Last updated at Posted at 2022-05-17

1.はじめに

ROS,OpenCV,Qtを使ってエッジベースのテンプレートマッチソフトウェアを作成しました

カメラを使った、工業部品の位置認識などに使用できればなと考えています

このリポジトリの使い方を記載します

2.環境

Ubuntu 20.04 x86_64
ros noetic

3.install

cd ~/
git clone https://github.com/hoshianaaa/geometric_match_ros.git
cd geometric_match_ros
mkdir build 
cd build
cmake ..
make

4.実行

別ターミナルで

roscore

先程ビルドしたバイナリを実行します

cd ~/geometric_match_ros/build
./geometric_match_ros

実行すると以下のようなguiが表示されます.

Screenshot from 2022-05-17 21-09-03.png

ここにトピック名/usb_cam/image_raw (sensor_msgs/Image)で画像を流し込みます.

cd ~/geometric_match_ros/script
python3 img_pub.py search2.jpg 

guiに画像が表示されたら, 認識したいテンプレートの設定を行います.

テンプレート画像の設定

1.update imageをクリックし、現在のフレームを取得
2. bounding boxでテンプレートを囲む
3.cropボタンクリック

Screenshot from 2022-05-17 21-36-25.png

テンプレートが切り取れたら,テンプレート画像の好きな位置をクリックし把持点を設定をします

Screenshot from 2022-05-17 21-36-55.png

テンプレートの設定が終わったら,入力画像からテンプレートにマッチする位置を検出し,対応する把持位置が/result [geometry_msgs/Pose2D]のトピックで出力されます

Screenshot from 2022-05-17 21-36-02.png

最後に

今後、このソフトウェアを使用して部品を認識し、ロボットでピッキングできればなと考えています

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?