約 5,787,007 件
https://w.atwiki.jp/fweo/pages/731.html
Example Page This page is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission. Do not edit this page.
https://w.atwiki.jp/sampleisbest/pages/394.html
開発環境 Apache Flex SDK 4.12.1 FlashDevelop 4.6.2.5 実行環境 Microsoft Windows 8.1 (64bit) プロジェクトの種類 ActionScript 3/AS3 Project プロジェクト名 PointAtExample
https://w.atwiki.jp/sampleisbest/pages/364.html
開発環境 Apache Flex SDK 4.12.1 FlashDevelop 4.6.1 実行環境 Microsoft Windows 8.1 (64bit) プロジェクトの種類 ActionScript 3/AS3 Project プロジェクト名 Context3DExample
https://w.atwiki.jp/touhoukashi/pages/171.html
【登録タグ COOL&CREATE COOL&CREATE 東方ボーカルコレクションII スーパーあまねりお S あまね 人恋し神様 ~ Romantic Fall 曲 稲田姫様に叱られるから】 【注意】 現在、このページはJavaScriptの利用が一時制限されています。この表示状態ではトラック情報が正しく表示されません。 この問題は、以下のいずれかが原因となっています。 ページがAMP表示となっている ウィキ内検索からページを表示している これを解決するには、こちらをクリックし、ページを通常表示にしてください。 /** General styling **/ @font-face { font-family Noto Sans JP ; font-display swap; font-style normal; font-weight 350; src url(https //img.atwikiimg.com/www31.atwiki.jp/touhoukashi/attach/2972/10/NotoSansCJKjp-DemiLight.woff2) format( woff2 ), url(https //img.atwikiimg.com/www31.atwiki.jp/touhoukashi/attach/2972/9/NotoSansCJKjp-DemiLight.woff) format( woff ), url(https //img.atwikiimg.com/www31.atwiki.jp/touhoukashi/attach/2972/8/NotoSansCJKjp-DemiLight.ttf) format( truetype ); } @font-face { font-family Noto Sans JP ; font-display swap; font-style normal; font-weight bold; src url(https //img.atwikiimg.com/www31.atwiki.jp/touhoukashi/attach/2972/13/NotoSansCJKjp-Medium.woff2) format( woff2 ), url(https //img.atwikiimg.com/www31.atwiki.jp/touhoukashi/attach/2972/12/NotoSansCJKjp-Medium.woff) format( woff ), url(https //img.atwikiimg.com/www31.atwiki.jp/touhoukashi/attach/2972/11/NotoSansCJKjp-Medium.ttf) format( truetype ); } rt { font-family Arial, Verdana, Helvetica, sans-serif; } /** Main table styling **/ #trackinfo, #lyrics { font-family Noto Sans JP , sans-serif; font-weight 350; } .track_number { font-family Rockwell; font-weight bold; } .track_number after { content . ; } #track_args, .amp_text { display none; } #trackinfo { position relative; float right; margin 0 0 1em 1em; padding 0.3em; width 320px; border-collapse separate; border-radius 5px; border-spacing 0; background-color #F9F9F9; font-size 90%; line-height 1.4em; } #trackinfo th { white-space nowrap; } #trackinfo th, #trackinfo td { border none !important; } #trackinfo thead th { background-color #D8D8D8; box-shadow 0 -3px #F9F9F9 inset; padding 4px 2.5em 7px; white-space normal; font-size 120%; text-align center; } .trackrow { background-color #F0F0F0; box-shadow 0 2px #F9F9F9 inset, 0 -2px #F9F9F9 inset; } #trackinfo td ul { margin 0; padding 0; list-style none; } #trackinfo li { line-height 16px; } #trackinfo li nth-of-type(n+2) { margin-top 6px; } #trackinfo dl { margin 0; } #trackinfo dt { font-size small; font-weight bold; } #trackinfo dd { margin-left 1.2em; } #trackinfo dd + dt { margin-top .5em; } #trackinfo_help { position absolute; top 3px; right 8px; font-size 80%; } /** Media styling **/ #trackinfo .media th { background-color #D8D8D8; padding 4px 0; font-size 95%; text-align center; } .media td { padding 0 2px; } .media iframe nth-of-type(n+2) { margin-top 0.3em; } .youtube + .nicovideo, .youtube + .soundcloud, .nicovideo + .soundcloud { margin-top 0.75em; } .media_section { display flex; align-items center; text-align center; } .media_section before, .media_section after { display block; flex-grow 1; content ; height 1px; } .media_section before { margin-right 0.5em; background linear-gradient(-90deg, #888, transparent); } .media_section after { margin-left 0.5em; background linear-gradient(90deg, #888, transparent); } .media_notice { color firebrick; font-size 77.5%; } /** Around track styling **/ .next-track { float right; } /** Infomation styling **/ #trackinfo .info_header th { padding .3em .5em; background-color #D8D8D8; font-size 95%; } #trackinfo .infomation_show_btn_wrapper { float right; font-size 12px; user-select none; } #trackinfo .infomation_show_btn { cursor pointer; } #trackinfo .info_content td { padding 0 0 0 5px; height 0; transition .3s; } #trackinfo .info_content ul { padding 0; margin 0; max-height 0; list-style initial; transition .3s; } #trackinfo .info_content li { opacity 0; visibility hidden; margin 0 0 0 1.5em; transition .3s, opacity .2s; } #trackinfo .info_content.infomation_show td { padding 5px; height 100%; } #trackinfo .info_content.infomation_show ul { padding 5px 0; max-height 50em; } #trackinfo .info_content.infomation_show li { opacity 1; visibility visible; } #trackinfo .info_content.infomation_show li nth-of-type(n+2) { margin-top 10px; } /** Lyrics styling **/ #lyrics { font-size 1.06em; line-height 1.6em; } .not_in_card, .inaudible { display inline; position relative; } .not_in_card { border-bottom dashed 1px #D0D0D0; } .tooltip { display flex; visibility hidden; position absolute; top -42.5px; left 0; width 275px; min-height 20px; max-height 100px; padding 10px; border-radius 5px; background-color #555; align-items center; color #FFF; font-size 85%; line-height 20px; text-align center; white-space nowrap; opacity 0; transition 0.7s; -webkit-user-select none; -moz-user-select none; -ms-user-select none; user-select none; } .inaudible .tooltip { top -68.5px; } span hover + .tooltip { visibility visible; top -47.5px; opacity 0.8; transition 0.3s; } .inaudible span hover + .tooltip { top -73.5px; } .not_in_card span.hide { top -42.5px; opacity 0; transition 0.7s; } .inaudible .img { display inline-block; width 3.45em; height 1.25em; margin-right 4px; margin-bottom -3.5px; margin-left 4px; background-image url(https //img.atwikiimg.com/www31.atwiki.jp/touhoukashi/attach/2971/7/Inaudible.png); background-size contain; background-repeat no-repeat; } .not_in_card after, .inaudible .img after { content ; visibility hidden; position absolute; top -8.5px; left 42.5%; border-width 5px; border-style solid; border-color #555 transparent transparent transparent; opacity 0; transition 0.7s; } .not_in_card hover after, .inaudible .img hover after { content ; visibility visible; top -13.5px; left 42.5%; opacity 0.8; transition 0.3s; } .not_in_card after { top -2.5px; left 50%; } .not_in_card hover after { top -7.5px; left 50%; } .not_in_card.hide after { visibility hidden; top -2.5px; opacity 0; transition 0.7s; } /** For mobile device styling **/ .uk-overflow-container { display inline; } #trackinfo.mobile { display table; float none; width 100%; margin auto; margin-bottom 1em; } #trackinfo.mobile th { text-transform none; } #trackinfo.mobile tbody tr not(.media) th { text-align left; background-color unset; } #trackinfo.mobile td { white-space normal; } document.addEventListener( DOMContentLoaded , function() { use strict ; const headers = { title アルバム別曲名 , album アルバム , circle サークル , vocal Vocal , lyric Lyric , chorus Chorus , narrator Narration , rap Rap , voice Voice , whistle Whistle (口笛) , translate Translation (翻訳) , arrange Arrange , artist Artist , bass Bass , cajon Cajon (カホン) , drum Drum , guitar Guitar , keyboard Keyboard , mc MC , mix Mix , piano Piano , sax Sax , strings Strings , synthesizer Synthesizer , trumpet Trumpet , violin Violin , original 原曲 , image_song イメージ曲 }; const rPagename = /(?=^|.*
https://w.atwiki.jp/sampleisbest/pages/242.html
開発環境 Microsoft Visual C# 2010 Express (SP1) 実行環境 Microsoft Windows XP Home Edition (SP3) プロジェクトの種類 空のプロジェクト プロジェクト名 MdxSample プロジェクト プロジェクトの保存 [ソリューションのディレクトリを作成]はチェックを付けなくてもいい。 プロジェクトのプロパティ [アプリケーション]タブ 出力の種類:Windows アプリケーション プロジェクトにクラスを追加。 テンプレート:クラス 名前:Program.cs 名前:Form1.cs 名前:MdxSample.cs プロジェクトに新しい項目を追加。 テンプレート:アプリケーション構成ファイル 名前:App.config プロジェクトの参照設定に追加。(.NETタブ) ※Ctrlキーで複数選択可 System System.Drawing System.Windows.Forms プロジェクトの参照設定に追加。(参照タブ) ※Ctrlキーで複数選択可 C \WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0 Microsoft.DirectX.dll Microsoft.DirectX.Direct3D.dll Microsoft.DirectX.Direct3DX.dll Microsoft.DirectX.DirectInput.dll 注意 MdxSample.exeと同じディレクトリにMdxSample.exe.configがないと動作が不安定になる。 参考 Managed DirectX - ソーサリーフォース LoaderLockエラーの対処 メニューから[ツール]-[設定]-[上級者設定]を選択する。 メニューから[デバッグ]-[例外]を選択する。 Managed Debugging Assistants/LoaderLockの[スローされるとき]のチェックを外す。 App.config ?xml version="1.0" encoding="utf-8" ? configuration startup useLegacyV2RuntimeActivationPolicy="true" supportedRuntime version="v4.0"/ /startup /configuration Program.cs using System; using System.Threading; using System.Windows.Forms; namespace MdxSample { static class Program { [STAThread] static void Main() { using (Form1 form = new Form1()) using (MdxSample main = new MdxSample()) { if (!main.DXInitialize(form)) { MessageBox.Show("Direct3Dの初期化に失敗しました。", "MdxSample"); return; } form.Show(); while (form.Created) { main.Render(); Thread.Sleep(1); Application.DoEvents(); } } } } } Form1.cs using System.Drawing; using System.Windows.Forms; namespace MdxSample { class Form1 Form { public Form1() { Text = "MdxSample"; ClientSize = new Size(1280, 720); MaximizeBox = false; FormBorderStyle = FormBorderStyle.FixedSingle; } } } MdxSample.cs using System; using System.Drawing; using System.Threading; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; using Microsoft.DirectX.DirectInput; namespace MdxSample { class MdxSample IDisposable { Form1 form; PresentParameters pp; Microsoft.DirectX.Direct3D.Device dev; Microsoft.DirectX.Direct3D.Font font; Microsoft.DirectX.DirectInput.Device keyboard; VertexBuffer vertexBuffer; // fps int fpsSec; int fpsDraw = 0; int fpsCount = 0; // カメラ float camDist = 3; int camLat = 0; int camLon = 180; public bool DXInitialize(Form1 topLevelForm) { try { form = topLevelForm; // キーボードデバイスの初期化 keyboard = new Microsoft.DirectX.DirectInput.Device(SystemGuid.Keyboard); keyboard.SetCooperativeLevel(form, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Background); keyboard.Acquire(); // Direct3Dデバイス作成 pp = new PresentParameters(); pp.Windowed = true; pp.SwapEffect = SwapEffect.Discard; pp.EnableAutoDepthStencil = true; pp.AutoDepthStencilFormat = DepthFormat.D16; dev = new Microsoft.DirectX.Direct3D.Device(0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, form.Handle, CreateFlags.HardwareVertexProcessing, pp); // フォントの作成 FontDescription fd = new FontDescription(); fd.Height = 24; fd.FaceName = "MS ゴシック"; font = new Microsoft.DirectX.Direct3D.Font(dev, fd); // 頂点バッファ CustomVertex.PositionColored[] vertices = new CustomVertex.PositionColored[3]; vertices[0] = new CustomVertex.PositionColored(0, 1, 0, Color.Red.ToArgb()); vertices[1] = new CustomVertex.PositionColored(1, -1, 0, Color.Green.ToArgb()); vertices[2] = new CustomVertex.PositionColored(-1, -1, 0, Color.Blue.ToArgb()); vertexBuffer = new VertexBuffer(typeof(CustomVertex.PositionColored), 3, dev, Usage.WriteOnly, CustomVertex.PositionColored.Format, Pool.Managed); using (GraphicsStream data = vertexBuffer.Lock(0, 0, LockFlags.None)) { data.Write(vertices); vertexBuffer.Unlock(); } dev.Transform.Projection = Matrix.PerspectiveFovLH(Geometry.DegreeToRadian(45), (float)dev.Viewport.Width / (float)dev.Viewport.Height, 1, 100); dev.RenderState.Lighting = false; return true; } catch { return false; } } public void Render() { KeyboardState state; state = keyboard.GetCurrentKeyboardState(); if (state[Key.Escape]) { form.Close(); return; } if (state[Key.Up]) camLat = Math.Min(camLat + 1, 89); if (state[Key.Down]) camLat = Math.Max(camLat - 1, -89); if (state[Key.Left]) camLon = (camLon + 1) % 360; if (state[Key.Right]) camLon = (camLon + 359) % 360; if (state[Key.PageUp]) camDist -= 0.1f; if (state[Key.PageDown]) camDist += 0.1f; // fps fpsDraw++; int sec = DateTime.Now.Second; if (fpsSec != sec) { fpsCount = fpsDraw; fpsDraw = 0; fpsSec = sec; } // カメラ位置 Vector3 pos; float rad = Geometry.DegreeToRadian(camLat); pos.Y = (float)Math.Sin(rad) * camDist; float r = (float)Math.Cos(rad) * camDist; rad = Geometry.DegreeToRadian(camLon); pos.X = (float)Math.Sin(rad) * r; pos.Z = (float)Math.Cos(rad) * r; dev.Transform.View = Matrix.LookAtLH(pos, new Vector3(), new Vector3(0, 1, 0)); // バックバッファのクリア dev.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.CornflowerBlue, 1.0f, 0); dev.BeginScene(); dev.SetStreamSource(0, vertexBuffer, 0); dev.VertexFormat = CustomVertex.PositionColored.Format; dev.DrawPrimitives(PrimitiveType.TriangleList, 0, 1); string text = string.Format("fps={0} lat={1} lon={2} dist={3 f1}", fpsCount, camLat, camLon, camDist); font.DrawText(null, text, 0, 0, Color.White); // バックバッファを表画面に反映 dev.EndScene(); try { dev.Present(); } catch (DeviceLostException) { ResetDevice(); } } void ResetDevice() { int result; if (!dev.CheckCooperativeLevel(out result)) { switch ((ResultCode)result) { case ResultCode.DeviceLost Thread.Sleep(10); break; case ResultCode.DeviceNotReset dev.Reset(pp); break; default form.Close(); break; } } } public void Dispose() { if (font != null) { font.Dispose(); } } } }
https://w.atwiki.jp/asterisk99/pages/570.html
original (2019/05/14 付) Google 翻訳 (2019/05/19 付) # API examples #APIの例 This wiki provides simple examples on how to use the tesseract-ocr API (v3.02.02-4.0.0) in C++. このWikiは、C ++でtesseract-ocr API(v3.02.02-4.0.0)を使用する方法に関する簡単な例を提供します。 It is expected that tesseract-ocr is correctly installed including all dependecies. tesseract-ocrがすべての依存関係を含めて正しくインストールされていることが期待されます。 It is expected the user is familiar with C++, compiling and linking program on their platform, though basic compilation examples are included for beginners with Linux. 基本的なコンパイル例はLinuxの初心者向けですが(#compiling-c-api-programs-linux)、ユーザーは自分のプラットフォームでC ++、プログラムのコンパイルおよびリンクに精通していることが期待されます。 More details about tesseract-ocr API can be found at baseapi.h. tesseract-ocr APIについての詳細はbaseapi.hにあります。 # Basic example #基本的な例 Code コード `c++ | `c ++ #include tesseract/baseapi.h #include tesseract / baseapi.h #include leptonica/allheaders.h #include leptonica / allheaders.h int main() int main() { { char *outText; char * outText; tesseract TessBaseAPI *api = new tesseract TessBaseAPI(); tesseract TessBaseAPI * api = new tesseract TessBaseAPI(); // Initialize tesseract-ocr with English, without specifying tessdata path // tessdataパスを指定せずに、tesseract-ocrを英語で初期化します if (api- Init(NULL, "eng")) { if(api- Init(NULL、 "eng")){ fprintf(stderr, "Could not initialize tesseract.\n"); fprintf(stderr、 "tesseractを初期化できませんでした。\ n"); exit(1); 出口(1); } } // Open input image with leptonica library // leptonicaライブラリで入力画像を開く Pix *image = pixRead("/usr/src/tesseract/testing/phototest.tif"); Pix * image = pixRead( "/ usr / src / tesseract / testing / phototest.tif"); api- SetImage(image); api- SetImage(image); // Get OCR result // OCR結果を取得する outText = api- GetUTF8Text(); outText = api- GetUTF8Text(); printf("OCR output \n%s", outText); printf( "OCR出力 \ n%s"、outText); // Destroy used object and release memory //使用済みオブジェクトを破棄してメモリを解放する api- End(); api- End(); delete [] outText; delete [] outText; pixDestroy( image); pixDestroy(&image); return 0; 0を返します。 } } ` | ` The program must be linked to the tesseract-ocr and leptonica libraries. プログラムはtesseract-ocrおよびleptonicaライブラリーにリンクされていなければなりません。 If you want to restrict recognition to a sub-rectangle of the image - call SetRectangle(left, top, width, height) after SetImage. Each SetRectangle clears the recogntion results so multiple rectangles can be recognized with the same image. E.g. 認識を画像のサブ矩形に制限したい場合は、SetImageの後に_SetRectangle(left、top、width、height)_を呼び出します。各SetRectangleは認識結果を消去するので、同じ画像で複数の長方形を認識することができます。例えば。 `c++ | `c ++ api- SetRectangle(30, 86, 590, 100); api- SetRectangle(30、86、590、100); ` | ` # GetComponentImages example #GetComponentImagesの例 `c++ | `c ++ Pix *image = pixRead("/usr/src/tesseract/testing/phototest.tif"); Pix * image = pixRead( "/ usr / src / tesseract / testing / phototest.tif"); tesseract TessBaseAPI *api = new tesseract TessBaseAPI(); tesseract TessBaseAPI * api = new tesseract TessBaseAPI(); api- Init(NULL, "eng"); api- Init(NULL、 "eng"); api- SetImage(image); api- SetImage(image); Boxa* boxes = api- GetComponentImages(tesseract RIL_TEXTLINE, true, NULL, NULL); Boxa * boxes = api- GetComponentImages(tesseract RIL_TEXTLINE、true、NULL、NULL); printf("Found %d textline image components.\n", boxes- n); printf( "%dテキスト行の画像コンポーネントが見つかりました。\ n"、boxes- n); for (int i = 0; i boxes- n; i++) { for(int i = 0; i n; i ++){ BOX* box = boxaGetBox(boxes, i, L_CLONE); BOX * box = boxaGetBox(boxes、i、L_CLONE); api- SetRectangle(box- x, box- y, box- w, box- h); api- SetRectangle(ボックス - x、ボックス - y、ボックス - w、ボックス - h); char* ocrResult = api- GetUTF8Text(); char * ocrResult = api- GetUTF8Text(); int conf = api- MeanTextConf(); int conf = api- MeanTextConf(); fprintf(stdout, "Box[%d] x=%d, y=%d, w=%d, h=%d, confidence %d, text %s", fprintf(stdout、 "ボックス[%d] x =%d、y =%d、w =%d、h =%d、信頼度 %d、テキスト %s"、、 i, box- x, box- y, box- w, box- h, conf, ocrResult); i、box- x、box- y、box- w、box- h、conf、ocrResult); } } ` | ` # Result iterator example #結果イテレータの例 It is possible to get confidence value and BoundingBox per word from a ResultIterator ResultIteratorから単語ごとの信頼値とBoundingBoxを取得することが可能です。 `c++ | `c ++ Pix *image = pixRead("/usr/src/tesseract/testing/phototest.tif"); Pix * image = pixRead( "/ usr / src / tesseract / testing / phototest.tif"); tesseract TessBaseAPI *api = new tesseract TessBaseAPI(); tesseract TessBaseAPI * api = new tesseract TessBaseAPI(); api- Init(NULL, "eng"); api- Init(NULL、 "eng"); api- SetImage(image); api- SetImage(image); api- Recognize(0); api- 認識(0); tesseract ResultIterator* ri = api- GetIterator(); tesseract ResultIterator * ri = api- GetIterator(); tesseract PageIteratorLevel level = tesseract RIL_WORD; tesseract PageIteratorLevel level = tesseract RIL_WORD; if (ri != 0) { if(ri!= 0){ do { 行う { const char* word = ri- GetUTF8Text(level); const char * word = ri- GetUTF8Text(level); float conf = ri- Confidence(level); float conf = ri- 信頼度(レベル)。 int x1, y1, x2, y2; int x1、y1、x2、y2。 ri- BoundingBox(level, x1, y1, x2, y2); ri- BoundingBox(レベル、&x 1、&y 1、&x 2、&y 2); printf("word %s ; \tconf %.2f; BoundingBox %d,%d,%d,%d;\n", printf( "単語 %s ; \ tconf %.2f;境界ボックス %d、%d、%d、%d; \ n"、 word, conf, x1, y1, x2, y2); ワード、conf、x1、y1、x2、y2)。 delete[] word; []単語を削除します。 } while (ri- Next(level)); while(ri- Next(level)); } } ` | ` It is also possible to use other iterator levels (block, line, word, etc.), see PageiteratorLevel. 他のイテレータレベル(ブロック、行、単語など)を使用することもできます。PageiteratorLevelを参照してください。 #L219) # Orientation and script detection (OSD) example #オリエンテーションと文字検出(OSD)の例 `c++ | `c ++ const char* inputfile = "/usr/src/tesseract/testing/eurotext.tif"; const char * inputfile = "/usr/src/tesseract/testing/eurotext.tif"; tesseract Orientation orientation; tesseract オリエンテーション tesseract WritingDirection direction; tesseract WritingDirectionの方向。 tesseract TextlineOrder order; tesseract TextlineOrderの順序 float deskew_angle; float deskew_angle; PIX *image = pixRead(inputfile); PIX * image = pixRead(入力ファイル); tesseract TessBaseAPI *api = new tesseract TessBaseAPI(); tesseract TessBaseAPI * api = new tesseract TessBaseAPI(); api- Init("/usr/src/tesseract/", "eng"); api- Init( "/ usr / src / tesseract /"、 "eng"); api- SetPageSegMode(tesseract PSM_AUTO_OSD); SetPageSegMode(tesseract PSM_AUTO_OSD); api- SetImage(image); api- SetImage(image); api- Recognize(0); api- 認識(0); tesseract PageIterator* it = api- AnalyseLayout(); tesseract PageIterator * it = api- AnalyseLayout(); it- Orientation( orientation, direction, order, deskew_angle); it- Orientation(&orientation、&direction、&order、&deskew_angle); printf("Orientation %d;\nWritingDirection %d\nTextlineOrder %d\n" \ printf( "印刷の向き %d; \ n書き込み方向 %d \ nテキスト行の順序 %d \ n" \ "Deskew angle %.4f\n", "傾き角 %.4f \ n"、 orientation, direction, order, deskew_angle); 方向、方向、順序、deskew_angle); ` | ` Explanation for result codes are in publictypes.h 結果コードの説明は[publictypes.h]にあります(https //github.com/tesseract-ocr/tesseract/blob/master/src/ccstruct/publictypes.h#L120) # Example of iterator over the classifier choices for a single symbol #単一のシンボルに対する分類子の選択に対する反復子の例 `c++ | `c ++ Pix *image = pixRead("/usr/src/tesseract/testing/phototest.tif"); Pix * image = pixRead( "/ usr / src / tesseract / testing / phototest.tif"); tesseract TessBaseAPI *api = new tesseract TessBaseAPI(); tesseract TessBaseAPI * api = new tesseract TessBaseAPI(); api- Init(NULL, "eng"); api- Init(NULL、 "eng"); api- SetImage(image); api- SetImage(image); api- SetVariable("save_blob_choices", "T"); api- SetVariable( "save_blob_choices"、 "T"); api- SetRectangle(37, 228, 548, 31); api- SetRectangle(37、228、548、31); api- Recognize(NULL); 認識(NULL); tesseract ResultIterator* ri = api- GetIterator(); tesseract ResultIterator * ri = api- GetIterator(); tesseract PageIteratorLevel level = tesseract RIL_SYMBOL; tesseract PageIteratorLevel level = tesseract RIL_SYMBOL; if(ri != 0) { if(ri!= 0){ do { 行う { const char* symbol = ri- GetUTF8Text(level); const char * symbol = ri- GetUTF8Text(level); float conf = ri- Confidence(level); float conf = ri- 信頼度(レベル)。 if(symbol != 0) { if(symbol!= 0){ printf("symbol %s, conf %f", symbol, conf); printf( "シンボル%s、conf %f"、シンボル、conf); bool indent = false; bool indent = false; tesseract ChoiceIterator ci(*ri); tesseract ChoiceIterator ci(* ri); do { 行う { if (indent) printf("\t\t "); printf( "\ t \ t");の場合(インデント) printf("\t- "); printf( "\ t-"); const char* choice = ci.GetUTF8Text(); const char * choice = ci.GetUTF8Text(); printf("%s conf %f\n", choice, ci.Confidence()); printf( "%s conf %f \ n"、選択、ci.Confidence()); indent = true; indent = true; } while(ci.Next()); while(ci.Next()); } } printf("---------------------------------------------\n"); printf( "--------------------------------------------- \ n "); delete[] symbol; []記号を削除します。 } while((ri- Next(level))); while((ri- Next(level))); } } ` | ` # Compiling C++ API programs on Linux #LinuxでC ++ APIプログラムをコンパイルする Including and linking to Tesseract s API is done in a standard Linux way. To compile a basic program against the API, you can use a command like this TesseractのAPIの組み込みとリンクは、標準のLinuxの方法で行われます。 APIに対して基本プログラムをコンパイルするには、次のようなコマンドを使用できます。 ` | ` g++ -o myprogram myprogram.cpp -llept -ltesseract g ++ -o myprogram myprogram.cpp -llept-ltesseract ` | ` If Tesseract is installed in an unusual place, you can specify the include and lib directories explicitly with g++ s -I and -L flags, like this Tesseractが異常な場所にインストールされている場合は、次のようにg ++の-Iおよび-Lフラグを使用してincludeおよびlibディレクトリを明示的に指定できます。 ` | ` g++ -o myprogram myprogram.cpp -I/home/nick/local/include/tesseract -L/home/nick/local/lib -llept -ltesseract g ++ -o myprogram myprogram.cpp -I / home / nick / local / include / tesseract -L / home / nick /ローカル/ lib -llept -ltesseract ` | ` # C-API in python #PythonのC-API Tesseract-ocr from version 3.02.02 provide C-API. This enable to use tesseract-ocr shared library in python (and other languages that can use C libraries) バージョン3.02.02からのTesseract-ocrはC-APIを提供します。これはpythonでtesseract-ocr共有ライブラリを使う(そしてC言語を使うことができる他の言語)を可能にします。ライブラリ) ```python python import os 輸入os import ctypes ctypeをインポート lang = "eng" lang = "eng" filename = "/usr/src/tesseract-ocr/phototest.tif" filename = "/usr/src/tesseract-ocr/phototest.tif" libname = "/usr/local/lib64/libtesseract.so.3" libname = "/usr/local/lib64/libtesseract.so.3" TESSDATA_PREFIX = os.environ.get( TESSDATA_PREFIX ) TESSDATA_PREFIX = os.environ.get( TESSDATA_PREFIX ) if not TESSDATA_PREFIX TESSDATA_PREFIXでない場合 TESSDATA_PREFIX = "../" TESSDATA_PREFIX = "../" tesseract = ctypes.cdll.LoadLibrary(libname) tesseract = ctypes.cdll.LoadLibrary(libname) tesseract.TessVersion.restype = ctypes.c_char_p tesseract.TessVersion.restype = ctypes.c_char_p tesseract_version = tesseract.TessVersion() tesseract_version = tesseract.TessVersion() api = tesseract.TessBaseAPICreate() api = tesseract.TessBaseAPICreate() rc = tesseract.TessBaseAPIInit3(api, TESSDATA_PREFIX, lang) rc = tesseract.TessBaseAPIInit3(api、TESSDATA_PREFIX、lang) if (rc) if(rc) tesseract.TessBaseAPIDelete(api) tesseract.TessBaseAPIDelete(api) print("Could not initialize tesseract.\n") print( "tesseractを初期化できませんでした。\ n") exit(3) 出口(3) text_out = tesseract.TessBaseAPIProcessPages(api, filename, None, 0) text_out = tesseract.TessBaseAPIProcessPages(api、filename、None、0) result_text = ctypes.string_at(text_out) result_text = ctypes.string_at(text_out) print Tesseract-ocr version , tesseract_version 「Tesseract-ocrバージョン」、tesseract_versionを印刷します。 print result_text result_textを印刷する ` | ` Example of passing python file object to C-API can be found at pastebin. PythonファイルオブジェクトをC-APIに渡す例はpastebinにあります。 Example of extracting orientation from Tesseract 4.0 Tesseract 4.0から方向を抽出する例 ```python python # /usr/bin/env python3 #/ usr / bin / env python3 # coding utf-8 #コーディング utf-8 PATH_TO_LIBTESS = /path/to/development/libtesseract.so PATH_TO_LIBTESS = /path/to/development/libtesseract.so import cffi # requires "pip install cffi" import cffi#には "pip install cffi"が必要です。 ffi = cffi.FFI() ffi = cffi.FFI() ffi.cdef(""" ffi.cdef( "" " struct Pix; Pixを構築します。 typedef struct Pix PIX; type PIX PIX PIXを構築します。 PIX pixRead ( const char filename ); PIX pixRead(const char filename); char * getLeptonicaVersion ( ); char * getLeptonicaVersion(); typedef struct TessBaseAPI TessBaseAPI; typedef struct TessBaseAPI TessBaseAPI; typedef int BOOL; typedef int BOOL; const char* TessVersion(); const char * TessVersion(); TessBaseAPI* TessBaseAPICreate(); TessBaseAPI * TessBaseAPICreate(); int TessBaseAPIInit3(TessBaseAPI handle, const char datapath, const char* language); int TessBaseAPIInit3(TessBaseAPI ハンドル、const char データパス、const char *言語); void TessBaseAPISetImage2(TessBaseAPI handle, struct Pix pix); void TessBaseAPISetImage2(TessBaseAPI ハンドル、Pix pix構造体); BOOL TessBaseAPIDetectOrientationScript(TessBaseAPI* handle, char** best_script_name, BOOL TessBaseAPIDetectOrientationScript(TessBaseAPI *ハンドル、char ** best_script_name、 int best_orientation_deg, float script_confidence, int best_orientation_deg、float script_confidence、 float* orientation_confidence); float * orientation_confidence); """) "" ") libtess = ffi.dlopen(PATH_TO_LIBTESS) libtess = ffi.dlopen(PATH_TO_LIBTESS) from ctypes.util import find_library ctypes.util import find_libraryから liblept = ffi.dlopen(find_library( lept )) liblept = ffi.dlopen(find_library( lept )) ffi.string(libtess.TessVersion()) ffi.string(libtess.TessVersion()) ffi.string(liblept.getLeptonicaVersion()) ffi.string(liblept.getLeptonicaVersion()) api = libtess.TessBaseAPICreate() api = libtess.TessBaseAPICreate() libtess.TessBaseAPIInit3(api, ffi.NULL, ffi.NULL) libtess.TessBaseAPIInit3(api、ffi.NULL、ffi.NULL) pix = liblept.pixRead( mono.png .encode()) pix = liblept.pixRead( mono.png .encode()) libtess.TessBaseAPISetImage2(api, pix) libtess.TessBaseAPISetImage2(api、pix) script_name = ffi.new( char ** ) script_name = ffi.new( char ** ) orient_deg = ffi.new( int * ) orient_deg = ffi.new( int * ) script_conf = ffi.new( float * ) script_conf = ffi.new( float * ) orient_conf = ffi.new( float * ) orient_conf = ffi.new( float * ) libtess.TessBaseAPIDetectOrientationScript(api, script_name, orient_deg, script_conf, orient_conf) libtess.TessBaseAPIDetectOrientationScript(api、script_name、orient_deg、script_conf、orient_conf) print(ffi.string(script_name).decode( utf-8 )) print(ffi.string(script_name).decode( utf-8 )) print(orient_deg[0]) print(orient_deg [0]) print(script_conf[0]) print(script_conf [0]) print(orient_conf[0]) print(orient_conf [0]) ` | ` # Example using the C-API in a C program #CプログラムでC-APIを使用する例 The C-API can of course also be used by regular C programs, as in this very basic example. この非常に基本的な例のように、C-APIは通常のCプログラムでももちろん使用できます。 `c | `c #include #include #include #include #include #include void die(const char *errstr) { void die(const char * errstr){ fputs(errstr, stderr); exit(1); } } int main(int argc, char *argv[]) { int main(int argc、char * argv []){ TessBaseAPI *handle; PIX *img; char *text; if((img = pixRead("img.png")) == NULL) handle = TessBaseAPICreate(); if(TessBaseAPIInit3(handle, NULL, "eng") != 0) TessBaseAPISetImage2(handle, img); if(TessBaseAPIRecognize(handle, NULL) != 0) if((text = TessBaseAPIGetUTF8Text(handle)) == NULL) fputs(text, stdout); TessDeleteText(text); TessBaseAPIEnd(handle); TessBaseAPIDelete(handle); pixDestroy( img); return 0; } } ` | ` On Linux you can compile it as you would build a program using the C++ API. Linuxでは[C ++ APIを使ってプログラムをビルドするのと同じようにコンパイルする]ことができます(#compiling-c-api-programs-linux)。 # Example creating searchable pdf from image in C++ #C ++で画像から検索可能なPDFを作成する例 `c++ | `c ++ #include leptonica/allheaders.h #include leptonica / allheaders.h #include tesseract/baseapi.h #include tesseract / baseapi.h #include tesseract/renderer.h #include tesseract / renderer.h int main() int main() { { const char* input_image = "/usr/src/tesseract-oc/testing/phototest.tif"; const char * input_image = "/usr/src/tesseract-oc/testing/phototest.tif"; const char* output_base = "my_first_tesseract_pdf"; const char * output_base = "my_first_tesseract_pdf"; const char* datapath = "/Projects/OCR/tesseract/tessdata"; const char * datapath = "/プロジェクト/ OCR / tesseract / tessdata"; int timeout_ms = 5000; int timeout_ms = 5000; const char* retry_config = nullptr; const char * retry_config = nullptr; bool textonly = false; bool textonly = false; int jpg_quality = 92; int jpg_quality = 92; tesseract TessBaseAPI *api = new tesseract TessBaseAPI(); tesseract TessBaseAPI * api = new tesseract TessBaseAPI(); if (api- Init(datapath, "eng")) { if(api- Init(datapath、 "eng")){ fprintf(stderr, "Could not initialize tesseract.\n"); fprintf(stderr、 "tesseractを初期化できませんでした。\ n"); exit(1); 出口(1); } } tesseract TessPDFRenderer *renderer = new tesseract TessPDFRenderer( tesseract TessPDFRenderer * renderer = new tesseract TessPDFRenderer( output_base, api- GetDatapath(), textonly, jpg_quality); output_base、api- GetDatapath()、textonly、jpg_quality); bool succeed = api- ProcessPages(input_image, retry_config, timeout_ms, renderer); bool succeed = api- ProcessPages(input_image、retry_config、timeout_ms、renderer); if (!succeed) { if(!成功){ fprintf(stderr, "Error during processing.\n"); fprintf(stderr、 "処理中にエラーが発生しました。\ n"); return EXIT_FAILURE; EXIT_FAILUREを返します。 } } api- End(); api- End(); return EXIT_SUCCESS; EXIT_SUCCESSを返します。 } } ` | ` # Example of monitoring OCR progress in C++ #C ++でOCRの進捗を監視する例 `c++ | `c ++ #include tesseract/baseapi.h #include tesseract / baseapi.h #include tesseract/ocrclass.h #include tesseract / ocrclass.h #include leptonica/allheaders.h #include leptonica / allheaders.h #include #include スレッド void monitorProgress(ETEXT_DESC *monitor, int page); void monitorProgress(ETEXT_DESC * monitor、int page); void ocrProcess(tesseract TessBaseAPI api, ETEXT_DESC monitor); void ocrProcess(tesseract TessBaseAPI api、ETEXT_DESC monitor); void monitorProgress(ETEXT_DESC *monitor, int page) { void monitorProgress(ETEXT_DESC *モニタ、intページ){ while (1) { while(1){ printf( "\r%3d%%", monitor[page].progress); printf( "\ r%3d %%"、モニター[ページ] .progress); fflush (stdout); fflush(標準出力)。 if (monitor[page].progress==100) if(monitor [page] .progress == 100) break; ブレーク; } } } } void ocrProcess(tesseract TessBaseAPI api, ETEXT_DESC monitor) { void ocrProcess(tesseract TessBaseAPI api、ETEXT_DESC monitor){ api- Recognize(monitor); 認識 - 監視(監視) } } int main() { int main(){ tesseract TessBaseAPI *api = new tesseract TessBaseAPI(); tesseract TessBaseAPI * api = new tesseract TessBaseAPI(); ETEXT_DESC *monitor = new ETEXT_DESC(); ETEXT_DESC * monitor = new ETEXT_DESC(); if (api- Init("/tesseract/tessdata_best", "eng")) { if(api- Init( "/ tesseract / tessdata_best"、 "eng")){ fprintf(stderr, "Could not initialize tesseract.\n"); fprintf(stderr、 "tesseractを初期化できませんでした。\ n"); return 1; 1を返します。 } } api- SetPageSegMode(tesseract PSM_AUTO); SetPageSegMode(tesseract PSM_AUTO); Pix *image = pixRead("/tesseract-ocr/test/testing/phototest.tif"); Pix * image = pixRead( "/ tesseract-ocr / test / testing / phototest.tif"); if (!image) { if(!image){ fprintf(stderr, "Leptonica can t process input file!\n"); fprintf(stderr、 "Leptonicaは入力ファイルを処理できません!\ n"); return 2; 2を返します。 } } api- SetImage(image); api- SetImage(image); int page = 0; int page = 0; std thread t1(ocrProcess, api, monitor); std thread t1(ocrProcess、api、monitor); std thread t2(monitorProgress, monitor, page); std thread t2(monitorProgress、monitor、page); t1.join(); t1.join(); t2.join(); t2.join(); pixDestroy( image); pixDestroy(&image); char *outText = api- GetUTF8Text(); char * outText = api- GetUTF8Text(); printf("\n%s", outText); printf( "\ n%s"、outText); if (outText) if(outText) delete [] outText; delete [] outText; api- End(); api- End(); return 0; 0を返します。 } } ` | ` More complex example (e.g. cancelling OCR process) can be found in source code of TesseractGui, gimagereader or android textfairy app. より複雑な例(OCRプロセスのキャンセルなど)は、TesseractGuiのソースコードにあります。[gimagereader](https // fossies) .org / linux / gimagereader / qt / src / Recognizer.cc)またはandroid textfairy app。
https://w.atwiki.jp/techsure/pages/36.html
このページはhttp //www.vgleaks.com/durango-memory-system-example/からの引用です Durango Memory System Example This whole system example demonstrates what the memory bandwidth might look like when thewhole systemis working under a typical load (this numbers are only predictions not measured numbers) This example assumes what’s expected to be a typical CPU load and a maximum GPU load Three display planes are enabled at 1080p resolution. Display write-back is writing a 1080p image at 60 FPS. Moveenginesare idle. Read bandwidth of the command buffer and index buffer is 4 GB/s. Regular GPU rendering consumes the rest of the available bandwidth. This diagram shows our prediction of the typical bandwidth for the north bridge clients and the typical available bandwidth for the GPU clients (which are shown in blue). Let’s start by describing the CPU. Although each CPU module can request up to 20.8 GB/s of bandwidth for read and for write, the typical bandwidth you should expect for the CPU is 4 GB/s per CPU module per direction—about 16 GB/s altogether. You can expect typical bandwidth to be around 3 GB/s per direction for the audio, HDD, Camera, and USBs. The Kinect Sensor is the main consumer of the bandwidth. For example, peak bandwidth to and from the HDD is only about 50 MB/s, so the HDD cannot be seen as a major bandwidth consumer. Because the GPU is usually pushed to the maximum, you can expect typical coherent bandwidth to be about 25 GB/s. However, this amount depends on how many resources are made snoopable. Currently, we are not able tell exactly how much of that access will be hitting the CPU’s caches and how much of the access much will go to DRAM. So as we said above, this figure is highly speculative at the moment. The estimated 25 GB/s of bandwidth for coherent memory access does not account for the non-coherent memory access of the GPU. The coherent bandwidth that can flow through the north bridge is a limited at 30 GB/s. Under typical conditions, this limit shouldn’t cause you problems. But during a high load on the coherent memory traffic, the north bridge might become saturated. Once the north bridge becomes saturated, you may notice increased latencies for memory access. CPU memory access that is Write Combined does not fall under this limitation nor does GPU memory access that is non-coherent. Finally let’s compute how much bandwidth is left for the non-coherent GPU access to consume. Let’s assume that The sum of bandwidth from the north bridge to DRAM is 25 GB/s. Some portion of the GPU coherent bandwidth misses the L2 caches. Non-coherent CPU bandwidth is 3 GB/s. This leaves 42 GB/s of DRAM bandwidth available to the GPU clients.
https://w.atwiki.jp/aias-jsdoctoolkit/pages/28.html
トップページ ドックコメントの書き方 タグリファレンス @example @exampleタグには、コンストラクタ、関数(またはメソッド)、変数の使い方を解説する小さなコードを記述できます。 http //code.google.com/p/jsdoc-toolkit/wiki/TagExample 構文 @example snippet snippet -- 必須:使用法を解説するごく小さいコード @exampleタグは複数記述できます。 例 /** * @example * var bleeper = makeBleep(3); * bleeper.flop(); */ 注意 @exampleタグではサンプルコードを説明文中へ「インライン」に挿入することは想定されていません。その場合は(例えば code タグなどの)HTMLタグを使用する必要があります。
https://w.atwiki.jp/thecockrockshockpop/pages/1567.html
member 吉川晃司 vocal 布袋寅泰 guitar CD DVDLive @ Tokyo Dome, Tokyo July 30th 2011 sat CD DVD Live @ Tokyo Dome, Tokyo July 30th 2011 sat S.E. "Die Walkure" ~ The Ride Of The Walkure ( ワルキューレの騎行 ) 1. Be My Baby 2. Pretty Doll 3. Crash Complexion 4. No More Lies 5. 路地裏の Venus 6. Love Charade 7. 2人の Another Twilight 8. Modern Vision 9. そんな君は欲しくない 10. Blue 11. Can t Stop The Silence 12. Cry For Love 13. Dragon Crime ( East West ) 14. Romantica 15. Propaganda 16. Imagine Heroes 17. Good Savage 18. 恋をとめないで 19. Majestic Baby encore 1 20. 1990 21. Rambling Man encore 2 22. After The Rain ( 朱い China )
https://w.atwiki.jp/houdini16doc/pages/12.html
examples