How can I use MatLab for Chroma-Keying and replacing a green background?

In summary, the conversation discusses using an image as a reference grid for calibration and how to superimpose it on other images. The speaker also mentions obtaining pixel coordinates and distances, converting the image to grayscale, and changing pixel values in specific areas. They also inquire about a MATLAB code for Chroma-Keying.
  • #1
1Keenan
101
4
Hi,

I have an image (attached) I have to use as a reference.
To be clear I have to use this grid as calibration for an acquisition sistem.

I want to get the grid of this image and superimpose it on other images.
Is it possible? how to do it?

Thanks
 

Attachments

  • Calibrazione170112.jpg
    Calibrazione170112.jpg
    30.1 KB · Views: 630
Physics news on Phys.org
  • #2
I managed to get the central pixel coordinates [X0,Y0] (using ginput) and the distance between two points (using imdistline).
I have converted the image in a gray scale using im2double and I want to change pixel value in the first quadrant. (image is almost black)
I mean I would like to set as white each pixel of every rows between 1 and Y0 with step equal to the distance calculated above and do the same for the column between X0 and 821.
How to do that?
(the image size is 577X821X3 double and MatLab says that 821 index exceeds matrix dimensions)
 
  • #3
Hi ,

I am a biology major grad student and I am looking a Chroma-Keying MATLAB code for removing a green background color and replacing with another image? anybody with the code please share. Thank you so much.
 

FAQ: How can I use MatLab for Chroma-Keying and replacing a green background?

What is Image Processing in MatLab?

Image processing in MatLab is the manipulation and analysis of digital images using the MatLab software. It involves enhancing, transforming, and extracting information from images for various applications such as medical imaging, remote sensing, and computer vision.

What are the advantages of using MatLab for Image Processing?

Some advantages of using MatLab for image processing include its extensive library of built-in functions for image manipulation, its user-friendly interface, and its compatibility with other programming languages and software.

How can I import an image into MatLab for processing?

To import an image into MatLab, you can use the imread() function. This function reads an image file and converts it into a matrix of pixel values, which can then be manipulated using other MatLab functions.

What is the difference between 2D and 3D image processing in MatLab?

2D image processing in MatLab refers to the manipulation of images in two dimensions, where each pixel has a single value. On the other hand, 3D image processing involves working with images that have multiple layers or channels, such as RGB images, where each pixel has three color values.

What are some common techniques used in MatLab for image processing?

Some common techniques used in MatLab for image processing include filtering, segmentation, feature extraction, and morphological operations. These techniques are used for tasks such as noise removal, object detection, and image enhancement.

Similar threads

Replies
1
Views
1K
Replies
2
Views
3K
Replies
4
Views
2K
Replies
15
Views
2K
Replies
5
Views
1K
Replies
3
Views
2K
Replies
1
Views
2K
Replies
7
Views
3K
Back
Top