added alpha channel check result to response
This commit is contained in:
parent
a6b9f64b51
commit
7e666302d5
@ -98,6 +98,7 @@ An image metadata record (entry in `"data"` field of a response body) looks like
|
|||||||
"width": 57.44999999999999,
|
"width": 57.44999999999999,
|
||||||
"height": 31.149999999999977
|
"height": 31.149999999999977
|
||||||
},
|
},
|
||||||
|
"alpha": false,
|
||||||
"filters": {
|
"filters": {
|
||||||
"geometry": {
|
"geometry": {
|
||||||
"imageSize": {
|
"imageSize": {
|
||||||
|
|||||||
@ -20,8 +20,8 @@ def build_image_info(data: dict) -> dict:
|
|||||||
image_area_sqrt = math.sqrt(abs(x2 - x1) * abs(y2 - y1))
|
image_area_sqrt = math.sqrt(abs(x2 - x1) * abs(y2 - y1))
|
||||||
return image_area_sqrt / page_area_sqrt
|
return image_area_sqrt / page_area_sqrt
|
||||||
|
|
||||||
page_width, page_height, x1, x2, y1, y2, width, height = itemgetter(
|
page_width, page_height, x1, x2, y1, y2, width, height, alpha = itemgetter(
|
||||||
"page_width", "page_height", "x1", "x2", "y1", "y2", "width", "height"
|
"page_width", "page_height", "x1", "x2", "y1", "y2", "width", "height", "alpha"
|
||||||
)(data)
|
)(data)
|
||||||
|
|
||||||
quotient = round(compute_geometric_quotient(), 4)
|
quotient = round(compute_geometric_quotient(), 4)
|
||||||
@ -43,6 +43,7 @@ def build_image_info(data: dict) -> dict:
|
|||||||
"classification": classification,
|
"classification": classification,
|
||||||
"position": {"x1": x1, "x2": x2, "y1": y1, "y2": y2, "pageNumber": data["page_idx"] + 1},
|
"position": {"x1": x1, "x2": x2, "y1": y1, "y2": y2, "pageNumber": data["page_idx"] + 1},
|
||||||
"geometry": {"width": width, "height": height},
|
"geometry": {"width": width, "height": height},
|
||||||
|
"alpha": alpha,
|
||||||
"filters": {
|
"filters": {
|
||||||
"geometry": {
|
"geometry": {
|
||||||
"imageSize": {
|
"imageSize": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user