chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
When setting focus on commodities, always use top left corner of table
[ypp-sc-tools.db-test.git]
/
pctb
/
structure.c
diff --git
a/pctb/structure.c
b/pctb/structure.c
index e9df7334a73f04cf53c4754a0a14f7a21228180f..85b8f86537421215d69e2cbf0155a8a98a346389 100644
(file)
--- a/
pctb/structure.c
+++ b/
pctb/structure.c
@@
-255,7
+255,8
@@
static int commod_selector_matches(Rect search, const char *const *all,
(search).TLBR.XY += increm; \
}
(search).TLBR.XY += increm; \
}
-void find_structure(CanonImage *im, int *max_relevant_y_r) {
+void find_structure(CanonImage *im, int *max_relevant_y_r,
+ Point *commod_focus_point_r) {
cim= im;
Rect whole = { {0,0}, {cim->w-1,cim->h-1} };
cim= im;
Rect whole = { {0,0}, {cim->w-1,cim->h-1} };
@@
-365,6
+366,12
@@
void find_structure(CanonImage *im, int *max_relevant_y_r) {
if (max_relevant_y_r)
SET_ONCE(*max_relevant_y_r, mainr.br.y + 10);
if (max_relevant_y_r)
SET_ONCE(*max_relevant_y_r, mainr.br.y + 10);
+ if (commod_focus_point_r) {
+ *commod_focus_point_r= mainr.tl;
+ commod_focus_point_r->x += 10;
+ commod_focus_point_r->y += comminty/3;
+ }
+
MUST( text_h <= OCR_MAX_H, MI(text_h) );
}
MUST( text_h <= OCR_MAX_H, MI(text_h) );
}
@@
-632,7
+639,7
@@
void analyse(FILE *tsv_output) {
int page, tryrect, colno;
for (page=0; page<npages; page++) {
int page, tryrect, colno;
for (page=0; page<npages; page++) {
- find_structure(page_images[page], 0);
+ find_structure(page_images[page], 0
, 0
);
if (!page)
check_correct_commodities();
if (!page)
check_correct_commodities();
@@
-693,7
+700,7
@@
Rect find_sunshine_widget(void) {
}
void find_islandname(void) {
}
void find_islandname(void) {
- find_structure(page_images[0], 0);
+ find_structure(page_images[0], 0
, 0
);
RgbImage *ri= alloc_rgb_image(page_images[0]->rgb->w,
page_images[0]->rgb->h);
RgbImage *ri= alloc_rgb_image(page_images[0]->rgb->w,
page_images[0]->rgb->h);