Want to mask some area in an image using Matlab - matlab

I want to mask some area (Blue and Red) in an image, I tried different methods but I couldn't get the solution that I want.
Here's the image I am using:
Here's the result that I want:
Please explain the code because I really want to learn how it works and implement it in my own understanding.
Any helps ? Thanks

Related

Pasting an image on top of another image

I have this poster image:
I have to blend it with another image. I have to put this image on a picture of a building like this:
The rotated poster image has white pixels that I don't know how to get rid of.
Can someone please help me with code to paste this image on the building image? The front of the building.
Firstly find the four corner points of building where you want to blend image. Also find four corner points of your poster. Then use perspective transform and warpaffine to paste poster on image.
This http://www.learnopencv.com/homography-examples-using-opencv-python-c/ link may help you to get the idea but it is using OpenCV.
I have tried this using OpenCV C++ and I am getting following image after applying perspective transform. Let me know if you want this kind of results:

3D transform image (in Bohemian Sketch)

For my website, I want to use the vector image as shown here: http://www.sketchappsources.com/free-source/226-iphone-5.html
It's an iPhone 5 that is tilted.
Now I need to add my image to the screen which means I need to 3D-tilt it. I've tried and searched a lot but couldn't figure out how to transform my image so that it fits the iPhone 5 screen.
Any help in guiding me how to 3D transform my image would be greatly appreciated!
Cheers,
Frank
I recently released a plugin solving the exact issue, it allows you to draw a shape with the Vector tool and then apply the content of an artboard into the area. It's called Magic Mirror, please take a look at http://magicmirror.design

How do make an automatic cropping for the interest area in MATLAB?

I'm the beginner of image processing by using MATLAB and i have to do some tasks, i want to crop or cut for the specific area like using imcrop but want to make it automatic (i cannot upload picture because i'm the new user, the picture that i use is the cross-section of a plant) i really don't know how to detect and cut out only that area. I'll really appreciate if there's someone can help me to figure out this problem.
You need to give us more information. If you want to automate the detection of a part of an image to crop it, you need to do some image processing. What kind will depend on the characteristics of your images and the part you want to crop.
You can post an image using, for example, http://www.postimage.org/

Cut/Slice UiImage using coordinations

I have an image that I want to slice like the photoshop knife tool using two or more coordinations on the image. I then want to erase the top portion of the image and replace it with a transparent background. If anyone can point me in the right direction or has code that can do it I would be forever grateful.
I think that you should try using a UIGraphicsContext. Here is a similar question, I hope it helps.
Slicing up a UIImage on iPhone

Draw color on country (Mapkit) when it is selected

I want to color the country on selection of the country from a tableView. Can you help me please?
Considering your case, let me give you a heads up that this would require edge detection (so if you haven't done that before, it will take a LONG time), though not lots of it and the following is just one way of approaching this problem:
1) Take out an image context from the map you have.
2) Apply relevant edge detection algorithms in the area you want and use a bright color to differentiate. Note that this way, the inside would not be colored and I can't tell you for sure if that's possible or not.
3) Add that context as a subView on top of the map.
Also take a look at the Quartz 2D programming guide for more tips.
I would suggest something different, though. Keep pre-stored images for all the possibilities and just put a UIImageView with that as its image in front of the map - this will save you a lot of headache.