역수와 역행렬

수학 이야기 2017. 8. 12. 15:48

3의 역수는? 1/3


그럼 '역수'란? ...


역수를 구하는 방법은 알아도 역수가 무엇인지는 모르는 경우가 많다.


마찬가지로 역행렬이 무엇인지 물어보면,


학생 1) 1/(ad-bc) * [d -b; -c a]


학생 2) 곱해서 항등행렬(I)이 나오는 행렬


물론 두번째 대답이 정확한 대답이다. 만일, 이와 같이 바로 답할 수 있다면 이 학생의 수학실력이나 앞으로의 공부에 대해서는 걱정할 필요가 없을 듯 하다.


그런데, 학생 2와 같이 대답한 경우에도 사실은 한번 더 확인할 필요가 있다. 그걸 그냥 지식처럼 알고 있는 것인지, 아니면 정말 이해한 것인지


만일 대학생에게 두 행렬의 곱 AB의 역행렬이 무엇이냐고 물어보면 아마도 대부분 B-1A-1라고 자신있게 대답할 것이다 (물론, A-1B-1인가? 하는 학생도 분명 있다). 하지만, B-1A-1가 역행렬인 이유를 증명해봐라 하면 대부분 당황해 한다.


'증명'이라는 말만 들어도 사고기능이 정지하는 경우도 있고 역행렬의 의미를 제대로 이해하고 못한 경우도 있을 것이다. 하지만 그 증명은 정말 간단하다.


증명: AB에 B-1A-1를 곱하면 AB * B-1A-1 = I이다. 따라서, AB의 역행렬은 B-1A-1이다. 끝.


역행렬의 정의를 정확히 이해하고 있다면 당연히 풀수 있는 문제이다. 또한 역행렬의 정의를 안다면 AB의 역행렬이 A-1B-1인지 B-1A-1인지 혼동할 이유도 암기할 이유도 없다. 그리고, 정의로부터 kA의 역행렬은 1/kA-1, ABC의 역행렬은 C-1B-1A-1, PAP-1의 역행렬은 PA-1P-1, 대각행렬 diag{c1, c2, ..., cn}의 역행렬은 diag{1/c1, ..., 1/cn}임도 손쉽게 알 수 있다.


☞ 어떤 수의 역수는 자신과 곱해서 (곱셈에 대한 항등원인) 1이 나오는 수입니다.


☞ 2018.8.14일자 댓글을 참고로 적습니다: 두 행렬의 곱 P = AB가 full-rank square matrix 일 때 inv(P)가 존재하고, 또한 A와 B 각각은 full-rank square matrix가 아닐수도 있으므로 inv(A)나 inv(B)는 존재하지 않을 수도 있습니다. 따라서 만약 AB의 역행렬이 존재한다면 그것의 정확한 표기는 inv(B)*inv(A)가 아니라 inv(AB) 라고 해야합니다.


by 다크 프로그래머


'수학 이야기' 카테고리의 다른 글

아이와 수학 공부하기  (5) 2017.11.15
Gram–Schmidt(그람-슈미트) 직교화  (12) 2017.05.17
곱셈과 덧셈  (2) 2017.04.26

DarkLabel - 비디오/이미지 객체 레이블링 툴 (Video/Image Labeling and Annotation Tool)

개발한 것들 2017. 7. 18. 11:21

동영상 또는 이미지에 ID를 가진 물체 경계사각형(bounding box)를 labeling할 수 있는 유틸러티 프로그램입니다. 인터페이스 등 사용성은 어느 프로그램보다 뛰어나다고 생각합니다. 학습 데이터 생성 외에도 비디오 편집이나 이미지들을 동영상으로 합치거나 분리할 때, 개인정보 보호를 위해 사람 얼굴 등을 모자이크하는 용도로도 활용할 수 있습니다.

 

※ 이 프로그램은 코드서명을 하지 않았기 때문에 Windows 및 웹브라우져에 의해 다운로드 및 실행이 차단될 수 있습니다 (참고링크). 100% 안전한 프로그램이긴 합니다만 필요한 분들만 사용하시기 바랍니다..

 

 

This is a utility program that can label object bounding boxes with ID in videos and images. Anyone can use it for non-commercial purposes. If you have any inquiry or suggestion, you can leave message below or email to darkpgmr.lee at gmail dot com.

 

※ Since this program is not code-signed, download and execution may be blocked by Windows and web browsers. This is a personally created program and a 100% safe program, but only for those who need it.

 

 

DarkLabel (Ver.2.4, 2021.09.04)

 

latest executable: DarkLabel2.4.zip

github: https://github.com/darkpgmr/DarkLabel

previous versions: check Version History below

 

DarkLabel2.0 Tutorial Video (https://www.youtube.com/watch?v=lok30aIZgUw)

 

old demo1(gt_extractor): https://www.youtube.com/watch?v=zFpX2bORz5E

old demo2(darklabel1.2): https://www.youtube.com/watch?v=vbydG78Al8s

 
 

Main Features (주요 기능 및 특징)

  • Video/image object labeling & annotation tool (bounding box with ID and label)

- automatic object labeling by visual tracking (multi-target)

- semi-automatic labeling by linear interpolation

- user-configurable hotkeys and zoom in / zoom out support

- user-configurable data formats (pascal voc, darket yolo, xml/txt, any other user-defined formats)

  • Video splitting (into images) & image merging (into a video file) tool
  • Video cropping tool (cut and save only the selected section in the video)
  • Video/image privacy masking tool (mosaic the box area in the image)
  • Windows only (32/64 bits)

 

Program Configuration (프로그램 설정)

 

The program can be configured by modifying darklabel.yml attached in the zipped archive.

  • define and modify data formats
  • change hotkeys (frame navigation, action keys)
  • change video/image export setting (video codec, frame rate, image format)
  • set default save/load directory
  • define class labels
  • adjust GUI drawing (box width, box color, ...)

 

Basic Instruction (프로그램 사용법)

 

Arow/PgUp/PgDn/Home/End: navigate image frames

 

Mouse: Left(create box), Right(cancel the most recently created box)

Shift+Mouse: Left(modify box), Right(delete selected box/trajectory or all boxes)

Shift+DoubleClick: modify box properties (label, ID, difficulty)

 

DoubleClick: select/deselect box trajectory

*box trajectory: boxes connected across frames with the same ID and label

 

Ctrl+'+'/'-': zoom in/out

Ctrl+Arrow: scroll zoomed window

Ctrl+MouseWheel: zoom in/out

Ctrl+MouseDrag: scroll zoomed window

 

Enter or Spacebar: apply tracking (selected trajectories or newly created boxes only)

Ctrl+'s': save gt

F1: show this help

 

 

Advanced Instruction (고급 사용법)

 

  • Labeling by object tracking

- By pressing 'Return' key, newly created bounding boxes in the current frame are tracked in the next frame and labeled automatically. (newly created boxes: the boxes that are created after entering the frame)

- If there are selected trajectories in the frame (object trajectory can be selected by double clicking a box), only the trajectory boxes are tracked (newly created boxes are not tracked).

- If tracking is applied to trajectories, it first deletes their tail parts (connected trajectory boxes after the current frame) and then continue the tracking, keeping their IDs and labels. This functionality can be used to correct previous wrong tracking.

- Two trackers are embeded. (developed by darkpgmr)
  . tracker1 (robust): good for deformable objects (e.g., human, ..)
  . tracker2 (accurate): good for rigid/static object (e.g., vehicle, wall, house, ...)

  • Data Sampling/gathering

If you want to sample images in a video and save them (e.g. gathering training samples), draw dummy boxes on the images and then export the annotation results as images with the "no box drawing" option selected and the "labeled frames only" checked.

  • Privacy Masking

draw boxes on the privacy area (e.g. human faces) and then export the annotation results with the "mosaic the box area" option selected.

  • Full screen mode

do annotation in full screen mode in case the image is too large to show in your monitor (double click the title bar of image window). You also can utilize zoom in functionality.

  • Don't forget to save your annotation results as often as possible. You can just press Ctrl+S.

 

Remark (2020.7.9)

 

그동안 프로그램이 이유없이 죽는다는 댓글들이 종종 있었는데, 원인을 모르다가 최근에야 UI delay를 없애기 위해 도입했던 thread 처리에 문제가 있었음을 알게 되었습니다. 이번 DarkLabel 2.0에서는 대부분  문제를 제거했지만 혹시 남은 문제가 발견되면 피드백 바랍니다.

 

Version History

 

DarkLabel 2.4 (2021.09.04)

- support to save/load data in .csv file
- support MOT data format
- add a new format specifier ("c=n"): it can be used to save/load dummy values (see darklabel.yml for it's usage)
- enhance error handling (make it more robust to various external and internal errors)

 

DarkLabel 2.3-update2 (2021.07.03)

- fix possible mismatch between labels and saved images in case of video input
- support to delete labels in intervals

- add two new adjustable parameters in darklabel.yml
  . min_object_size: minimum allowed box size
  . hotkey_return: secondary hotkey for return/enter key (for tracking)
- adjust GUI layout (make it more slim)

 

DarkLabel 2.3-update1 (2021.03.23)

- fix the program to sort image list naturally by their file name

. before: 0.jpg, 1.jpg, 10.jpg, 100.jpg, 101.jpg, ...

. after: 0.jpg, 1.jpg, 2.jpg, 3.jpg, ...

 

DarkLabel 2.3 (2020.10.25)

- enable selection of multiple object trajectories at the same time

- tracking is applied for object trajectories.

- minor bug fixes..

 

DarkLabel 2.2 (2020.10.20)

- support media cropping (the selected section in the video / image list)

- it's able to change export settings on the GUI.

 

DarkLabel 2.1 (2020.09.10)

- add two new parameters to support easy data gathering/sampling in darklabel.yml

  . export_labeled_frame_only

  . export_without_box_drawing

- doesn't popup message box now after video/image save is done.

 

DarkLabel 2.0 (2020.06.29)

- support machine learning formats: xml(pascalvoc/imagenet), txt(darknet yolo)

- support user-defined data formats (data formats can be defined in 'darklabel.yml')

- correct program stability problem (bug-fix related to unexpected program exit)

- support zoom in / zoom out of working image

- add user-configurable hotkeys (it can be modified in 'darklabel.yml')

- labeling by tracking is now applied only to newly created boxes (keep the old boxes)

- lots of minor revision to enhance user convenience and program stability

 

* DarkLabel 1.3 (2018.03.31)

- 프로그램의 완성도를 높임 (ui, 반응속도, 안정성, 에러체크, 미세한 기능들, ...)

- trajectory 단위로 박스 선택/삭제/label수정 가능

- label(class)과 id를 분리해서 저장/로드할 수 있는 데이터 포맷 추가

 

* DarkLabel 1.2 (2018.02.19)

- 심각한 버그 수정: 숫자를 label로 사용할 경우 gt 데이터 로드시 오류 현상 수정

- interpolation을 이용한 labeling 기능 추가 (본문의 프로그램 사용법 참조)

- 개체 ID 자동부여 및 auto labeling 기능 추가 (본문의 프로그램 사용법 참조)

- 비디오내 프레임 이동시(navigation) GUI 반응성 개선

 

* DarkLabel 1.1 (2017.09.06)

- 작업결과를 동영상/이미지로 저장할 수 있는 기능 추가

 

* DarkLabel 1.0 (2017.07.18)

- labeling 기능 추가, tracker의 성능 및 UI 반응성 개선, 최신 비디오코덱 지원

- 프로그램 이름을 GT_Extractor에서 DarkLabel로 변경

 

* GT_Extractor 2.3 (2016.09.29)

- 버그 수정 (이미지 리스트에서 GT 파일 저장/불러올 때 오류 현상)

 

* GT_Extractor 2.2 (2016.08.26)

- 지원 비디오 포맷 추가 (avi, mpg, mp4, wmv, ...)

 

* GT_Extractor 2.1 (2013.08.12)

- 비디오 뿐만 아니라 이미지 목록에 대해서도 편집 가능

 

* GT_Extractor 2.0 (2013.01.15)

- 복수개의 대상 설정 및 추적 기능

 

* GT_Extractor 1.0 (2013.01.08)

- 이미지 당 하나의 대상만 설정할 수 있음

 

by 다크 프로그래머

'개발한 것들' 카테고리의 다른 글

테트리스 (Tetris)  (8) 2020.10.18
카메라 캘리브레이션 프로그램 (DarkCamCalibrator)  (169) 2014.07.17
영상추적 프로그램(DTracker)  (212) 2013.11.29

인터뷰

잡기장 2017. 7. 13. 17:11

얼마 전 한 친구와 인텨뷰를 가졌다. 이력서와 자기소개서는 훌륭했다. 하지만 이력서와 자기소개서는 참고일 뿐 그것만으로는 판단이 힘들다. 그래서 자신이 그동안 한 것에 대해서 발표를 부탁했다.


발표는 나쁘지 않았고 딥러닝을 이용해서 실제 문제에 적용한 결과도 나쁘지 않았다. 그리고 사용한 알고리즘이나 발표하면서 사용한 기술적인 용어들로 봤을 때 이 정도면 컴퓨터 비전에 필요한 기본적인 소양은 갖추었다고 판단됐다.


하지만 그것은 성급한 판단이었다. 발표만으로는 확실한 판단이 어렵기 때문에 발표 후 간단한 구술 테스트를 진행했다. 이른바 인터뷰이다. 그런데 인터뷰에서는 전혀 다른 결과가 나왔다.


테스트는 수학, 기계학습, 프로그래밍, 영상처리에 대한 질의응답 형식으로 진행했다. 예를 들어, 그 친구가 발표 도중에 SVM을 사용했다는 내용이 나왔으면 SVM이 무엇인지 간략하게 설명할 수 있느냐? 학습에서 Stochastic gradient 방법을 썼다고 했는데 그게 무슨 방법이냐? gradient가 무엇이냐? 등등 본인이 발표한 내용 중에서 관련된 개념 등을 물어보는 것이다. 그리고 프로그래밍 관련해서는 C에서 포인터가 무엇이냐? C++을 사용할 수 있다고 했는데 virtual 함수가 무엇이냐? 등 기초적이지만 수준을 체크할 수 있는 질문들이다.


그런데, 이 친구가 거의 답변을 못한다.. 막연한 지식 또는 주변적인 답변만 할 뿐 정작 질문 자체에 대해서는 답변을 하지 못한다. 그냥 가져다 쎴다. 잘 모르겠다... 어느 것 하나도 깔끔한 답변이 없다. 딱 자신이 발표한 내용, 말한 내용까지만 알고 있는 것이다.


물론 그럴 수 있다. 바쁜 세상에 모든 것을 다 알 수는 없다. 그게 뭔지는 잘 몰라도 결과가 좋다면 가져다 쓰는 것이 현실이다. 요즘 DNN을 사용하는 것이 그렇다. 그냥 가져다 쓰면 잘 된다. 이른 바 black-box implementer가 되는 것이다. 하지만, 아무리 그래도 최소한 자신이 사용하는 것에 대해서는 기본적인 개념 정도는 알고 있어야 한다.


그 친구는 조금 안타깝다.. 태도나 성실성, 경험 측면에서는 모두 통과다. 하지만 자신이 하고 있는 것에 대해서 의문을 갖지 않는 것은 받아들이기 어렵다. 그것은 잠재력과 같은 것이다..


by 다크 프로그래머

'잡기장' 카테고리의 다른 글

기술의 가치  (7) 2018.10.12
책읽기  (3) 2017.05.24
말말말  (0) 2016.11.29