removing shadow from colour image (3-channel (jpg) or 4-channel (png)) - python-3.x

I am trying to isolate shadows from this image and remove them:
The reason why I am doing that is because shadow is problematic for my edge detection algorithm.
What should I do to remove the shadow? I haven't done this before, so I do not even know where to start from.
From the similar questions on SO I wasn't able to find anything to help me with my task.
I have the image in both: png and jpg format, so I am not even sure which format to use to start with.

That's a very interesting question. One option you can try is to divide the RGB values in the image by the grayscale intensity of the image. There is apparently another method explained here: https://onlinelibrary.wiley.com/doi/full/10.1002/col.21889.

Related

How to merge multiple colors and objects of different sizes into an image in Inkscape

Hi Inkscape learners and professionals,
I am learning Inkscape. I am trying to merge multiple colors or ornaments of different shapes, sizes, and colors into an object/picture. I want to see my final image with no colors or any objects beyond the boundaries of my image. Is there any specific tool I can use in Inkscape or tutorials on this to watch? Please see an example here.
Let’s say, I have this vector file:
And I want the final image to look like this:
Any advice and suggestions would be appreciated. Thank you.
As mentioned above by #Juancho, you must learn Masking and clipping which is mostly used in all graphic design softwares.
Your problem can be resolved by simple clipping (Inkscape -> Object -> Clip ->set). Check it out:
https://imgur.com/Taftj2Y

Nodejs: Chroma key/composite two images

I'm looking to composite one image on top of another, but the location and size will be determined by a green box in the original image.
Is this something I can do w/ jimp?
Thanks!
--
Here's what I'm hoping to do:
--
Edit: It looks like OpenCV is a great place to start. After some digging, I'm thinking these are the correct steps:
Detect if there is a square with a specific color in the image
Capture the coordinates & dimensions of that square
Create the new image by compositing face.jpg on top of the original image
I'm not quite sure the best path to approach step 1.

How do i load a bitmap in Direct2D containing an alpha channel

I'm trying to load a bitmap in Direct2D that already contains an alpha channel, but Direct 2D seems to always ignore the alpha channel surrounding the desired image, replacing it with opaque black. Has anyone had success with this, and could show me their code? has anyone loaded a PNG file, and convert it to a bitmap? (MSDN says it's possible, but i can't find any cases where people have had success) or is this a mask thing?
In any case, could you show me a example code snippet explaining how to do one of these things? i'm trying to make a game, i have everything else working, and this is the literal final step. if someone could show me exactly how this is done, that would make my day! just transparency in an image. that's all i need.

Coloured textures for POIs

I was trying to use a coloured texture (PNG 24/RGB) for a POI (bicycle_parking) and it was not being rendered. It was added properly as a texture, it just won't be rendered on the POI.
After some testing I came to believe that POIs only accept grayscale textures that can later be filled up with a color. Is this right?
I also found out that the icon needs to be of a specific size (I got it working only at 32x32 pixels and 512x512, but the scaling did not make it look good). Is there any information regarding this?
Now I have a grayscale icon (mostly white) but the fill color does not change the white as expected. This is as far as I got..
Here's a set of icons similar to the ones I need to render into POIs
How could I achieve adding this type of icons as the texture of a POI? Workarounds/hacks are welcome as well :)
Thanks!
The texture of the Poi must have a size that is a power of 2 and goes from 32x32 up until 512x512. Also make sure that the colour code of that image is RGB anything else wont work. For the best visual result you have to create 3 sets of pngs for different screen densities, for example see heatmap_legend.png then look at heatmap_legend#2x.png and heatmap_legend#3x.png, you can find them in the "common" folder.
So turns out that the color wasn't a problem after all. It was quite tricky to get one image working, but once I had the image working, adding color to it and saving the PNG worked just fine.
The problem with the image size I experienced is still happening. You need to export it in 32x32, 64x64 or 96x96 in order to StyleEditor not to crash when opening the file.

Detect an object in image using IMAGEMAGICK

I have an image with Gray Background and 'CUP' in center of it... I want to detect the boundaries of the cup in this image.. After detecting CUP I want to extract the CUP from the image using IMAGEMAGICK.. Note I have many images with different objects (like CUP) in the center and with different background color .. So I am looking for a solution which is applicable to all of them..
Plz comment..
Maybe you could use edge-detection algorithms to isolate the shape of your main object: http://en.wikipedia.org/wiki/Edge_detection
You could also look into the code for the EdgeImage effect in ImageMagick, to see how they do it...

Resources