Hello. I am working on a robotic project with a camera to capture images of blue,red,green LEDs. Apparently, the camera has 3 dead pixels. When there is no LED present, using the code below, camera detects three pixels (one red one blue one green) which are the dead pixels on the camera. I was wondering how I could mask these 3 pixels. Here is the output: [rrpts crpts rgpts_t cgpts_t rbpts cbpts] = [367 537 616 888 582 350] in which each consecutive pair is a x-y location of each dead pixel (they are the pairs I want to mask). My code is also shown below. Thank you.
Clear allClose all;Global rthr gthr bthrrthr = 60;bthr = 60;gthr = 60;delete(imaqfind);vid = videoinput('dcam');vid.ReturnedColorSpace ='bayer';vid.BayerSensorAlignment ='rggb';vid.ROIPosition = [60 40 960 720];vid.FramesPerTrigger = 1;%triggerconfig(vid,'manual')
% vid.TriggerRepeat = Inf;
src = getselectedsource(vid);src.Gain = 500;start(vid)%preview(vid)
[img time] = getdata(vid);[rrpts crpts rgpts_t cgpts_t rbpts cbpts] = gsearch_rgb(img)figure (1)imshow(img)%imshow(rgbImage)
stop(vid);
Best Answer