MATLAB: Pixel Selection within a GUI

guiImage Processing Toolboximagesnanpixel selection

Okay soi have four small pictures within a GUI, i need the user select a single pixel from one of these four images. How would i go about selecting a pixel and getting the RGB value from that pixel. When i use impixel() it doesnt terminate after one click, is there a way to make it terminate after the user clicks once? I also keep getting NaN NaN NaN as the values when i use impixel() any idea why that would be happening? I would add code but its a GUI and there is just way too much to post here.

Best Answer

Like I said in your duplicate question you should be able to get the RGB values once you have the row and column from ginput as
rgbTriplet = rgbImage(row, column, :);
or
rgbTriplet = impixel(rgbImage, column, row);