Let's say I took an image of the same thing, but one is 512x512 and one is 256x256 pixels. The second one has 1/4th as many pixels, so any given pixel in that second image corresponds to 4 pixels in the first image. Essentially I want to cluster the 256x256 image into two rough groups, and replace the pixels in image2 that get clustered into group 1 with the corresponding pixels in the 512x512 image1, and the same with the group2 pixels: swap those pixels in image2 with the corresponding pixels in image1.
Is there a quick way to find which pixels of a higher resolution image correspond to a pixel in a lower resolution image? Infographic below
EDIT: The graphic below is just a simplified illustration. If I were to perform kmeans or some other clustering algorithm on the image on the left, and identified pixel #2 to belong to one group, and pixels #1, 3, 4 to belong to another group, I want to return the pixels in the right image that belong to those corresponding groups. i.e. pixel 2 in the first image would correspond to pixels 3,4,7,8 in the right image. I'm not sure how the pixels are numbered in matlab but I'm pretty sure I can just define it myself. So would this just have to be some tedious algebra where I would have to multiply the (potetially self-defined) xy position of the pixel in the left image by 2, or more generally some ratio of image sizes? or is there a better way to map this such that I can just superimpose the xy designations from the left image onto the image on the right, so that all the green squares in the right image (pixels 3,4,7,8) are just assigned a label of "2"?