android - How detect long edges of wall to prepare mask and recolor -


main idea allow user recolor specific wall based user selection. have implemented feature using cvfloodfill (helps prepare mask image) can me change relative hsv value wall can retain edges. problem solution works on color , walls repainted instead of single wall selected user.

i have tried canny edge detection able detect edge not able convert area.

please find below code using repaint function

  1. prepare mask

    cvfloodfill(mask, new cvpoint(295, 75), new cvscalar(255, 255, 255,0), cvscalarall(1), cvscalarall(1), null, 4, null);

  2. split channel

    cvsplit(hsvimage, hchannel, schannel, vchannel, null);

  3. change color

    cvadds(vchannel, new cvscalar(255*(0.76-0.40),0,0,0), vchannel, mask);

how can detect edges , corresponding area image.

i looking solution can other opencv should possible iphone , android

sample image

edit

i able achieve result below image using below steps

cvcvtcolor(image, gray, cv_bgr2gray);    cvsmooth(gray,smooth,cv_gaussian,7,7,0,0); cvcanny(smooth, canny, 10, 250, 5); 

there 2 problem output not sure how resolve them 1. close near edges 2. remove small edges

enter image description here

i think might have solution you! there sample file called watershed.cpp in opencv, run , you'll result :

watershed short line keypoints

you can make user draw on screen discriminate each wall. if want more precise can outline areas (without touching other lines) :

better outline

and tada! :

pretty result ;)

with little work can make user-friendly (cancel last line, connect areas etc...)

hope helps!


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -