أجزاء 1-3 وصف الفوضى المقيدة كنموذج تجريدي. هذه المقالة تطبق هذه الأنماط على خط تحليل الصور العملي الذي يوضح مبادئ العمل
ملاحظة: مازالت تضبط النظام. لكن هناكM SK2 الآن نسخة مكتبية كما هو الحال مع CLI . يعمل بشكل جيد جداً ولكن بعض الحواف لتسهيل
هذا المقال يخدم أهداف متعددة. Navigate to what interests you:

ImageSummarizer هو أنابيب استهلاك RAG للصور التي تستخرج بيانات ميتادات مبنية , نص , تعليقات | , و إشارات بصرية باستخدام الهندسة المعمارية على أساس wave-. يتصاعد النظام من التحليل المحلي السريع (Florence-2 ONNXM SK3 إلى أجهزة الرؤية LLMs فقط عند الحاجة
المبادئ الرئيسية:
ImageSummarizer يوضح أن الـ LLM المتعددة يمكن استخدامها دون تنازل عن التفاضل والتكامل الاحتمال يقترح , الإثبات يبقى.
قواعد التصميم
- النماذج لا تستهلك أي نماذج أخرى
- اللغة الطبيعية لا تكون أبداً حالة
- التسارع هو عتبة محددة
- كل مخرج يحمل الثقة provenance +
تُستخرج أنابيب البيانات المجازية الهيكلية من الصور لأنظمة RAG. given any image or animated GIFM SK1 it produces:
الكلمة الرئيسية هي مبنية. كل مخرج لديه نقاط الثقة, إفتراض المصدرM SK2 ومؤشرات الأدلة . لا يوجد أي نموذج هو المصدر الوحيد للحقيقة
الغوص العميق: أنابيب الـOCR معقدة بما فيه الكفاية لتوجب أن تصنع مقالاً خاصاً أجزاء 4.1: ثلاثية - تير أنابيب الـ OCR للقسمة التقنية الكاملة بما في ذلك East, CRAFT , RealM SK2ESRGAN, CLIPMSC4 و تحسين مسار الأفلامMNK5
يستعمل النظام استراتيجية تدرج ثلاثية - في استخراج النص :
| الطبقة | الطريقة | السرعة | التكلفة | الأفضل | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | تيسيراكت | ~50ms | مجانا | نظيفة, مرتفعةM SK5كتابة متباينة M | |||||||
| 2 | فلورانس-2 أونكس | ||||||||||
| 3 | Vision LLM | ~1-5s | $0.001-0.01 | مركبة | / | نص مشحوم |
إكتشاف نص أونكس (الشرق, CRAFT, ~20-30ms) يحدد المسار الأمثلM SK3
النتيجة: ~1.16GB من نماذج الـONNX المحلية التي تتعامل مع 85%+ الصور بدون تكلفة API.

$ imagesummarizer demo-images/cat_wag.gif --pipeline caption --output text
Caption: A cat is sitting on a white couch.
Scene: indoor
Motion: MODERATE object_motion motion (partial coverage)
جملات الحركة تصدر فقط عندما تدعمها قياسات التدفق الضوئي و دلالات الإطار ; وإلا فإن النظام يرجع إلى وصفات محايدة ("حركة دقيقة | ", | |" | حركة الكاميرا |

$ imagesummarizer demo-images/anchorman-not-even-mad.gif --pipeline caption --output text
"I'm not even mad."
"That's amazing."
Caption: A person wearing grey turtleneck sweater with neutral expression
Scene: meme
Motion: SUBTLE general motion (localized coverage)
عنوان فرعي-إدراك تقليل الإطارات يكشف عن تغيرات النص في الأسفل 25% من الإطاراتM SK2 تزن ភីكسات اللامعة ( بيضاءMSC4 نص أصفرMNK5 أكثر قوةMRK6
بالنسبة للGIF المتحركة مع الأشرطة , الأداة تخلق شرائح الإطار الأفقية لتحليل "Vision LLM"
النص-فقط شريحة (
الطريقة الأكثر فعالية تستخرج فقط أ Boxes متنية , تقلل بشكل كبير تكاليف الرموز :

$ imagesummarizer export-strip demo-images/anchorman-not-even-mad.gif --mode text-only
Detecting subtitle regions (bottom 30%)...
Found 2 unique text segments
Saved text-only strip to: anchorman-not-even-mad_textonly_strip.png
Dimensions: 253×105 (83% token reduction)
| المقاربة | الأبعاد | الرموز | التكلفة S |
|---|---|---|---|
| الإطارات الكاملة (10) | 3000×185 | ||
| شريط التصوير بالرنين المغناطيسي (2 إطارات) | |||
| النص-شريحة واحدة فقط | 253×105 | ~50 | الأسفل |
كيف تعمل: يكشف OpenCV مناطق عنوان فرعي ( الجزء السفلي | 30%), مُحدّد من البكسلات اللامعة |( أبيض ٬ / نص أصفر ٬), يستخرج خانات المزج الصّغيرة ,, ٬ ويقوم بتقليد النسخ بناء على تغييرات النص .. .
إدارة الـ OCR (تغييرات نصية فقط - | | 93 | إطارات تقلل إلى |

$ imagesummarizer export-strip demo-images/anchorman-not-even-mad.gif --mode ocr
Deduplicating 93 frames (OCR mode - text changes only)...
Reduced to 2 unique text frames
Saved ocr strip to: anchorman-not-even-mad_ocr_strip.png
Dimensions: 600x185 (2 frames)
إدارة الحركة (keyframes for motion inference):

$ imagesummarizer export-strip demo-images/cat_wag.gif --mode motion --max-frames 6
Extracting 6 keyframes from 9 frames (motion mode)...
Extracted 6 keyframes for motion inference
Saved motion strip to: cat_wag_motion_strip.png
Dimensions: 3000x280 (6 frames)
هذا يسمح لـ Vision LLMs بقراءة كل نص الأشرطة في مكالمة API واحدة.
هذا يضرب " فقط تصفيه مع نموذج الحد الأقصى " لنفس السبب أن اشعة X- تضرب القصةM SK3 النموذج لم يطلب أبداً ملء الفجواتMSC4 إنه يستقبل مسجل مغلقاًMNK5 الألوان المُقيّمة MNK6 الحركة المتتبعة MMK7 إطارات الأشرطة الخاطئة , الثقة في التصوير بالرنين المغناطيسيّّيّّّ - ويقوم فقط بعرض ما يحتوي عليه الأسطوانة بالفعلMRK10 عندما يقوم GPT بـ-4 أو تصفيق صورةٍ ــ, إنه ــ ' تخمينٍ ـــ. عندما تقوم ImageSummarizer بـ , هو ـــ ' تلخيص الإشارات التي موجودة بالفعل ٬.
النظام يستخدم أنابيب موجة - مبنية على حيث كل موجة تحليل مستقل ينتج إشارات مكتوبة تنفذ الموجات في ترتيب أولي (أصغر عدد يعمل أولاً), والأشجار الأخيرة يمكنها قراءة الإشارات من الأشجار السابقة.
توصيل تنفيذ: موجة 10 تمر قبل موجة
flowchart TB
subgraph Wave10["Wave 10: Foundational Signals"]
W1[IdentityWave - Format, dimensions]
W2[ColorWave - Palette, saturation]
end
subgraph Wave40["Wave 40: Text Detection"]
W9[TextLikelinessWave - OpenCV EAST/CRAFT]
end
subgraph Wave50["Wave 50: Traditional OCR"]
W3[OcrWave - Tesseract]
end
subgraph Wave51["Wave 51: ML OCR"]
W8[MlOcrWave - Florence-2 ONNX]
end
subgraph Wave55["Wave 55: ML Captioning"]
W10[Florence2Wave - Local captions]
end
subgraph Wave58["Wave 58: Quality Gate"]
W5[OcrQualityWave - Escalation decision]
end
subgraph Wave70["Wave 70: Embeddings"]
W7[ClipEmbeddingWave - Semantic vectors]
end
subgraph Wave80["Wave 80: Vision LLM"]
W6[VisionLlmWave - Cloud fallback]
end
Wave10 --> Wave40 --> Wave50 --> Wave51 --> Wave55 --> Wave58 --> Wave70 --> Wave80
style Wave10 stroke:#22c55e,stroke-width:2px
style Wave40 stroke:#06b6d4,stroke-width:2px
style Wave50 stroke:#f59e0b,stroke-width:2px
style Wave51 stroke:#8b5cf6,stroke-width:2px
style Wave55 stroke:#8b5cf6,stroke-width:2px
style Wave58 stroke:#ef4444,stroke-width:2px
style Wave70 stroke:#3b82f6,stroke-width:2px
style Wave80 stroke:#8b5cf6,stroke-width:2px
الترتيب الأولي (يجري الأسفل أولا): 10 | | → ♫ ♫ 40 \ ♫
هذا هو MoM مقيدة applied to image analysis: العديد من المقترحين ينشرون على أساس مشترك (the AnalysisContext), والخروج النهائي يجمع إشاراتهم
Note on wave ordering: الثلاث أُCR الطبقات (Tesseract/Florence-2/Vision LLMMSC3 هي مستويات التدرج المفاهيميM SK4 الموجات الفردية مثل Advanced OCR أو Quality Gate هي التحسينات داخل تلك الطبقات, لا توجد مستويات متفروعة من التدرج— تقوم بفحص الاستقرار الزمني و اختبارات الجودة , بالضبط
كل موجة تنتج إشارات باستخدام عقد قياسي:
public record Signal
{
public required string Key { get; init; } // "color.dominant", "ocr.quality.is_garbled"
public object? Value { get; init; } // The measured value
public double Confidence { get; init; } = 1.0; // 0.0-1.0 reliability score
public required string Source { get; init; } // "ColorWave", "VisionLlmWave"
public DateTime Timestamp { get; init; } // When produced
public List<string>? Tags { get; init; } // "visual", "ocr", "quality"
public Dictionary<string, object>? Metadata { get; init; } // Additional context
}
هذا هو الجزء 2 عقد الإشارات في العمل. الأمواج لا تتحدث مع بعضها البعض من خلال اللغة الطبيعية . إنهم ينشرون إشارات مكتوبة في السياق المشترك , والأمواج التي تتجه إلى الأسفل يمكن أن يسألوا تلك الإشارات
لاحظوا أن Confidence هو per-signalM SK1 ليس per -wave. موجة واحدة يمكنها أن ترسل إشارات متعددة مع قوة متباينة من الإبستيزيةMSC4ColorWave' قائمة الألوان المهيمنة لديها الثقة MST6 MST7 مبرمجةM ST8 لكن نسبة الألوان الفردية تستخدم الثقة كعامل وزن للخلاصة السلبيةM st9
الثقة هنا تعني قابلية للاستعمال في الأسفل, ليس يقيناً رياضياً
تحذير التفاضل والتكامل: "Deterministic" تعني عدم عشوائيية العينات والنتائج المستقرة لوقت التشغيل وال configuración المعطىM SK3 مُقدمي تنفيذ GPU ONNX يمكن أن يضعوا إختلافا رقمياً صغيراًMSC4 وهو مقبول لقرارات التوجيهMNK5 عقد الإشارات | | ( | مُحدرات |, | منطق التسارع |
من أجل تجنب التشويش, هنا' هو إسم إشارات الـ OCR القياسية المستخدمة في جميع أنحاء النظام :
| مفاتيح الإشارة | المصدر | الوصف |
|---|---|---|
ocr.text |
Tesseract (Tier MSC2 MSC3 Raw single-frame OCR S | |
ocr.confidence |
Tesseract | نمره الثقة في Tesserac |
ocr.ml.text |
فلورانس-2 (Tier 2) ♫ | ML OCR واحدM SK5frame ♫ |
ocr.ml.multiframe_text |
فلورانس-2 (Tier 2) |MultiM SK5frame GIF OCR | |
ocr.ml.confidence |
فلورانسM SK1 | فلورنس-2 درجة الثقة |
ocr.quality.spell_check_score |
OcrQualityWave | |
ocr.quality.is_garbled |
OcrQualityWave | إشارة التصاعد البولينية |
ocr.vision.text |
VisionLlmWave (Tier 3) S | إستخلاص Vision LLM . |
caption.text |
VisionLlmWave |
الاختلاف المهم: ocr.vision.text هو استخراج النص (OCR), بينما caption.text هو وصف المشهد (captioning). يمكن أن تأتي كلاهما من نفس مكالمة الـ Vision LLM
أولوية اختيار النص النهائي (أعلى من أقل
ocr.vision.text (Vision LLM OCRocr.ml.multiframe_text (Florence-2 GIFM SK2ocr.ml.text (Florence-2singleM SK2frame )ocr.text (Tesseract)كل موجة تطبق واجهة بسيطة
public interface IAnalysisWave
{
string Name { get; }
int Priority { get; } // Lower number = runs earlier (10 before 50 before 80)
IReadOnlyList<string> Tags { get; }
Task<IEnumerable<Signal>> AnalyzeAsync(
string imagePath,
AnalysisContext context, // Shared substrate with earlier signals
CancellationToken ct);
}
الـ AnalysisContext هو الفضاء المشترك من الجزء 2. موجات يمكنها :
context.GetValue<bool>("ocr.quality.is_garbled")context.GetCached<Image<Rgba32>>("ocr.frames")يعمل ColorWave أولا (priority 10) ويقوم بحساب الحقائق التي تقيد كل شيء آخر:
public class ColorWave : IAnalysisWave
{
public string Name => "ColorWave";
public int Priority => 10; // Runs first (lowest priority number)
public IReadOnlyList<string> Tags => new[] { "visual", "color" };
public async Task<IEnumerable<Signal>> AnalyzeAsync(
string imagePath,
AnalysisContext context,
CancellationToken ct)
{
var signals = new List<Signal>();
using var image = await LoadImageAsync(imagePath, ct);
// Extract dominant colors (computed, not guessed)
var dominantColors = _colorAnalyzer.ExtractDominantColors(image);
signals.Add(new Signal
{
Key = "color.dominant_colors",
Value = dominantColors,
Confidence = 1.0, // Reproducible measurement
Source = Name,
Tags = new List<string> { "color" }
});
// Individual colors for easy access
for (int i = 0; i < Math.Min(5, dominantColors.Count); i++)
{
var color = dominantColors[i];
signals.Add(new Signal
{
Key = $"color.dominant_{i + 1}",
Value = color.Hex,
Confidence = color.Percentage / 100.0,
Source = Name,
Metadata = new Dictionary<string, object>
{
["name"] = color.Name,
["percentage"] = color.Percentage
}
});
}
// Cache the image for other waves (no need to reload)
context.SetCached("image", image.CloneAs<Rgba32>());
return signals;
}
}
ويستقبل الـ Vision LLM لاحقاً هذه الألوان القيود. لا يجب أن يدعي أن الصورة تحتوي على " أحمرات متوهجة " إذا قام ColorWave بحساب لونها المهيمنة هو الأزرق M SK3 وإذا كان كذلك MSC4 التناقض قابل للكشف ويمكن رفضه في الأسفل
هذا هو المكان الغموض المقيد تشعّم . OcrQualityWave هو المدرّس الذي يقرر ما إذا كان يجب أن يزداد إلى مكلفة الرؤية LLM:
public class OcrQualityWave : IAnalysisWave
{
public string Name => "OcrQualityWave";
public int Priority => 58; // Runs after OCR waves
public IReadOnlyList<string> Tags => new[] { "content", "ocr", "quality" };
public async Task<IEnumerable<Signal>> AnalyzeAsync(
string imagePath,
AnalysisContext context,
CancellationToken ct)
{
var signals = new List<Signal>();
// Get OCR text from earlier waves (canonical taxonomy)
string? ocrText =
context.GetValue<string>("ocr.ml.multiframe_text") ?? // Florence-2 GIF
context.GetValue<string>("ocr.ml.text") ?? // Florence-2 single
context.GetValue<string>("ocr.text"); // Tesseract
if (string.IsNullOrWhiteSpace(ocrText))
{
signals.Add(new Signal
{
Key = "ocr.quality.no_text",
Value = true,
Confidence = 1.0,
Source = Name
});
return signals;
}
// Tier 1: Spell check (deterministic, no LLM)
var spellResult = _spellChecker.CheckTextQuality(ocrText);
signals.Add(new Signal
{
Key = "ocr.quality.spell_check_score",
Value = spellResult.CorrectWordsRatio,
Confidence = 1.0,
Source = Name,
Metadata = new Dictionary<string, object>
{
["total_words"] = spellResult.TotalWords,
["correct_words"] = spellResult.CorrectWords
}
});
signals.Add(new Signal
{
Key = "ocr.quality.is_garbled",
Value = spellResult.IsGarbled, // < 50% correct words
Confidence = 1.0,
Source = Name
});
// This signal triggers Vision LLM escalation
if (spellResult.IsGarbled)
{
signals.Add(new Signal
{
Key = "ocr.quality.correction_needed",
Value = true,
Confidence = 1.0,
Source = Name,
Tags = new List<string> { "action_required" },
Metadata = new Dictionary<string, object>
{
["quality_score"] = spellResult.CorrectWordsRatio,
["correction_method"] = "llm_sentinel"
}
});
// Cache for Vision LLM to access
context.SetCached("ocr.garbled_text", ocrText);
}
return signals;
}
}
قرار التدرج هو إختباري: إذا كانت علامة الاختبار للغة < 50%, تبعث إشارة تثير الرؤية LLM. لا الحكم الإحتماليM SK4 لا M" ربما ينبغي علينا أن نسأل LLM

$ imagesummarizer demo-images/arse_biscuits.gif --pipeline caption --output text
OCR: "ARSE BISCUITS"
Caption: An elderly man dressed as bishop with text reading "arse biscuits"
Scene: meme
حصلت الـ OCR على النص ; Vision LLM provided scene context . Each wave contributes what it is good at
موجة الـ Vision LLM تعمل فقط عندما تشير الإشارات المسبقة إليها.
public class VisionLlmWave : IAnalysisWave
{
public string Name => "VisionLlmWave";
public int Priority => 50; // Runs after quality assessment
public IReadOnlyList<string> Tags => new[] { "content", "vision", "llm" };
public async Task<IEnumerable<Signal>> AnalyzeAsync(
string imagePath,
AnalysisContext context,
CancellationToken ct)
{
var signals = new List<Signal>();
if (!Config.EnableVisionLlm)
{
signals.Add(new Signal
{
Key = "vision.llm.disabled",
Value = true,
Confidence = 1.0,
Source = Name
});
return signals;
}
// Check if OCR was unreliable (garbled text)
var ocrGarbled = context.GetValue<bool>("ocr.quality.is_garbled");
var textLikeliness = context.GetValue<double>("content.text_likeliness");
var ocrConfidence = context.GetValue<double>("ocr.ml.confidence",
context.GetValue<double>("ocr.confidence"));
// Only escalate when: OCR failed OR (text likely but low OCR confidence)
// Models never decide paths; deterministic signals do (no autonomy)
bool shouldEscalate = ocrGarbled ||
(textLikeliness > 0.7 && ocrConfidence < 0.5);
if (shouldEscalate)
{
var llmText = await ExtractTextAsync(imagePath, ct);
if (!string.IsNullOrEmpty(llmText))
{
// Emit OCR signal (Vision LLM tier)
signals.Add(new Signal
{
Key = "ocr.vision.text", // Vision LLM OCR extraction
Value = llmText,
Confidence = 0.95, // High but not 1.0 - still probabilistic
Source = Name,
Tags = new List<string> { "ocr", "vision", "llm" },
Metadata = new Dictionary<string, object>
{
["ocr_was_garbled"] = ocrGarbled,
["escalation_reason"] = ocrGarbled ? "quality_gate_failed" : "low_confidence_high_likeliness",
["text_likeliness"] = textLikeliness,
["prior_ocr_confidence"] = ocrConfidence
}
});
// Optionally emit caption (separate signal)
var llmCaption = await GenerateCaptionAsync(imagePath, ct);
if (!string.IsNullOrEmpty(llmCaption))
{
signals.Add(new Signal
{
Key = "caption.text", // Descriptive caption (not OCR)
Value = llmCaption,
Confidence = 0.90,
Source = Name,
Tags = new List<string> { "caption", "description" }
});
}
}
}
return signals;
}
}
الفكرة الرئيسية: النص لـ Vision LLM لديه الثقة 0.95, ليس 1.0. إنها ' أفضل من الرسم البياني الممزق , لكنها ' مازالت محتملة . تجمعات السلكية تعرف هذا . . تملك قيمة هي't 1.0.)
الـ ImageLedger يجمع الإشارات إلى أجزاء مبنية من أجل استهلاك الأسفل سحب السياق applied to image analysis:
public class ImageLedger
{
public ImageIdentity Identity { get; set; } = new();
public ColorLedger Colors { get; set; } = new();
public TextLedger Text { get; set; } = new();
public MotionLedger? Motion { get; set; }
public QualityLedger Quality { get; set; } = new();
public VisionLedger Vision { get; set; } = new();
public static ImageLedger FromProfile(DynamicImageProfile profile)
{
var ledger = new ImageLedger();
// Text: Priority order - corrected > voting > temporal > raw
ledger.Text = new TextLedger
{
ExtractedText =
profile.GetValue<string>("ocr.final.corrected_text") ?? // Tier 2/3 corrections
profile.GetValue<string>("ocr.voting.consensus_text") ?? // Temporal voting
profile.GetValue<string>("ocr.full_text") ?? // Raw OCR
string.Empty,
Confidence = profile.GetValue<double>("ocr.voting.confidence"),
SpellCheckScore = profile.GetValue<double>("ocr.quality.spell_check_score"),
IsGarbled = profile.GetValue<bool>("ocr.quality.is_garbled")
};
// Colors: Computed facts, not guessed
ledger.Colors = new ColorLedger
{
DominantColors = profile.GetValue<List<DominantColor>>("color.dominant_colors") ?? new(),
IsGrayscale = profile.GetValue<bool>("color.is_grayscale"),
MeanSaturation = profile.GetValue<double>("color.mean_saturation")
};
return ledger;
}
public string ToLlmSummary()
{
var parts = new List<string>();
parts.Add($"Format: {Identity.Format}, {Identity.Width}x{Identity.Height}");
if (Colors.DominantColors.Count > 0)
{
var colorList = string.Join(", ",
Colors.DominantColors.Take(5).Select(c => $"{c.Name}({c.Percentage:F0}%)"));
parts.Add($"Colors: {colorList}");
}
if (!string.IsNullOrWhiteSpace(Text.ExtractedText))
{
var preview = Text.ExtractedText.Length > 100
? Text.ExtractedText[..100] + "..."
: Text.ExtractedText;
parts.Add($"Text (OCR, {Text.Confidence:F0}% confident): \"{preview}\"");
}
return string.Join("\n", parts);
}
}
المسجل هو القنابل في مصطلحات CFCD. إنها تنقل ما تبقى من الانتقاء, وsynthesis LLM يجب أن يحترم هذه الحقائق
لقد رأيتم منطق التدرج في مكانين OcrQualityWave يصدر الإشارات عن الجودة; EscalationService يطبق السياسة عبر تلك الإشارات.
EscalationService يجمع الإشارات ويطبق المراحل العالميةالـ EscalationService يربط كل ذلك معا. إنه ينفذ الجزء 1 النمط substrate → proposer → constrainer:
public class EscalationService
{
private bool ShouldAutoEscalate(ImageProfile profile)
{
// Escalate if type detection confidence is low
if (profile.TypeConfidence < _config.ConfidenceThreshold)
return true;
// Escalate if image is blurry
if (profile.LaplacianVariance < _config.BlurThreshold)
return true;
// Escalate if high text content
if (profile.TextLikeliness >= _config.TextLikelinessThreshold)
return true;
// Escalate for complex diagrams or charts
if (profile.DetectedType is ImageType.Diagram or ImageType.Chart)
return true;
return false;
}
}
كل قرار تصاعدي هو إختباري: نفس المدخلات, نفس السقوطM SK2 نفس القرار . لا حكم LLM في منطق التسارع
عندما يعمل الـ Vision LLM ــ , ــ يستقبل الحقائق المحسوبية كقيود ــ:
private static string BuildVisionPrompt(ImageProfile profile)
{
var prompt = new StringBuilder();
prompt.AppendLine("CRITICAL CONSTRAINTS:");
prompt.AppendLine("- Only describe what is visually present in the image");
prompt.AppendLine("- Only reference metadata values provided below");
prompt.AppendLine("- Do NOT infer, assume, or guess information not visible");
prompt.AppendLine();
prompt.AppendLine("METADATA SIGNALS (computed from image analysis):");
if (profile.DominantColors?.Any() == true)
{
prompt.Append("Dominant Colors: ");
var colorDescriptions = profile.DominantColors
.Take(3)
.Select(c => $"{c.Name} ({c.Percentage:F0}%)");
prompt.AppendLine(string.Join(", ", colorDescriptions));
if (profile.IsMostlyGrayscale)
prompt.AppendLine(" → Image is mostly grayscale");
}
prompt.AppendLine($"Sharpness: {profile.LaplacianVariance:F0} (Laplacian variance)");
if (profile.LaplacianVariance < 100)
prompt.AppendLine(" → Image is blurry or soft-focused");
prompt.AppendLine($"Detected Type: {profile.DetectedType} (confidence: {profile.TypeConfidence:P0})");
prompt.AppendLine();
prompt.AppendLine("Use these metadata signals to guide your description.");
prompt.AppendLine("Your description should be grounded in observable facts only.");
return prompt.ToString();
}
لا يجب أن يدعي الـ Vision LLM "اللونات المتحركة" إذا قمنا بحساب القياس الرماديM SK2 إذا كان ذلك صحيحاً,التعارض قابل للإكتشاف . لا ينبغي أن يزعم الـ "تفاصيل حادةMSC6 اذا قمنا بالحساب للتردد المنخفض لـ Laplacian القشرة الإفتراضية تقيد الناتج الإحتمالي.
هذه القيود تقلل الهلوسة ولكن لا يمكن القضاء عليها
عند استخراج النص النهائي, يستخدم النظام ترتيب أولويات صارع:
static string? GetExtractedText(DynamicImageProfile profile)
{
// Priority chain using canonical signal names (see OCR Signal Taxonomy above)
// 1. Vision LLM OCR (best for complex/garbled)
// 2. Florence-2 multi-frame GIF (temporal stability)
// 3. Florence-2 single-frame (stylized fonts)
// 4. Tesseract (baseline)
var visionText = profile.GetValue<string>("ocr.vision.text");
if (!string.IsNullOrEmpty(visionText))
ocally (confidence 0.85-0.90, no cost)
- **Tesseract voting**: Reliable for clean text (confidence varies, deterministic)
- **Raw Tesseract**: Baseline fallback (confidence < 0.7 for stylized fonts)
The priority order encodes this knowledge. Florence-2 sitting between Vision LLM and Tesseract provides a "sweet spot" for most images—better than traditional OCR, cheaper than cloud Vision LLMs.
Note: this function selects *one* source, but the ledger exposes *all* sources with their confidence scores. Downstream consumers can-and should-inspect provenance when the domain requires it. The priority order is a sensible default, not a straitjacket.
---
## Selection and Conflict Resolution
The priority chain above is the current implementation-a simple fallback. But the architecture supports adding rejection rules as config-driven policy. Here's the pattern for contradiction detection (not yet implemented, but the signals exist to support it):
```csharp
// Pattern: Contradiction detection as policy rules
public static class SelectionPolicy
{
public static string? SelectTextWithConstraints(DynamicImageProfile profile)
{
var visionText = profile.GetValue<string>("vision.llm.text");
if (!string.IsNullOrEmpty(visionText))
{
// Rule: Reject if Vision claims text but deterministic signals say no text
var textLikeliness = profile.GetValue<double>("content.text_likeliness");
if (textLikeliness < _config.TextLikelinessThreshold && visionText.Length > 50)
{
// Contradiction detected - log and fall through
profile.AddSignal(new Signal
{
Key = "selection.vision_rejected",
Value = "text_likeliness_contradiction",
Confidence = 1.0,
Source = "SelectionPolicy",
Metadata = new Dictionary<string, object>
{
["text_likeliness"] = textLikeliness,
["vision_text_length"] = visionText.Length,
["threshold"] = _config.TextLikelinessThreshold
}
});
// Fall through to OCR sources
}
else
{
return visionText;
}
}
// Continue with priority chain...
return profile.GetValue<string>("ocr.voting.consensus_text")
?? profile.GetValue<string>("ocr.full_text");
}
}
نفس النمط ينطبق على أنواع الإشارات الأخرى:
color.is_grayscale صحيحquality.sharpness حد <content.type هو رسم مع ثقة عاليةالخصائص الرئيسية لطبقة الانتقاء:
هذا هو المكان الذي يستمر فيه "التحديدية " يصبح صحيحا ميكانيكيا | . | LLM يقترح |; | قواعد التحديدistic تقرر ما إذا كان من المفترض قبول
أنابيب قابلة للتركيب بشكل كامل من خلال JSON, مما يجعل مكونات الموجات واضحة وقابلة للفحص:
{
"name": "advancedocr",
"displayName": "Advanced OCR (Default)",
"description": "Multi-frame temporal OCR with stabilization and voting",
"estimatedDurationSeconds": 2.5,
"accuracyImprovement": 25,
"phases": [
{
"id": "color",
"name": "Color Analysis",
"priority": 100,
"waveType": "ColorWave",
"enabled": true
},
{
"id": "simple-ocr",
"name": "Simple OCR",
"priority": 60,
"waveType": "OcrWave",
"earlyExitThreshold": 0.98
},
{
"id": "advanced-ocr",
"name": "Advanced Multi-Frame OCR",
"priority": 59,
"waveType": "AdvancedOcrWave",
"dependsOn": ["simple-ocr"],
"parameters": {
"maxFrames": 30,
"ssimThreshold": 0.95,
"enableVoting": true
}
},
{
"id": "quality",
"name": "OCR Quality Assessment",
"priority": 58,
"waveType": "OcrQualityWave",
"dependsOn": ["advanced-ocr"]
}
]
}
خطوات الخروج المبكرة تترك موجات مكلفة تتخطى عندما وصلت موجات رخيصة بالفعل إلى الثقة العالية.
الـ auto خط أنابيب ينفذ توجيهاً ذكياً على أساس خصائص الصورة, اختيار مسار المعالجة الأمثل:
Image Analysis (OpenCV ~5-20ms)
│
├── Is animated (>1 frame)?
│ └── ANIMATED route
│ ├── Has subtitle regions? → Text-only strip extraction
│ ├── Minimal text? → FAST (Florence-2 only)
│ └── Motion significant? → Motion analysis
│
├── Has text regions (OpenCV detection)?
│ ├── High contrast, clean text → FAST route (Florence-2, ~100ms)
│ ├── Moderate confidence → BALANCED route (Florence-2 + Tesseract, ~300ms)
│ └── Low confidence → QUALITY route (Multi-frame + Vision LLM, ~1-5s)
│
├── Is chart/diagram (type detection)?
│ └── QUALITY route → Vision LLM caption
│
└── Default → FAST route (Florence-2 caption)
| الطريق | يحدد متى | المعالجة | الوقت | التكلفة | |||||
|---|---|---|---|---|---|---|---|---|---|
| أسرع | نص بسيط, متباينة عاليةM SK3 шрифтات قياسية | فلورانس-2 فقط | ~100ms SMk8 منخفض ( محليMSк10 . | ||||||
| متوازن | نص عاديM SK2 ثقة متوسطة | فلورانس-2 M+ التصويت Tesseract | ~300ms | منخفض ( | محلي | ) | |||
| جودة | الرسوم البيانية, الرسم البيانيM SK3 Schriftات مصممة بأسلوبٍ مدهشMSC4 الثقة المنخفضة | Multi | - | frame | + | Vision LLM | |||
| مدمجة | GIFs مع الأشرطة الفرعية | النص | - | شريط فقط | МSK4 | الشريط التصويري |
$ imagesummarizer anchorman-not-even-mad.gif --pipeline auto --output visual
[Route selection...]
Image: 300×185, 93 frames
Text detection: 15 regions found (bottom 30%)
Subtitle pattern: DETECTED
→ Selected ANIMATED route (text-only filmstrip)
[Processing...]
MlOcrWave: Extracted 10 frames → 2 unique text segments
Text-only strip: 253×105 (83% token reduction)
VisionLlmWave: Processing filmstrip...
[Results - 2.3s total]
Text: "I'm not even mad." + "That's amazing."
Caption: A person wearing grey turtleneck sweater with neutral expression
Scene: meme
Motion: SUBTLE general motion
قرار التوجيه هو محدد ومسجل في الإشارات للaudit:
{
"routing": {
"selected_route": "ANIMATED",
"reason": "subtitle_pattern_detected",
"text_regions": 15,
"frames": 93,
"decision_time_ms": 18
}
}
# Use auto pipeline (smart routing - recommended)
imagesummarizer meme.gif --pipeline auto
# Fast local caption with Florence-2 ONNX (~200ms)
imagesummarizer photo.jpg --pipeline florence2
# Best quality: Florence-2 + Vision LLM
imagesummarizer complex-diagram.png --pipeline florence2+llm
# Extract text only (three-tier OCR)
imagesummarizer screenshot.png --pipeline advancedocr
# Motion analysis for GIFs
imagesummarizer animation.gif --pipeline motion
# Process a directory with visual output
imagesummarizer ./photos/ --output visual
أطلب فقط الإشارات التي تحتاجها باستخدام الجمعات المحددة
# Minimal metadata (fast)
imagesummarizer image.png --signals "@minimal"
# Alt text for accessibility
imagesummarizer image.png --signals "@alttext"
# Motion analysis
imagesummarizer animation.gif --signals "@motion"
# Full analysis
imagesummarizer image.png --signals "@full"
# Custom wildcard patterns
imagesummarizer image.png --signals "color.dominant*, ocr.text, motion.*"
| التجميع | الإشارات | موضوع الاستخدام | |||
|---|---|---|---|---|---|
@minimal |
هوية.*, جودة.sharpness | ||||
@alttext |
ចំណងជើង.كتابةM SK2ocr .كتملةMST4لونMSC5مسيطر* | سهولة الوصول | |||
@motion |
الحركة.*,هويةM SK1صورة_عدّة | تحليل الرسوم المتحركة | |||
@full |
جميع الإشارات | التحليل الكامل | |||
@tool |
مجموعة فرعية مُحسنة | MCP/automation |
$ imagesummarizer princess-bride.gif --output json
{
"image": "princess-bride.gif",
"duration_ms": 1838,
"waves_executed": ["ColorWave", "OcrWave", "AdvancedOcrWave", "VisionLlmWave"],
"text": {
"value": "You keep using that word.\nI do not think it means what you think it means.",
"source": "ocr.voting.consensus_text",
"confidence": 0.95
},
"escalation": {
"triggered": true,
"reason": "text_likeliness_above_threshold",
"threshold": 0.4,
"observed": 0.67
},
"signals": {
"color.dominant_1": { "value": "#1a1a2e", "confidence": 1.0 },
"ocr.quality.spell_check_score": { "value": 0.82, "confidence": 1.0 },
"ocr.quality.is_garbled": { "value": false, "confidence": 1.0 },
"motion.type": { "value": "static", "confidence": 0.95 }
}
}
كل حقل لديه أصل escalation عرضات بلاك لماذا كان اسم Vision LLM .

$ imagesummarizer demo-images/alanshrug_opt.gif --pipeline motion
Motion: SUBTLE general motion (localized coverage)
Direction: up-down
Magnitude: 0.23
$ imagesummarizer
ImageSummarizer Interactive Mode
Pipeline: advancedocr | Output: auto | LLM: auto
Commands: /help, /pipeline, /output, /llm, /model, /ollama, /models, /quit
Enter image path (or drag & drop): F:\Gifs\meme.gif
Processing...
I'm not even mad. That's amazing.
Enter image path: /llm true
Vision LLM: enabled
Enter image path: /model minicpm-v:8b
Vision model: minicpm-v:8b
للاكتشاف البصري, يقدم تطبيق डेस्कटॉप:
الواجهة البيانية للផ្ទៃតុ تبين المعمار بصريا— يمكنكم رؤية بالضبط أي أمواج تدور, ما هي الإشارات التي تصدرهاM SK2 وكيف تم اتخاذ قرارات التوجيهMSC3 ممتازة لفهم النظام أو إصلاح خطوط الأنابيب الخاصة
CLI يكشف عن كل التعقيد بعرض خيارات بسيطة. يمكنك تحويل خطوط الأنابيب, نماذجM SK2 ونماذج البث دون أن تفهم هيكلة الأمواج .
| جزء | نمط | تطبيق مركب التصوير S |
|---|---|---|
| 1 | الغموض المقيد | ColorWave يقوم بحساب الحقائق; VisionLlmWave يحترمها |
| 2 | MoM مقيدة | نشر موجات متعددة لتحليل السياق; نقاط ارتكاز الموجة |
| 3 | سحب السياق | ImageLedger يجمع الخصائص البارزة; نتائج مخازن قاعدة بيانات الإشارات |
نفس الأنماط. مجال مختلف. نفس القاعدةM SK2 الاحتمال يقترح , الإثبات يبقى.
هذا ليس الطريق السريع. إنه' الطريق الموثوق بهM SK2 يستحق ذلك إذا كنت بحاجة لفهم صورة قابلة للفحص على نطاق واسعMSC3 الخلط الفائق إذا كنت فقط تحتاج إلى تعليقات لعرض صور .
| حالت الفشل | ما الذي يحدث | كيف يتم التعامل معه ' | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GIF ضجيج | تذبذب الإطارات, آثار التدخين | الاستقرار المؤقت | + | تقليل SSIM | + | إجماع صوتي | МSK5 | نص | مSK6 | إستخراج شريط فقط | المSK7 | ||
| OCR يعيد النفايات | فشلت تيسيراكت في كتابة الخطوط المصممة | اللّعب | - detects check gate | < | МSK4 | correct | → | escalates to Florence | |||||
| تكاليف API عالية | الكثير من مكالمات الـ LLM للرؤية السحابية | فلورانس-2 يتعاملون مع ONNX | 80%+ | محليا | (~200 | ms | ), | نص | - | فقط الشرائح تخفيض الرموز | مSK7 | للGIF | المSK8 |
| هلوسات الرؤية | claims text that is not't there | Signals enable contradiction detection MSC3pattern shown aboveMSC4 downstream consumers can comparevision.llm.text ضد content.text_likeliness |
|||||||||||
| تغيرات الأنبوب مع مرور الوقت | أضف موجات جديدة , حد مُحدّد | المحتوى - تخزين الخشاش | + | ال provenance الكامل في كل إشارة | + | نسخ التتبع | |||||||
| النموذج لا يعيد شيئاً | وقفة لرؤية LLM أو رد فعل فارغ | سلسلة التراجع: رؤية LLM → فلورانسMSC4 S→ التصويت Tesseract |
كل حالت الفشل لديها استجابة إفتراضية. لا تحلل صامت.
السياق المهم: ImageSummarizer هو أنابيب الإمتصاص للصورة لنظام البيئة LucidRAG.
هذا المقال يركز على استخراج الإشارات الهيكلية من الصور. لكن القوة الحقيقية تظهر عندما تدمج مع المختصين الآخرين:
عندما يتم ربطها مع LucidRAG (سنأتي قريبا!), هذه الأنواع الثلاثة من الأنابيب تمكن الرسوم البيانية المتحركة RAG -:
Document → DocSummarizer → Structured signals
↓
Images → ImageSummarizer → Structured signals
↓
Data → DataSummarizer → Structured signals
↓
↓ (all signals)
↓
LucidRAG Graph Builder → Multi-modal knowledge graph
↓
Query → Multi-modal retrieval + constrained generation
لماذا هذا مهم: RAG التقليدي يتعامل مع الصور كفقاعات غامضة التي تحصل على عنوان أول مصادر إشارات من فئة - مع العلاقات المكتوبة للكتابة.
يقياس النمط : إذا كان بإمكانك إستخلاص إشارات مبنية من الصور (هذا المقال | ), | مستندات |(DocSummarizer), وبيانات (المزيج للبيانات), يمكنك بناء رسم بياني للمعرفة حيث كل عقد يحمل جذورا وكل حافة لديها نقاط ثقة
ستأتي قريبا: التكامل الكامل لـ LucidRAG يوضح كيف تتكون هذه الأنابيب إلى عدة graphs .
الهندسة المعمارية لها بنية : كل موجة مستقلة , كل إشارة مكتوبة | , كل التسارع هو محدد |. | فلورانس ♫ -2 | يوفر تحليلا محليا سريعا ♪ , | Vision LLM يتعامل مع الحالات المعقدة ♪
منذ نشر المقال الأول , لقد تطور النظام بشكل كبير "MSSK1"
أنابيب الـ OCR وحدها ــ — ــ بثلاثة أصعدة ــ- ــ متصاعدة ـــ , ــ متعددة ـــ- ــ صوت إطار ــ МSK4 ــ تحسين مسارات الفيلم ـ , ــ وكتابة النص ــتكامل التصوير بالرسوم المتقاطعة دليل لفصل التقنية الكاملة.
إذا كان بإمكانك فعل هذا بالنسبة للصور—أكثر أنواع الإدخال فوضوية, مع ضجيج التصوير بالرنين المغناطيسيM SK2 ألواح مصممة بأسلوبٍ مُصَلَّدMSC3 إطاراتٍ رسومٍ متحركة , و هلوساتٍ .- تعليقاتٍ مثيرةٍ ,— يمكنك فعل ذلك لأي جزءٍ إفتراضيّ
ذلك ' محدود الغموض في الواقع . ليس نمط تجريدي
| جزء | نمط | محور |
|---|---|---|
| 1 | الغموض المقيد | عنصر واحد |
| 2 | MoM مقيدة | أجزاء متعددة |
| 3 | سحب السياق | الوقت / الذاكرة |
| 4 | استخبارات الصورة (هذا المقال) | فن العمارة الموجية, نمط |
| 4.1 | أنابيب تير ثلاثية - | OCRM SK1 نماذج ONNX, شرائح الأفلام |
التالي: الجزء 5 سيظهر كيف ImageSummarizer DocSummarizer, و المزيج للبيانات compose into multi-modal graph RAG with LucidRAG.
كل الأجزاء تتبع نفس المتغير: مكونات الإحتمالية تقترح ; أن الأنظمة الثابتة تستمر.
© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.