How to create a image matrix of pixels showing there value

asked 2019-06-28 18:55:15 -0600

davidpzed gravatar image

Hi I have a project where I would like to zoom in on an EOI (pointed to by mouse) on a displayed image and have a pop up image of say 21 x 21 pixels around the EOI showing their value and and color (color or grayscale) with the text of the value in the reverse color scheme. Basically like shown here https://docs.opencv.org/2.4/_images/H... The project is in C++ using MSVC. It has a feature that allows you to zoom into an image called Image Watch, I would like to have this as an output.

Any help would be great

Cheers Dave

edit retag flag offensive close merge delete

Comments

Set an roi (21x21) around the mouse position in the source image. Decide on a wd & ht value for each pixel in the matrix of pixels. Make this matrix image size (21 * wd, 21 * ht) For each pixel in the roi, draw a filled rectangle in the matrix image using the pixel's value and draw the text of the pixels value within this filled rect using a color that is 255 - value

Chris gravatar imageChris ( 2019-06-29 10:41:06 -0600 )edit

Hi Chrs Thanks for help, much appreciated. Will try implementing your suggested solution over the course of the week (new to opencv)

Cheers Zed

davidpzed gravatar imagedavidpzed ( 2019-06-29 18:14:06 -0600 )edit