Scénario de test & Cas d'usage
Creation of a dataset representing 2 agricultural zones. Each zone is a 2x2 image (4 pixels). The data is organized by channel: 4 Red values, then 4 Green, then 4 Blue.
| 1 | DATA satellite_feed; |
| 2 | DO zone_id = 1 to 2; |
| 3 | /* Channel 0: Red (4 pixels) */ |
| 4 | DO i = 1 to 4; pixel_val = 200; OUTPUT; END; |
| 5 | /* Channel 1: Green (4 pixels) */ |
| 6 | DO i = 1 to 4; pixel_val = 150; OUTPUT; END; |
| 7 | /* Channel 2: Blue (4 pixels) */ |
| 8 | DO i = 1 to 4; pixel_val = 50; OUTPUT; END; |
| 9 | END; |
| 10 | RUN; |
| 11 | |
| 12 | PROC CASUTIL; |
| 13 | load DATA=satellite_feed outcaslib='casuser' casout='sat_pixels' replace; |
| 14 | RUN; |
| 1 | PROC CAS; |
| 2 | image.condenseImages / |
| 3 | TABLE={caslib='casuser', name='sat_pixels'}, |
| 4 | width=2, |
| 5 | height=2, |
| 6 | numberOfChannels=3, |
| 7 | groupedChannels=true, |
| 8 | inputs={{name='pixel_val'}}, |
| 9 | copyVars={'zone_id'}, |
| 10 | casOut={caslib='casuser', name='sat_images', replace=true}; |
| 11 | RUN; |
The output table 'sat_images' should contain 2 rows. The images should be correctly interpreted as RGB composites (combining the separate R, G, B blocks) rather than a grayscale sequence, thanks to the groupedChannels parameter.