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

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 5K views
1Keenan
Messages
99
Reaction score
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: 705
Physics news on Phys.org
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)
 
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.