opencv

How can I observe the intermediate process of cv2.erode()?

How can I observe the intermediate process of cv2.erode()? Question: I’ve been observing the results when I apply cv2.erode() with different kernel values. In the code below, it is (3, 3), but it is changed to various ways such as (1, 3) or (5, 1). The reason for this observation is to understand kernel. I …

Total answers: 2

Image Pyramid. Having trouble creating the desired composite image

Image Pyramid. Having trouble creating the desired composite image Question: What I am trying to do: Combine these two images: Using this mask: to create this output: The assignment: Write a program to create a composite image of the two images with the mask, based on image pyramids. Now, This is what I have tried …

Total answers: 1

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