From: Kenneth Galea on 21 Mar 2010 17:33 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <80222c2b-7d35-42d7-983c-4ed2bb1dbf7d(a)m37g2000yqf.googlegroups.com>... > Kenneth Galea No those values were for testing purposes only!! Just to be clear and precise. I have a camera which captures an image with a white background (640x480). I also have a robotic arm (which is outside this image border in order to not interfere i.e. be recognised as an object when the image is taken). Due to this reason since my robotic arm is small it is not reaching that far as I wish and thus I cannot use the maximum out of it. Thus my idea was to move the robotic arm more close to the border (resulting in a small area which would be lost due to cropping the part were the arm can be seen but a much larger area gained on the other hand due to more length achieved). Now what I actually require is that top middle of the (640x480) image captured (e.g. a box with an area of 100 by 100) would be always set as white such that the robotic arm would not be recognised as an object even though it makes part of the image!! Hope I'm clear Thanks Kenneth
From: Kenneth Galea on 21 Mar 2010 17:49 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <98732dee-2af0-4941-a72e-275045cc8b73(a)y17g2000yqd.googlegroups.com>... > Kenneth Galea > Use imcrop (I'm sure you'll figure it out) and then use poly2mask(). > > Or use imrect() and the createMask() method of imrect(). Sorry to ask again. But I can't understand the purpose of imcrop if I use poly2mask() since from what I can see poly2mask(x,y,m,n) needs 4 input arguments where x and y are where pixels inside x and y are set to 1 while the rest are set to 0. here's my code : white = imread('C:\Users\Kenneth\Desktop\white.jpg'); f = imread('C:\Users\Kenneth\Desktop\black.jpg'); size (f) whos f [m,n] = size (f); X=m; Y=n/3; rect = [200 12 240 100] %selected area to crop I2 = imcrop(f, rect) %crop specified black area figure imshow (I2) %show cropped area x = [0 186 54 190]; y = [0 100 209 500]; BW = poly2mask(x, y, X, Y) figure imshow (BW) I can't find a connection between rect and x,y & f and X, Y :/ Thanks Kenneth
From: Kenneth Galea on 21 Mar 2010 18:30 "Kenneth Galea" <k.galea(a)hotmail.com> wrote in message <ho63ae$hq9$1(a)fred.mathworks.com>... > ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <80222c2b-7d35-42d7-983c-4ed2bb1dbf7d(a)m37g2000yqf.googlegroups.com>... > > Kenneth Galea This is something similar to what I need. I found this link: http://blogs.mathworks.com/steve/2007/02/24/roipoly-rectangular-regions-and-logical-indexing/ Now considering the last image shown in this link, I need that "polygon" which in my case is a square to be completely white Thanks Kenneth
From: ImageAnalyst on 21 Mar 2010 19:42 Then why don't you just say noRobotArmImage = originalImageWithArm; % Initialize as the original image. noRobotArmImage(1:100, 190:289) = 255; % White out the part with the robot arm in it. Or set it to the white background gray level - whatever it takes to make that portion not be considered by your subsequent processing (be it thresholding, or whatever).
First
|
Prev
|
Pages: 1 2 Prev: how to make SVM toolbox functioning? Next: how can i overlay two images |