Как улучшить распознавание почерка на изображении [закрыто] ⇐ Javascript
-
Anonymous
Как улучшить распознавание почерка на изображении [закрыто]
Я пытаюсь разработать систему для чтения почерка на графике на письменной странице, используя мультимодальный LLM. Я использую сценарий Google Apps до сих пор экспериментировал: < /p>
function openRouterApiRequest() {
var apiKey = "****";
var imageUrl = "https://www.dropbox.com/scl/fi/xxeyyiqs ... 3k3j&raw=1";
var apiEndpoint = 'https://openrouter.ai/api/v1/chat/completions';
var payload = {
"model": "meta-llama/llama-4-maverick",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
// "text": "can you reproduce the chart in the middle of the image?"
"text": " In the role of an OCR program can you convert the entire page from text and handwriting into text? Please note that in the chart in the middle of page, the 4th column has options of : S or M or C only. Also the only options for the 5th Column are 'up pointing arrow', 'down pointing arrow' or '='. The 6th column has only Y or N as options"
},
{
"type": "image_url",
"image_url": {
"url": imageUrl
}
}
]
}
]
};
var options = {
'method': 'post',
'headers': {
'Authorization': 'Bearer ' + apiKey,
'Content-Type': 'application/json'
},
'payload': JSON.stringify(payload),
'muteHttpExceptions': true // To get the response even if the request fails
};
var response = UrlFetchApp.fetch(apiEndpoint, options);
var responseCode = response.getResponseCode();
var responseBody = response.getContentText();
// Handle the response as needed
Logger.log('Response Code: ' + responseCode);
Logger.log('Response Body: ' + responseBody);
// You might want to parse the responseBody if it's JSON
try {
var jsonResponse = JSON.parse(responseBody);
Logger.log(jsonResponse);
} catch (e) {
Logger.log('Failed to parse response as JSON: ' + e.message);
}
}
< /code>
Только около половины ячеек точно обнаружены в моей текущей настройке. Мне интересно предварительно обработать изображения, чтобы улучшить контраст почерка. Я пытался вручную увеличить контраст с https://onlinepngtools.com/change-png-taination и сохранение изображения. Однако после этого я не вижу значительного улучшения в распознавании персонажей. Как я могу улучшить контраст дальнейшего использования библиотеки обработки изображений для улучшения распознавания?
Подробнее здесь: https://stackoverflow.com/questions/795 ... n-an-image
Я пытаюсь разработать систему для чтения почерка на графике на письменной странице, используя мультимодальный LLM. Я использую сценарий Google Apps до сих пор экспериментировал: < /p>
function openRouterApiRequest() {
var apiKey = "****";
var imageUrl = "https://www.dropbox.com/scl/fi/xxeyyiqs ... 3k3j&raw=1";
var apiEndpoint = 'https://openrouter.ai/api/v1/chat/completions';
var payload = {
"model": "meta-llama/llama-4-maverick",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
// "text": "can you reproduce the chart in the middle of the image?"
"text": " In the role of an OCR program can you convert the entire page from text and handwriting into text? Please note that in the chart in the middle of page, the 4th column has options of : S or M or C only. Also the only options for the 5th Column are 'up pointing arrow', 'down pointing arrow' or '='. The 6th column has only Y or N as options"
},
{
"type": "image_url",
"image_url": {
"url": imageUrl
}
}
]
}
]
};
var options = {
'method': 'post',
'headers': {
'Authorization': 'Bearer ' + apiKey,
'Content-Type': 'application/json'
},
'payload': JSON.stringify(payload),
'muteHttpExceptions': true // To get the response even if the request fails
};
var response = UrlFetchApp.fetch(apiEndpoint, options);
var responseCode = response.getResponseCode();
var responseBody = response.getContentText();
// Handle the response as needed
Logger.log('Response Code: ' + responseCode);
Logger.log('Response Body: ' + responseBody);
// You might want to parse the responseBody if it's JSON
try {
var jsonResponse = JSON.parse(responseBody);
Logger.log(jsonResponse);
} catch (e) {
Logger.log('Failed to parse response as JSON: ' + e.message);
}
}
< /code>
Только около половины ячеек точно обнаружены в моей текущей настройке. Мне интересно предварительно обработать изображения, чтобы улучшить контраст почерка. Я пытался вручную увеличить контраст с https://onlinepngtools.com/change-png-taination и сохранение изображения. Однако после этого я не вижу значительного улучшения в распознавании персонажей. Как я могу улучшить контраст дальнейшего использования библиотеки обработки изображений для улучшения распознавания?
Подробнее здесь: https://stackoverflow.com/questions/795 ... n-an-image
Мобильная версия