Description
------------------------
```
分析圖片
圖形處裡
旋轉
2值化
反向
顏色分析 x-rite color checker analysis
遮罩 (mask)
Gamma
搜尋特徵
邊緣強化(矩陣圖形強化or虛化)
圖形 座標[x,y]/顏色(RGB,L-a-b,x-y-z),即時資訊
SFR(MTF 需 python) 圖片清晰度 計算
獲取圖片
JPG.  PNG. BMP. SVG
USB WebCam
保存圖片
JPG.  PNG. BMP. (svg 向量圖形需 SK4D.dll)
2021/ 12/ 23  增加棋盤分割 function.
結合 WebCam access.
三點求圓心 (移動游標在 圓的邊緣 按 p 三次 可求得中心位置 並與圖片中心做比較)

```
**Function Description:**
crop a image form big image
A lots of Image Process function tested of this AP:
1. gamma
2. Crop  (mouse right button to drag a range)
3. Draw special pattern
4. Mark area
5. SFR (10%-90% rise time,pixels)  & MTF (python) The spatial frequency corresponding to this rise time is 164.8 cycles per picture height (PH).
6. Drawing
7. Mark function
8. Color analysis
9. Image format transfer  (jpg bmp gif png)
10. Zoom in out back function
11. Image drag drop
12. Image rotation
13. image load
14. Exam pixel color gray scale
15. image color center weight calculation.
16. USB webcam access and setting.
17. Polygon crop feature. (keyboard press "p" to add point)
18. Analysis average color of certain range and calculate center weight of target color.
19. Polygon Grouping


this ap need
### Unit_Image_process.pas code in
```
https://intretech-tw.synology.me:30000/tde/delphi10/tde_common

```


TProcess-Delphi for cmd Process
```
https://intretech-tw.synology.me:30000/tde/delphi10/TProcess-Delphi
```





function add:
 - remember latest action. when  crop again do latest function again.

### This Application include skia dll to process svg file type ( vector format image file) make sure sk4d.dll file in same directory.
### Since new version of image_crop  include python for MTF analysis
#### you need to install python 3.7.x .. 3.13.x  and environment parameter with python path

#### - in order to make MTF calculation work, following installation instruction you must follow:
 - install python 3.1x.x:
 - path on environment :path of  Pythonxxx\Scripts  & Pythonxxx
```
run
 install_python.bat
```
|   Library    |
| ------------ |
| numpy        |
| sklearn      |
| scikit-learn |

to include those library.


##### for Python 3.13.0 as example
- install python 3.13.0 (for all users)
	* check include environment path when install.
	* D:\Program Files\Python313\Scripts\
	* D:\Program Files\Python313\
- in command line  goto python313\scripts  path

```
show numpy version
python -c "import numpy as np; print(np.__version__)"
```

live update website in
 - Click "help"-> "about" to check online available version.
 - Related applications : [TDE related Applications](https://intretech-tw.synology.me/NAS_file_Share/)


### add load SVG file
  - You can install it via the Delphi package manager or manually from the Skia4Delphi GitHub repository.


## Project files list

| File Name     | Description |
| ---      | ---       |
| image_crop.chm                    | help file         |
| 12233_1920x1080.jpg               | imatest iso 12233 picture exampel         |
| image_crop.ini                    | exe file setting history         |
| 9pad_2.jpg                        | grouping test pattern |
| image_crop.exe                    | main program         |
| center_test_cricle_image.png      | crirle center test pattern         |
| Chromatic_Aberration_1.png        | CA test pattern         |
| CIE1931xy_ColorChecker_SMIL.svg   | x-rite color checker         |
| CIE1931_x-rite.png                | CIE1931_x-rite reference pattern         |
| color7x17.jpg                     | reference pattern         |
| colorcheck_sample.jpg             | color checker sample         |
| color_grouptest.bmp               | grouping test pattern         |
| Color_tempe.png                   | color temperature test pattern         |
| grouping.png                      | grouping test pattern         |
| image_crop.ReOpen                 | history file     |
| install_python.bat                | run this to install python library  |
| readme.md                         | this file         |
| sk4d.dll                          | for 向量圖 process         |
| x-rite_ref.png                    | x-rite 參考圖         |
