You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this work for current python3 and module versions?
I got the following output when running it. My mp4 is in 720p and the subtitles fall within the default box values:
Traceback (most recent call last):
File "./jyutping.py", line 167, in
main()
File "./jyutping.py", line 146, in main
text = extractor.extract(frame)
File "/home/user/python/add-jyutping-master/extract.py", line 47, in extract
self.cleaned = self.clean_image(img)
File "/home/user/python/add-jyutping-master/extract.py", line 112, in clean_image
return self.clean_after_crop(cropped)
File "/home/user/python/add-jyutping-master/extract.py", line 175, in clean_after_crop
img = super().clean_after_crop(cropped)
File "/home/user/python/add-jyutping-master/extract.py", line 145, in clean_after_crop
img = remove_small_islands(img)
File "/home/user/python/add-jyutping-master/extract.py", line 310, in remove_small_islands
im2, contours, hierarchy = cv2.findContours(img, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)
The file I used was downloaded from YouTube. You can try yourself using y2mate site, I tried multiple videos from the YouTube TVB News channel.
The text was updated successfully, but these errors were encountered:
This problem occurs because of an API change of OpenCV. The function findContours used to return 3 values but returns 2 values now (first value was removed). But it isn't a big problem because the removed first value is not used in the code.
Does this work for current python3 and module versions?
I got the following output when running it. My mp4 is in 720p and the subtitles fall within the default box values:
Traceback (most recent call last):
File "./jyutping.py", line 167, in
main()
File "./jyutping.py", line 146, in main
text = extractor.extract(frame)
File "/home/user/python/add-jyutping-master/extract.py", line 47, in extract
self.cleaned = self.clean_image(img)
File "/home/user/python/add-jyutping-master/extract.py", line 112, in clean_image
return self.clean_after_crop(cropped)
File "/home/user/python/add-jyutping-master/extract.py", line 175, in clean_after_crop
img = super().clean_after_crop(cropped)
File "/home/user/python/add-jyutping-master/extract.py", line 145, in clean_after_crop
img = remove_small_islands(img)
File "/home/user/python/add-jyutping-master/extract.py", line 310, in remove_small_islands
im2, contours, hierarchy = cv2.findContours(img, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)
The file I used was downloaded from YouTube. You can try yourself using y2mate site, I tried multiple videos from the YouTube TVB News channel.
The text was updated successfully, but these errors were encountered: