[Scilab-users] using SciCV

P M p.muehlmann at gmail.com
Tue Mar 5 14:08:44 CET 2019


... 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 imageimg = mlist(['v','r','g','b','a'], zeros(10,10),
zeros(10,10), zeros(10,10), zeros(10,10));// extract the R-planeR =
img.r;// modify the R-planeR(3:6,4:8) = 255;// write the R-plane back
to the imageimg.r = R;// check the image contentdisp(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 <p.muehlmann at gmail.com>:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20190305/add857cd/attachment.htm>


More information about the users mailing list