Skip to content
Advertisement

Tag: image-processing

Filter in opencv/python

I am trying to learn filters in opencv and running this code. But the problem is that when ı run the code it gives me an almost dark image and warns me with “c:/Users/fazil/Desktop/Yeni Metin Belgesi (3).py:19: RuntimeWarning: overflow encountered in ubyte_scalars result[j,i,a]=int((image[j,i,a]+image[j,i-1,a]+image[j,i+1,a]+image[j+1,i,a]+image[j-1,i,a]+image[j+1,i+1,a]+image[j+1,i-1,a]+image[j-1,i-1,a]+image[j-1,i+1,a])/9)”. And if ı comment these out and run code with the lines working with cv2.filter2d method it

Manual registration with SimpleElastix

I’m using SimpleElastix (https://simpleelastix.github.io/) for the registration (Affine) of the two 2D images (see attached) . For this I’m using this code : After the execution of the latter, I obtain the following TransformParameters0.txt that contains the transformation matrix : My aim is to use this matrix-tranformation to register the floating image and get a registrered image similar to the

Extract N number of patches from an image

I have an image of dimension 155 x 240. Like the following: I want to extract certain shape of patchs (25 x 25). I don’t want to patch from the whole image. I want to extract N number of patch from non-zero (not background) area of the image. How can I do that? Any idea or suggestion or implementation will

Pinch/bulge distortion using Python OpenCV

I want to apply a pinch/bulge filter on an image using Python OpenCV. The result should be some kind of this example: https://pixijs.io/pixi-filters/tools/screenshots/dist/bulge-pinch.gif I’ve read the following stackoverflow post that should be the correct formula for the filter: Formulas for Barrel/Pincushion distortion But I’m struggling to implement this in Python OpenCV. I’ve read about maps to apply filter on an

Improving image deskew using Python and OpenCV

The code I’ve produce to detect and correct skew is giving me inconsistent results. I’m currently working on a project which utilizes OCR text extraction on images (via Python and OpenCV), so removing skew is key if accurate results are desired. My code uses cv2.minAreaRect to detect skew. The images I’m using are all identical (and will be in the

Advertisement