Intensity problem
-
How to get the same intensity after stretching an image eg: Let intensity of a square of 1 unit = 1 x I1 If I stretch the square to 2 units then the intensity = 2 x I2 Both these intensities should be equal 1xI1 = 2xI2 = k(constant) It should work ways (ie) the intensity should decrease while stretching and increase while shrinking. I am using bilinear interpolation for stretching but the intensities aren;t equal. Is there any algorithm or filter to alter the intensity of an image. Pls Help
-
How to get the same intensity after stretching an image eg: Let intensity of a square of 1 unit = 1 x I1 If I stretch the square to 2 units then the intensity = 2 x I2 Both these intensities should be equal 1xI1 = 2xI2 = k(constant) It should work ways (ie) the intensity should decrease while stretching and increase while shrinking. I am using bilinear interpolation for stretching but the intensities aren;t equal. Is there any algorithm or filter to alter the intensity of an image. Pls Help
What do you mean by intensity ? Are you talking about saturation ? How do you calculate it ? Once you use bilinear interpolation, you're kind of inventing inbetween values, bicubic is more accurate, but still the same, really. Christian Graus - Microsoft MVP - C++
-
What do you mean by intensity ? Are you talking about saturation ? How do you calculate it ? Once you use bilinear interpolation, you're kind of inventing inbetween values, bicubic is more accurate, but still the same, really. Christian Graus - Microsoft MVP - C++
Thanx for ur reply Intensity means value of each pixel eg: If I stretch a yellow color square of one unit to two units then after stretching it should be light yellow and if I stretch further more it should me even more lighter. Is there any density filter which can be used instead of bilinear interpolation?
-
Thanx for ur reply Intensity means value of each pixel eg: If I stretch a yellow color square of one unit to two units then after stretching it should be light yellow and if I stretch further more it should me even more lighter. Is there any density filter which can be used instead of bilinear interpolation?
Arrun wrote:
Intensity means value of each pixel
So, just the RGB value ? Then hard red == hard blue == hard green, how is that useful ?
Arrun wrote:
If I stretch a yellow color square of one unit to two units then after stretching it should be light yellow and if I stretch further more it should me even more lighter.
OK - almost the entire universe does not want this behaviour, which is why you don't get it as standard. If you write your own bilinear filter ( or use the one in my image processing article ), you could work out the factor you've stretched by, and then scale each pixel value accordingly, so if you increase the size of the image by 50%, you can change the filter to also lower the RGB values by 1/3, to get the desired result. Christian Graus - Microsoft MVP - C++
-
Arrun wrote:
Intensity means value of each pixel
So, just the RGB value ? Then hard red == hard blue == hard green, how is that useful ?
Arrun wrote:
If I stretch a yellow color square of one unit to two units then after stretching it should be light yellow and if I stretch further more it should me even more lighter.
OK - almost the entire universe does not want this behaviour, which is why you don't get it as standard. If you write your own bilinear filter ( or use the one in my image processing article ), you could work out the factor you've stretched by, and then scale each pixel value accordingly, so if you increase the size of the image by 50%, you can change the filter to also lower the RGB values by 1/3, to get the desired result. Christian Graus - Microsoft MVP - C++
Thanx for ur reply I checked it with 8 bit bmp but when I reduce or increase the pixel values the color change not the intensity eg: If I use yellow color square and stretch it by two units and divide the pixel value by 2, the color changes to green and not to light yellow. Pls help
-
Thanx for ur reply I checked it with 8 bit bmp but when I reduce or increase the pixel values the color change not the intensity eg: If I use yellow color square and stretch it by two units and divide the pixel value by 2, the color changes to green and not to light yellow. Pls help
You can't be changing pixel values in an 8 bit bitmap, because what you're actually changing are references into a palette. You need to use 16 bit at least to be changing colours like that.
Arrun wrote:
the color change not the intensity
How can the intensity stay the same if the color changes ? Why do you even want to do this ? Christian Graus - Microsoft MVP - C++