opencv

OpenCV Contours. having trouble finding the desired contour of a given image

OpenCV Contours. having trouble finding the desired contour of a given image Question: [ This is the image I need to do contour detection on. I need to contour the characters inside and outside the rectangle, but not the rectangle itself. The Second image I attached is the desired output. Now this is the approach …

Total answers: 1

Read image from a file using OpenCV

Read image from a file using OpenCV Question: I want to convert PNG type flowchart to the graph by using Graphviz Python Package. Here I have already installed relevant packages by using pip install opencv-python pytesseract graphviz After I created a python file. import cv2 import pytesseract import graphviz pytesseract.pytesseract.tesseract_cmd = r’C:Program FilesTesseract-OCRtesseract.exe’ # Replace …

Total answers: 2

Compressing image with python-opencv actually results more size

Compressing image with python-opencv actually results more size Question: I want to compress image in-memory using python. Using this code from answer https://stackoverflow.com/a/40768705 I expect that changing "quality param" (90) I will get less size of result image. encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), 90] result, enc_img = cv2.imencode(‘.jpg’, img_np, encode_param) My original plan was to decrease this …

Total answers: 1

Medial Axis Transform/Skeletonization on morphological for calculating numbers of component

Medial Axis Transform/Skeletonization on morphological for calculating numbers of component Question: I’m trying to calculate the number components on opencv library "connectedComponentsWithStats" in python, but my skeletonization result seems not do well, cause the number of component return incorrect result. Here my original image to convert to skeleton. input And here’s my code as below, …

Total answers: 1

How to insert text to image by cv2.warpPerspective in python opencv?

How to insert text to image by cv2.warpPerspective in python opencv? Question: Like this in python opencv: i = 0 for line in wrapped_text: cv2.putText(img, line, (x, y), font, font_size, (255,255,255), font_thickness, lineType = cv2.LINE_AA) i +=1 cv2.imshow("Result Image", img) cv2.waitKey(0) cv2.destroyAllWindows()` Asked By: Marina Parshina || Source Answers: Good question! I think this way …

Total answers: 1

Video created with OpenCV python cannot be uploaded to Social Media Platforms

Video created with OpenCV python cannot be uploaded to Social Media Platforms Question: I use OpenCV in a python script to convert images in PIL format to MP4 videos. Even though I can play back the videos normally after creating them, I cannot upload them on Twitter or Instagram afterwards. If after creating the video, …

Total answers: 1

Low Accuracy in Detecting Circles using Hough Circle open cv python

Low Accuracy in Detecting Circles using Hough Circle open cv python Question: I’m new to the Computer Vision field so this question may be fairly easy; yet I’m clueless on how to increase the Precision. I’m Trying to detect all circles in this picture. Here is the approach i took Gray Scaled the image gray …

Total answers: 1

cannot write images using cv2.write

cannot write images using cv2.write Question: I am trying to convert images from .jpg to .png format using opencv. I have written the following code. if __name__ == ‘__main__’: logging.info(r’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’) logging.info(‘Starting to make a .lst file’) # png_to_png = glob.globoos.path.join(args.jpg2png, ‘*.png’) images_list = glob.glob(os.path.join(args.image, "*.jpg")) logging.info(f’images_list example: {images_list[3]}’) # mask_list = glob.glob(os.path.join(args.masks, "*.png")) # Changing …

Total answers: 1