0

I wrote a code in which i used mention below statement

editor.insertHtml(paragraph.getOuterHtml());

which throws Uncaught TypeError: Object # has no method 'getHtml' in chrome. However when i run my code on firefox i got

    TypeError: startNode.getFirst() is null
[Break On This Error]   

...tartNode = startNode.getFirst().insertBeforeMe( range.document.createText( '' ) ...

while debug using firebug i found that my code is here which is an inbuild function of ckeditor 5.3

 var getNativeListener = function( domObject, eventName )
{
return function( domEvent )
{
// In FF, when reloading the page with the editor focused, it may
// throw an error because the CKEDITOR global is not anymore
// available. So, we check it here first. (#2923)
if ( typeof CKEDITOR != 'undefined' )
domObject.fire( eventName, new CKEDITOR.dom.event( domEvent ) );
};
}; 

Now,please tell what will i do to remove an error??


Manually turn RGB image into Grayscale Matlab

Let me preface this by saying, I understand there are functions that would do this for me, but I wanted to do it manually so I could understand what exactly is happening here.

So my goal is to read in a RGB image and turn it into a grayscale. All of my image processing work up to this point has been solely grayscale based, so I am a little bit lost.

I have tried to first read in the image by doing

fid = fopen('color.raw');
myimage = imread(fid, [512 384], 'uint8');
fclose(fid);

but myimage ends up as an empty 0 x 0 matrix. I think I need to assign an "R" "G" and "B" value to each pixel, thus giving each pixel three values for the three colors, but I am not sure if thats correct, and even how to attempt that.

my question is the following: How would I read in a RGB image and then turn into a grayscale one.

EDIT: So I understand how I would go about turning the RGB into the grayscale after getting the R G and B values, but I cannot seem to make Matlab read in the image, can anyone offer any assistance? using imread seems to make the most sense, but

[pathname] = ...
     uigetfile({'*.raw';'*.mdl';'*.mat';'*.*'},'File Selector');
fid = fopen(pathname);
myimage = imread(fid);
fclose(fid);

Is not working, im getting an error of invalid filename for fopen, and I really do not understand why.

4

0 に答える 0