java - How to calculate the distance from a pixel in the Lab-color space to a specific prototype -


i have lab-image , each pixel in it, want know how red, green, blue , yellow pixel is.

which means, input lab-image should 4 images 1 red,green,blue , yellow.

as far researched, knew done calculating ecludian distance each pixel in lab-image prototype of color (r,g,b or y). example, if want produce image contains how red pixels in lab-image, each pixel in lab-image, have calculate distance pixel in lab-image prototype of red color in lab-color space

kindly please provide advice , guidance.

all need convert color value need (e.g. red = 255,0,0 in rgb) lab (lref,aref,bref), calculate euclidean distance between each pixel , value, , set distance output pixel value.

out_pixel=sqrt(sqr(lpixel-lref)+sqr(apixel-aref)+sqr(bpixel-bref))

you may want normalize values, if want pixel output fit in 0-255.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -