Ask Your Question

Venky009's profile - activity

2016-08-25 05:20:53 -0600 received badge  Enthusiast
2016-08-20 06:26:16 -0600 commented answer How to remove green color i.e. to set it to 0 in an image?

cool..thanx for feedback..i wont repeat it again

2016-08-20 06:02:10 -0600 commented question How to remove green color i.e. to set it to 0 in an image?

if it is pure green ..how to do that without for loop pixel accessing ..is there anyway..@berak..i just want to know that logic

2016-08-20 05:55:16 -0600 commented answer How to remove green color i.e. to set it to 0 in an image?

its ok bro..but how to access the pixel without for loop

2016-08-20 05:41:22 -0600 answered a question How to remove green color i.e. to set it to 0 in an image?

load the img into mat ..read the r g b s pixel wise ..and use the condition if (r == 0 && g == 255 && b == 0) to make that pixel to 0..You can change the logic according to ur img intensities.

{;

cv::Mat img = cv::imread("inputPath");//3channel imagepath;

byte* img_ptr = (byte*)img.data;
int r, g, b;
for (int y = 0; y < img.rows; y++)
{
    for (int x = 0; x < img.cols; x++)
    {
        r = img_ptr[x * 3 + 2 + y*img.cols * 3];
        g = img_ptr[x * 3 + 1 + y*img.cols * 3];
        b = img_ptr[x * 3 + 0 + y*img.cols * 3];

        if (r == 0 && g == 255 && b == 0)
        {
            img_ptr[x * 3 + 2 + y*img.cols * 3]=0;
            img_ptr[x * 3 + 1 + y*img.cols * 3]=0;
            img_ptr[x * 3 + 0 + y*img.cols * 3]=0;
        }
    }
}
cv::imwrite("outputPath", img);
img.release();

}

2016-08-20 00:45:06 -0600 commented question Issue with Camera Orientation

Is it necessary to use opencv here .Because loading of mats ,,calling libs may slags the time.. cant we do these operations on frames without opencv..?

2016-08-19 06:16:09 -0600 commented question Issue with Camera Orientation

if resolution is not main concern u can resize the every frame to small and do rotate-flip then resize back the frame to its desired size..This rotate-flip on small image may saves time.we can use affine transform also for orientations

2016-08-18 02:10:28 -0600 commented question Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

Found that ..clahe algo is expecting max value of 4096 instead of (2 power of 16=65535).. Max value in my input =65535 So i stretched the input image from 65535 to 4096..Got good result instead of over saturated pixels..but didnt see contrast enhancement in output..need to work on it.. used web link github

2016-08-18 00:49:10 -0600 commented question Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

Thanks for feedback.

cv::Mat srcImage_3channels = cv::imread(InputPath, CV_LOAD_IMAGE_UNCHANGED);

    std::vector<cv::Mat> channels;
    cv::split(srcImage_3channels, channels);
    test::cvClahe(channels[0], channels[0], clipLimit);
    cv::imwrite(OutputPath, channels[0]);

    srcImage_3channels.release();
    srcImage.release();


            here used clipLimit=5;

Tried as u suggest ,but got same result as earlier one

2016-08-18 00:20:48 -0600 commented question Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

@berak. srcImage is single channel image..plz see its declaration

2016-08-18 00:16:24 -0600 commented question Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

I verified all imgs loadings ,savings and intensities using pixel access..all are gone well

2016-08-18 00:11:03 -0600 received badge  Editor (source)
2016-08-18 00:05:20 -0600 commented question Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

I am seeing random and strange intensities in the output..they look like over saturated and under saturated.. I stretched this 16 bit input img to 8 bit ,then applied the clahe on this 8 bit..i got the expected result..(this is for verification)

2016-08-17 23:26:49 -0600 asked a question Does clahe work on 16uc1 image?I tried myself but got unexpected result.Plz suggest me the way that we can use the Clahe on 16bit(3channel/1channel) image..Thanx

I used mat in opencv cpp code to load images

Here is my code:

cv::Mat srcImage_3channels = cv::imread(InputPath, CV_LOAD_IMAGE_UNCHANGED);
    cv::Mat srcImage = cv::Mat::zeros(srcImage_3channels.rows, srcImage_3channels.cols, CV_16UC1);

    UINT16* src_3 = (UINT16*)srcImage_3channels.data;
    UINT16* src = (UINT16*)srcImage.data;

    int B = 0;

    for (int j = 0; j < srcImage_3channels.rows; j++)
    {
        for (int i = 0; i < srcImage_3channels.cols; i ++)
        {

            B = src_3[i*3 + j*srcImage_3channels.cols * 3];

            src[(i)+j*srcImage.cols] = (UINT16)B;//getting single channel from 3 channel image
        }

    }

    test::cvClahe(srcImage, srcImage, clipLimit);
            cv::imwrite(OutputPath, srcImage);
2015-12-29 06:28:31 -0600 received badge  Critic (source)
2015-11-18 01:45:19 -0600 asked a question could you suggest me any alternative is for arrayList other than array

Hi,

Java language,Android platform:- I came to know that arraylist operations are slower than array.Please see the attched screenshot.Where I added the no of elements each by one by incrementing the index .

performed operatins for test :array.set(index,value),arrayList.set(index,value)

Where time is measured for adding all no.of elements.

could you suggest me any alternative is for arrayList other than array to save the time.

Condition:I dont know the no of elements to be added to array list , it is dynamic.

Sorry for my bad explanation..

Thanks in advance, Venkyimage description

2015-11-18 00:39:34 -0600 commented answer How to get and modify the pixel of Mat in Java?

Role of an array in Mat Pixel access/modify:

Consideran Mat 2*2 with single channel of type byte.Represent it with by m

get the image data m.rows->2; m.cols->2; m.typ->8uc1;

suppose elements in m are,

5 10 15 20

m.get(0,0)[0] -->5;;//returns only specified location element.

Means we have to call m.get() 4 times to get all elements in m.

Use af array in accessing;

Suppose byte [] b=new byte[2];//size is 2 here

m.get(0,b)--> {5,10};//retuns the row of length specified by byte b

where 0--> id for row of mat ..To get next row we should use 1

now, b[0]-->5; b[1]-->10;

Means we have to call m.get() 2 times to get all elements in m.

"m.get() 2 times" is speeder than "m.get() 4 times ... (more)

2015-11-02 23:52:54 -0600 received badge  Supporter (source)