How to create very high resolution bitmaps in python? [closed] - python

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Currently as per what I know the max resolution that can be created using pillow's image function is 3000*3000 but I need to create image which has resolution of 10000*10000 or more programmatically ???
If you people didn't get what I meant ,just comment to me rahter than closing this question (please)I will give a more detailed question!!!

The only ways to create a pixel-perfect SVG from a bitmap is to <rect/> elements for each pixel (or block of same-colored pixels), or to use an <image> element to reference your bitmap. In neither case will you end up reducing the file size.
A vector format like SVG is not well-suited to representing hand-tweaked pixels. You likely want to use a bitmap format that supports lossless compression, such as PNG. If file size is of critical importance, you may wish to use a tool like OptiPNG to ensure that your PNG files are as small as possible.

Related

Is it possible to get contours from a picture without using opencv in python? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
I'm having trouble installing opencv. Is it possible to get contours from a picture without using opencv in python?
You could iterate over the pixels using a for loop, darken each pixel until you’ve got your more prominent values, then create an array of vectors dependant on the outline, tensorflow posenet does this
OpenCV is more widely used for this purpose, but you can also do great things with:
Scikit-image find_contours measure: Check code & sample here
PIL/Pillow: For simpler uses. Check this example
Tensoflow: For more advanced use, there are some approaches too using Deep Learning for this. Just found this sample searching Github
Pytorch: Also via deep learning. Check this other sample

Detecting a watermark using opencv [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want to detect a watermark in an image using OpenCV.
Particularly, I want a rectangular box around the watermark, if present.
Can you please help me out with the python code?
Though the solution would be dependent on the actual image content (that needs to be preserved) and the watermark. But in these kinds of problems, following sequence of steps is usually followed:
Converting the image to grayscale (cv2.cvtColor(img, cv2.COLOR_BGR2GRAY))
Applying morphological filtering Erosion, Dilation
Taking the difference of this output from the actual image

screen scrape alphanumeric chars from picture [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to find a way to screen scrape the letters and numbers (mainly numbers) from the attached picture.
example picture
In previous attempts, I've used pyocr and many other variations.
My question is, has any body found a way to scrape off numbers? Or how to train the pyocr algorithm to use custom data?
Thanks in advance!
The folks at PyImageSearch have a TON of info about processing images in Python with OpenCV.
They even have a free blog post about using Tesseract OCR. Though Tesseract can be a bit fussy about fonts, the good news is it looks like your text in the image should always be the same font, and perfectly aligned horizontally and vertically.
(disclaimer: I'm a student of theirs; but I don't work for them)
https://www.pyimagesearch.com/2018/09/17/opencv-ocr-and-text-recognition-with-tesseract/

Bounding boxes around text regions with different font size [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am trying to implement some kind of text detection algorithm and I want to separate the image into regions where each region contains different font size.
As in this image, for example:
Is there any easy way to implement it using python and/or opencv? if so, how?
I did tried googling it but could not find anything useful..
Thanks.
This is an interesting question. There are a few steps that you need to take in order to achieve your goals. I hope you are sufficiently informed of basic computer vision algorithm (knowledge in openCV function helps) to understand the steps i am suggesting.
Group all the words together using morphological dilation process.
Use openCV findcountour function to label all the blobs. This will give you the width and height information of each blob as well.
Here is the tricky part, now that you have data on each blob, try to run a clustering algorithm on the data with the location(x,y) and geometry(width,height) as your features.
Once you cluster them correctly, its a matter of finding the leftmost, rightmost, topmost and bottom data to draw the bounding rect.
I hope this will provide you enough information to start you work. Its is not detailed but i think its enough to guide you.

Position and orientation estimation by stereo images [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am trying to find out how to estimate position and orientation of an object using stereo camera images.
Assume a description of an object is given either by its edges and edge-relations, or points, or other features. The images are taken from above by a set of two cameras that have a fixed position relative to each other (like Microsoft Kinect gives you).
With Python's skimage toolkit I am able to recognise the similarites in the picture without telling if the searched object is in the images, but that is as far as I get.
What I want to do more is to segment the known object from the background and to be able to tell its position relatively to the cameras (e.g. by comparing its calculated position with the position of a known mark on the floor or something similar which I don't think will be too hard).
I know Python pretty well and have some experience in basic image processing. If this problem is already solved in OpenCV, I can work with that as well.
Thank you in advance for any help you give, either by naming keywords to improve my search, links, or by sharing your experience in this field!
To illustrate my problem: You have a bunch of same kind (shape+color) lego bricks laying in a chaotic manner, e.g. they are overlaying completely/partially or not at all and have an arbitrary orientation. The floor underneath is of the same color as the bricks. Cameras look straight down. Task is to find as many as bricks as possible and tell there location.
edit: added illustration

Categories

Resources