[Scilab-users] using SciCV

classic Classic list List threaded Threaded
2 messages Options
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] using SciCV

Dear all,

I read an RGB image with ScCV imread:
img = imread("path_to_image",CV_LOAD_IMAGE_COLOR);
The result is an image of type:  CV_8UC3
I can display the image pixel values with: disp(img)
The image itself is of type: Mat (Mlist)
So far, so clear.

Now, I want to extract a single plane..lets say the R-plane
I would normally do something like this:
R = img( : , : , 1)
But for some reason it does not work.
It seems that one can only extract pixel values from all 3 planes altogether.....If so, why?
So the question comes down to:   How to extract/change a single pixel value of a single plane in SciCV ?

Thank you,
Philipp

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

Re: using SciCV

... Ok, my approach:

R = img( : , : , 1)
G = img( : , : , 2)
B = img( : , : , 3)
does not work ... although I remember it somehow using it with IPD & scilab 5.4.1...good old times :-)

In SciCV a image is a mlist

But still same issue:
/// build the image
img = mlist(['v','r','g','b','a'], zeros(10,10), zeros(10,10), zeros(10,10), zeros(10,10));
// extract the R-plane
R = img.r;
// modify the R-plane
R(3:6,4:8) = 255;
// write the R-plane back to the image
img.r = R;
// check the image content
disp(img);
Why is this not possible with an image nativly created with SciCV ?

Thanks,
Philipp





Am Di., 5. März 2019 um 10:24 Uhr schrieb P M <[hidden email]>:
Dear all,

I read an RGB image with ScCV imread:
img = imread("path_to_image",CV_LOAD_IMAGE_COLOR);
The result is an image of type:  CV_8UC3
I can display the image pixel values with: disp(img)
The image itself is of type: Mat (Mlist)
So far, so clear.

Now, I want to extract a single plane..lets say the R-plane
I would normally do something like this:
R = img( : , : , 1)
But for some reason it does not work.
It seems that one can only extract pixel values from all 3 planes altogether.....If so, why?
So the question comes down to:   How to extract/change a single pixel value of a single plane in SciCV ?

Thank you,
Philipp

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users