Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Satini_pvduc
/
ocrpdf
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
tien_nemo
2025-08-14 10:17:47 +0700
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
08b68353adc11528deda8093eebdc1b0db3422c7
08b68353
1 parent
cc375b04
xong buoc 1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
app/Http/Controllers/OcrController.php
resources/views/ocr/index.blade.php
app/Http/Controllers/OcrController.php
View file @
08b6835
...
...
@@ -59,7 +59,7 @@ class OcrController extends Controller
{
try
{
// Lấy template name từ request hoặc mặc định
$templateName
=
$request
->
get
(
'template_name'
,
'
A
'
);
$templateName
=
$request
->
get
(
'template_name'
,
''
);
// Giả sử file OCR JSON & ảnh nằm trong storage/app/public/image/
$jsonPath
=
public_path
(
"image/data_picking_detail_1754967679.json"
);
...
...
@@ -110,6 +110,7 @@ class OcrController extends Controller
];
}
}
// dd($formData, $dataMapping);
return
response
()
->
json
([
'success'
=>
true
,
...
...
resources/views/ocr/index.blade.php
View file @
08b6835
...
...
@@ -802,8 +802,10 @@
// Tìm tất cả các box OCR nằm trong vùng manual
this
.
ocrData
.
forEach
(
item
=>
{
if
(
!
item
.
isManual
&&
this
.
isBoxInside
(
item
.
bbox
,
newBbox
)
&&
item
.
text
.
trim
())
{
const
partial
=
this
.
getPartialText
(
item
.
text
,
item
.
bbox
,
newBbox
);
// console.log(`Found OCR item for manual mapping: ${partial} at bbox ${item.bbox}`);
foundItems
.
push
({
text
:
item
.
text
,
text
:
partial
,
bbox
:
item
.
bbox
,
index
:
this
.
ocrData
.
indexOf
(
item
)
});
...
...
Please
register
or
sign in
to post a comment