how to get thinned character image? - python

I am performing Thinning operation on Gujarati character using neural networks. after train neural network I get the blurred image. SO, I want the Thinned image from blur image.The blurred image has the medial pixel of the stroke is much brighter than adjacent pixel. so My task is how to extract medial pixel which is part of the thinned image.
here, There are two images give below one is input blur image and the second image is Thinned image which I want from the blurred image. please give me the suggestion.
Input blur image :
Output Image :

Related

creating a transparent overlay using OpenCV in python

So I have two images, one is a white image with a blurred spot and other is a image of a street(taken from KITTI dataset). I want to blend both the white image with blurred spot and street image such that the whiteness doesnt appear while blending.\
In the first image below, you can see a translucent gray spot. This I achieved by making a copy of the street image and then drawing a circle on it using cv2.circle function. This i blended it back with the original image and controlled the transparency of the circle.
In place of the circular spot, I want the blurred spot in the white image to appear with transparency. How can this be achieved?
When i do normal blending the white shade also appears. I tried converting into RGBA image and then blending but didnt work. Any idea how this could be achieved?

change from colored to grayscale in image processing

today I treid a python filtering code that supposes to increase the noise in the image(de-noising) for a gray-scale image(medical image) and it's for a skull, the problem is i keep getting colored pixels, i mean the noise increased in terms of colored image, not in grayscale so please help me to make the code filter in gray-scale mode, extra details :
the code :
enter link description to see the filter code
original image :
the de-noised image after applying noise filter :
you can see the problem clearly that when i zoom into the picture i can see the colored pixels, while it supposes to be a gray-scale form
colored pixels in the filtered image :
partial zoom in
full zoom in
so please guess does anybody knows how to edit that code so that it can increase the noise in form of grayscale mode.
Your input image is a 3-channel JPEG. Make it greyscale (1 channel) before applying noise then it won't be able to treat the channels differently because there will only be one.
img.transform_colorspace('gray')

How do I use the result of thresholding to select parts of another image in OpenCV?

I have a threshold image and a pattern image. I want to overlay the pattern image onto my threshold image, where the threshold part is black. See images attached:
Threshold Image, Pattern Image:
The issue with that is, my threshold part is not of any uniform shape. It is random, not having some fixed shape like rect, circle etc. (Comes from frontend). It would be similar to this above sample image only.
What I want is to "cover" the black part of threshold with a single pattern image. Now, if my threshold image was of some shape like rectangle / circle, I could simply use some "slicing" operation to overlay them. A sample is shown below as Ideal condition.
Ideal threshold, ideal result:
However, actual shapes are not that trivial. So I cannot use slicing on them. Also, my pattern images are not just one solid color, so I think I can't even do much with that.
I think I need to somehow "generate" the pattern image according to my black portion of threshold Image. How do I do that? Any pointer to that would also help. I'm using OpenCV and Python.
Feel free to consider the dimensions of both images to be same.

Inverse filtering a blurred image - Python

For an assignment, The image corrupted by atmospheric turbulence. I want to deblur an image using inverse image filtering. I have done some research and it seems I need the original image for this procedure but I only have the blurred image. How can I construct the degrading function that was used to blur this image? I am not allowed to use the original image. Thank you in advance.
This is the image:

Copying a non rectangular ROI from an image and use the ROI in other image in same points

I have been trying to crop a non rectangular ROI from an image and use that ROI in the other image.
Case: I am using perspective transformation to an image and writing it in the file. And now I want to copy the certain non rectangular ROI of transformed image and paste it on the other image with same ROI. As of now both the images are of similar sizes.
Images are manually updated.

Categories

Resources