Selvy Pen SDK  for Math

Selvy Pen SDK for Math는 손글씨로 입력한 수식/화학식을 LaTeX로 변환할 수 있습니다.
무료로 SDK를 다운로드 받고, 예제 코드를 이용하여 수식인식을 프로젝트에 활용해 보세요.

C/C++

#include "dhwr.h"

int main() {
    unsigned long status = ERR_SUCCESS;
    status = DHWRCreate("./license_key/license.key");

    if (ink_obj == NULL) {
        ink_obj = DHWRCreateInkObject();
    }
    if (result_obj == NULL) {
        result_obj = DHWRCreateResultObject();
    }
    if (setting_obj == NULL) {
        setting_obj = DHWRCreateSettingObject();
    }

    DHWRSetRecognitionMode(setting_obj, MULTICHAR);
    DHWRSetExternalResourcePath("./hdb/");
    //...

C#

using Selvasai;

static void Main() {
    int status = Hwr.Create("./license_key/license.key");

    if (inkObj == IntPtr.Zero) {
        inkObj = Hwr.CreateInkObject();
    }
    if (settingObj == IntPtr.Zero) {
        settingObj = Hwr.CreateSettingObject();
    }
    if (resultObj == IntPtr.Zero) {
        resultObj = Hwr.CreateResultObject();
    }
    Hwr.SetExternalResourcePath("./hdb/");
    Hwr.SetExternalLibraryPath("./lib/");
    Hwr.SetRecognitionMode(settingObj, Hwr.MULTICHAR);
    Hwr.SetCandidateSize(settingObj, MAX_CANDIDATES);
    //...

Java

import com.selvy.spmath.DHWR;

public class MathSimpleExample extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        final String filesPath = getFilesDir().getAbsolutePath();
        int status = DHWR.Create(filesPath + "/" + "license.key");
        if (status != DHWR.ERR_SUCCESS) {
            return;
        }

        DHWR.SetExternalResourcePath(filesPath.toCharArray());
        mInk = new DHWR.Ink();
        mSetting = new DHWR.Setting();
        mResult = new DHWR.Result();
        DHWR.SetRecognitionMode(mSetting.GetHandle(), DHWR.MULTICHAR);
        DHWR.SetCandidateSize(mSetting.GetHandle(), MAX_CANDIDATES);
        DHWR.SetExternalLibraryPath(getApplicationInfo().nativeLibraryDir.toCharArray())
        //...

수식 인식 심볼

SDK v1.2.4 기준

타입 심볼
Number \(0\;1\;2\;3\;4\;5\;6\;7\;8\;9\)
Latin Letter \(A\;B\;C\;D\;E\;F\;G\;H\;O\;P\)
\(a\;b\;c\;d\;e\;f\;g\;h\;i\;l\;m\;n\;p\;q\;r\;x\;y\;z\)
Greek Letter \(\pi\;\alpha\;\beta\;\gamma\;\theta\)
Binary Relation \(\lt\;\gt\;=\;\le\;\ge\;\neq\;\colon\;\pm\;\mp\;\because\)
Binary Operator \(+\;-\;\times\;\div\;\%\)
Arrow \(‾\;(\mathrm{overline})\)
Delimiter \(\;(\;)\;\{\;\}\)
Miscellaneous symbol \(√\;\angle\)
Names of functions \(\sin\;\cos\;\tan\)
Units \(\mathrm{m}\;\mathrm{mm}\;\mathrm{km}\;\mathrm{cm}\;\mathrm{g}\;\mathrm{kg}\;\mathrm{t}\;\mathrm{mL}\;\mathrm{L}\)
Etc. \(\ldotp\;\perp\;\triangle\;\Box\;\equiv\;\sim\;-(\mathrm{fraction})\;°\;,\;\prime\)
구조 예시
Horizontal pair horizontal pair \(2x\)
Fence fence \((1024+512)\)
Fraction fraction \(\dfrac{2x+4}{5y-2}\)
Square root square root \(\sqrt{144} + \sqrt{1728}\)
Subscript subscript \(x_i\)
Superscript superscript \(x^2\)
Overscript overscript \(\overline{AB}\)

화학식 인식 심볼

SDK v1.2.4 기준

타입 심볼
Number \(0\;1\;2\;3\;4\;5\;6\;7\;8\;9\)
Latin Letter \(A\;B\;C\;D\;E\;F\;G\;H\;I\;K\;L\;M\;N\;O\;P\;R\;S\;T\;U\;V\;W\;\)
\(X\;Y\;Z\;a\;b\;c\;d\;e\;f\;g\;h\;i\;k\;l\;m\;n\;o\;p\;r\;s\;t\;u\;v\;y\)
Binary Operator \(+\;-\)
Arrow \(\rightarrow\)
Delimiter \(\;(\;)\;\)
구조 예시
Horizontal pair horizontal pair \(Cl\)
Fence fence \((OH)\)
Subscript subscript \(Al_{2}\)
Superscript superscript \(Ca^{2+}\)
Subsuperscript subsuperscript \(SO_{4}^{2-}\)