ogkalu2 / comic-translate

Desktop app for automatically translating comics - BDs, Manga, Manhwa, Fumetti and more in a variety of formats (Image, Pdf, Epub, cbr, cbz, etc) and in multiple languages.
Apache License 2.0
1.1k stars 96 forks source link

cvtColor assertion error in detect_content_in_bbox when provided image array is empty [] because x1 == x2 in bbox #145

Open lawrenz1 opened 1 month ago

lawrenz1 commented 1 month ago
image

I think the issue is that the image array can be empty if x1 == x2 in bbox

suggestion is to either adjust x coordinates or filter out bbox from the list if x1 == x2 ex. text_bounding_boxes = [bbox for bbox in text_bounding_boxes if bbox[0] != bbox[2]]

lawrenz1 commented 1 month ago

I just noticed https://github.com/ogkalu2/comic-translate/issues/120 which seems to encounter the same error message, but not sure if it is the same issue where x1 == x2 in bbox.

I will update the title in this issue to be specific to the scenario when bbox x1 == x2 just in case

ogkalu2 commented 6 days ago
image

I think the issue is that the image array can be empty if x1 == x2 in bbox

suggestion is to either adjust x coordinates or filter out bbox from the list if x1 == x2 ex. text_bounding_boxes = [bbox for bbox in text_bounding_boxes if bbox[0] != bbox[2]]

Does this resolve this issue for you ?

lawrenz1 commented 6 days ago
image

I think the issue is that the image array can be empty if x1 == x2 in bbox suggestion is to either adjust x coordinates or filter out bbox from the list if x1 == x2 ex. text_bounding_boxes = [bbox for bbox in text_bounding_boxes if bbox[0] != bbox[2]]

Does this resolve this issue for you ?

I think so, but it's been awhile since I tested the fix