Skip to content

Commit 12597af

Browse files
committed
Update chapter7
1 parent b31c20a commit 12597af

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Diff for: assets/capture/description.png

465 KB
Loading

Diff for: chapter7.md

+27
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,30 @@ this.appService.postRequest(faceURL, faceKey, blob).subscribe((data) => {
180180
![](./assets/capture/detectFace.png)
181181

182182
화면에 얼굴 인식 사각형까지 그리는 것을 완료하였습니다.
183+
184+
### Cognitive 결과 값을 화면에 출력하기
185+
이제 나머지 결과 값을 화면에 출력해보도록 하겠습니다.
186+
187+
가장 먼저 `description`을 표시할 `<h3>`태그를 만들어 줍니다.
188+
#### app.component.html
189+
```html
190+
<div class="ui container">
191+
...
192+
<canvas id="myCanvas" class="ui fluid" width="640" height="480"></canvas>
193+
<!-- description을 표시할 h3 태그 -->
194+
<h3 class="ui center aligned header">{{description}}</h3>
195+
</div>
196+
```
197+
그 다음으로는 `description`을 멤버 변수로 선언해줍니다.
198+
199+
#### app.component.ts
200+
```typescript
201+
private description;
202+
...
203+
this.appService.postRequest(faceURL, faceKey, blob).subscribe((data) => {
204+
...
205+
this.description = resultJson['description']['captions'][0]['text'];
206+
}
207+
```
208+
209+
![](./assets/capture/description.png)

0 commit comments

Comments
 (0)