From: ImageAnalyst on 11 May 2010 22:27 On May 11, 8:02 pm, "Samiov " <Samy...(a)yahoo.fr> wrote: > ImageAnalyst <imageanal...(a)mailinator.com> wrote in message <26535f93-cbe2-4774-a129-cc08bb1d8...(a)r11g2000yqa.googlegroups.com>... > > On May 10, 4:32 pm, "Sami Oueslati" <Samy...(a)yahoo.fr> wrote: > > It looks like each tile is replaced by the value of the center (kind > > of a strange thing to want to do), but not exactly because there are > > still some non-uniform gray levels around the border - but maybe > > that's just because you mocked it up in Photoshop or something. > > > So just do something like this > > > outputImage(tileTopRow:tileBottomRow, tileLeftCol:tileRightCol) = > > inputImage(tileCenterRow, tileCenterCol); > > _________________________________________________________________________ > Thanks ImageAnalyst, I got it...please now, how to transform the tiles in uniform squares? as herehttp://drop.io/mqlwmho# ---------------------------------------------------------------------------------- Just do something like this: outputImage(tileTopRow:tileBottomRow, tileLeftCol:tileRightCol) = inputImage(tileCenterRow, tileCenterCol); I believe I've given you code somewhere above on how to scan your image. Just add this part in. I can't spend the time to write the whole complete app for you. Why do you want to make that output image anyway? What good is it?
From: Samiov on 11 May 2010 23:42 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <a96f4b4b-5742-4b75-a860-8d59cbf8a9f9(a)t17g2000yqg.googlegroups.com>... > On May 11, 8:02 pm, "Samiov " <Samy...(a)yahoo.fr> wrote: > > ImageAnalyst <imageanal...(a)mailinator.com> wrote in message <26535f93-cbe2-4774-a129-cc08bb1d8...(a)r11g2000yqa.googlegroups.com>... > ---------------------------------------------------------------------------------- > Just do something like this: > outputImage(tileTopRow:tileBottomRow, tileLeftCol:tileRightCol) = > inputImage(tileCenterRow, tileCenterCol); > > I believe I've given you code somewhere above on how to scan your > image. Just add this part in. I can't spend the time to write the > whole complete app for you. Why do you want to make that output image > anyway? What good is it? --------------------------------------------------------------------------------------- Hi, I've done what you said..You thought that I was asking the same question but I've asked you something else...Now that I have the tiles coloured with one graylevel, I want to transform the tiles (they have different rectangular form) in tiles that have a uniform square form (as a checker board) I've modified the image "explication" that I've added previously, maybe you thought It was the same image. --> http://drop.io/mqlwmho# I'm doing this because as you see, the original image is a woven fabric and I want to identify when the vertical yarn passes above and below the horizontal yarn --> I've constructed the grid to localize the intersections between yarns, and identifying the colour of the center of each tile, I conclude if the yarn passes above or below --> to finally have a simplified image (as a checker board) composed of white (vertical yarn above) and black (vertical yarn below) tiles.
From: Samiov on 12 May 2010 21:33 Hi ImageAnalyst, Here's the code, I've added what you said at the end of it, but what are the right indexes that I must choose to have my finalImage with tiles that have square's form and not rectangle's form as in my grayImage ??? Thanks, hope you'll be patient with me.. ----------------------------------------------------------------------------------------------- finalImage = grayImage; LigneH = [1 LigneH lign]; LigneV = [1 LigneV col]; lastTileX = length(LigneH); lastTileY = length(LigneV); counter = 0; for tileX = 1 : lastTileX-1 column1 = LigneH(tileX) column2 = LigneH(tileX+1) if column1 > col || column2 > col % Skip bad ones. continue; end for tileY = 1 : lastTileY-1 row1 = LigneV(tileY) row2 = LigneV(tileY+1) if row1 > lign || row2 > lign % Skip bad ones. continue; end subImage = grayImage(row1:row2, column1:column2); counter = counter + 1 xc = int32((column1 + column2)/2); yc = int32((row1 + row2)/2); pixelValue = grayImage(xc,yc); finalImage (row1:row2, column1:column2) = pixelValue; end end
From: Samiov on 13 May 2010 17:32 ImageAnalyst <imageanalyst(a)mailinator.com> ------------------------------------------------------------------------------------ > I believe I've given you code somewhere above on how to scan your > image. Just add this part in. I can't spend the time to write the > whole complete app for you. Why do you want to make that output image > anyway? What good is it? ------------------------------------------------------------------------------------ Hi ImageAnalyst, Sorry I must insist, cause I worked on it and nothing...please review this... xc = int32((column1 + column2)/2); yc = int32((row1 + row2)/2); finalImage (row1:row2, column1:column2) = grayImage(xc,yc) Ok so my finalImage has a number of rectangular tiles (5x8) where each tile is coloured by the graylevel of the center of the correspondent tile of the original grayImage...that's done, ok...but now the tiles haven't the same size..I want to convert them to tiles that has a regular square size (we can say 100x100 each tile)...Pleaseeeeeee how to do it????!!!!!!!!!!!!
From: ImageAnalyst on 13 May 2010 20:20
But your image is not such that they should be all the same size squares so why do you want to do this? In any event, one way is to just average together the widths and heights of all the tiles and center the new tile sizes on each (old) tile centroid. Of course some tile edges will no longer align with your fabric weave. |