Action Principale : annotateImages
| 1 | PROC CAS; |
| 2 | LOADACTIONSET 'image'; |
| 3 | /* Laden von Bildern in eine CAS-Tabelle */ |
| 4 | image.loadImages / |
| 5 | path='path/to/your/images/' |
| 6 | casOut={name='my_images', caslib='CASUSER'}; |
| 7 | |
| 8 | /* Erstellen einer Tabelle mit Annotationsdaten (z.B. für Rechtecke) */ |
| 9 | DATA casuser.annotations_data; |
| 10 | LENGTH _image_ $200; |
| 11 | _image_ = 'image1.jpg'; _x_=50; _y_=50; _width_=100; _height_=80; _label_='Objekt1'; OUTPUT; |
| 12 | _image_ = 'image2.png'; _x_=20; _y_=30; _width_=120; _height_=100; _label_='Objekt2'; OUTPUT; |
| 13 | RUN; |
| 14 | |
| 15 | /* Zusammenführen der Bildtabelle mit den Annotationsdaten */ |
| 16 | PROC SQL; |
| 17 | create TABLE casuser.images_with_annotations as |
| 18 | select a.*, b._x_, b._y_, b._width_, b._height_, b._label_ |
| 19 | from casuser.my_images as a |
| 20 | join casuser.annotations_data as b |
| 21 | on a._path_ = b._image_; |
| 22 | QUIT; |
| 23 | RUN; |